Sampling freq in fft, what to put?

8 visualizaciones (últimos 30 días)
Tina
Tina el 10 de En. de 2014
Respondida: Youssef Khmou el 10 de En. de 2014
Hi!
I have a voltage signal vs. time. I want to have the fourier transform of it and plot it against the frequency axis. I have read the fft help, but I am lost as I don't know what to put for my sampling frequency!

Respuestas (2)

Matt J
Matt J el 10 de En. de 2014
Editada: Matt J el 10 de En. de 2014
Frequency sampling obeys
frequencysampling=1/N/timesampling
where N is the signal length and timesampling the time sample spacing. The frequency axis to plot against is then,
frequencyAxis = ( (0:N-1) -ceil((N-1)/2) )/N/timesampling;
This is the centered axis, to be used after you've applied fftshift() to your spectrum.

Youssef  Khmou
Youssef Khmou el 10 de En. de 2014
There are many tutorials on how to perform this task, understanding the methodology is by learning an example, the things that must be know about your data is the N length and the Fs sampling frequency, let us fast example :
t=0:0.01:10; % Fs=100 Hz
Fs=100;
N=length(t);
NFFT=512; % number of points for computing the spectrum
y=sin(2*pi*t*35);
fy=fft(y,NFFT)/NFFT;
frequency=(0:NFFT-1)*Fs/NFFT;
figure, plot(frequency(1:end/2),abs(fy(1:end/2));

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by