Tuesday 15 January 2013

Matlab, DFT, FFT, frequency range; -



Matlab, DFT, FFT, frequency range; -

i having hard time understand how fft-function in matlab works. according to:

http://www.mathworks.de/help/matlab/math/fast-fourier-transform-fft.html

fs/n distance between sampled points in spectrum, fs sampling frequency , n length of signal. code present, extract frequencies (although not know why), according implementation of fft, present:

http://www.mathworks.de/help/matlab/ref/fft.html

the distance between points in spectrum should rather be: 1/fs. because instead of index j 1 inserts j*t, t = 1/fs sampling time , can calculate distance between points, should not fs/n.

i grateful if explain me distance between points in frequency domain , why so:)

[edit] not matlab-specific problem. more problem relationship between fourier-transformation , discrete-fourier-transformation , scaling/units of frequency-axis. pretty explanation can found in pdf-document @ page 3:

texas.math.ttu.edu/~gilliam/ttu/dft.pdf

[/edit]

the distance between frequency points on spectrum fs/n in both cases, , right value. if take code in http://www.mathworks.co.uk/help/matlab/ref/fft.html, have:

>> fs = 1000; % sampling frequency >> t = 1/fs; % sample time >> l = 1000; % length of signal >> t = (0:l-1)*t; % time vector >> nfft = 2^nextpow2(l); % next powerfulness of 2 length of y >> f = fs/2*linspace(0,1,nfft/2+1); >> f(2)-f(1) ans = 0.97656 >> fs/nfft ans = 0.97656

you can double-check other f(n+1)-f(n), they're same.

matlab fft dft

No comments:

Post a Comment