Analyzing the FFT graphs in MATLAB

2 views (last 30 days)
Utkarsh Kumar
Utkarsh Kumar on 15 Apr 2014
Commented: dpb on 15 Apr 2014
I have acquired biosignals and now i wish to analyze its frequency contents using MATLAB's FFT function. My data consists of an array of let's say 3000 datas. On applying the fft function it returns me an array of 3000 complex datas. I plot the magnitude and phase plots individually.
Here are my questions :
1) Since FFT works on data sets having some 2^n datas, what happens when i run it on a data set which doesnot contain 2^n datas. Readers please note that i am not using the padding extension of the FFT function, i.e., as given in the MATLAB example i am not extending my data matrix to the next power of 2.
2)What default window does MATLAB use for fft calculation. Is it rectangular?
3)I get the fft graph of the finite data set plotted against the array index. How do i find the corresponding frequency?
4)What exactly does the function unwrap do for the calculation of phase.
I need the answers as it is crucial to my research.

Answers (1)

dpb
dpb on 15 Apr 2014
Edited: dpb on 15 Apr 2014
1) FFT as implemented in Matlab uses the N points given so your first "Since ..." conclusion is wrong. What happens is you get the DFT of the dataset you give it over the number of points requested. There's a link there to the implementation with some more detail.
2) Yes, it uses no window you don't specifically apply hence the result w/o windowing is the effect of rectangular window.
3) Look at the doc for fft -- it gives an example of computing the associated frequency for a plot of a power spectrum from the sample data. Apply the same to your particular dataset.
4) As it says in the doc's it does a minimal transformation of the returned computed phase to as nearly a continuous phase as it can w/ a limited repertoire of just removing discontinuities >=pi (by default, you can make the discontinuity band whatever you wish depending on the characteristics of your particular signal).
Read the doc's carefully and look at the example particularly at the bottom of
doc fft %, it's very significant.
  1 Comment
dpb
dpb on 15 Apr 2014
OBTW, use
doc fft
for the example as, iirc,
help fft
doesn't have the psd example.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!