0

I have recently been using fft() to find the frequency response of my data, and compared it to fvtool. I have found that while the magnitude looks the same, the phase looks entirely different.

I was wondering how the fvtool creates the phase response.

For fft, I just use angle() after fft() and plot it vs frequency (the same X axis as magnitude response).

For fvtool, I tried to change the number of points for FFT in analysis parameters but I the phase response is still different.

E.g. given sample signal x(t) such as (32 samples):

0.0627905195293134
0.125333233564304
0.187381314585725
0.248689887164855
0.309016994374947
0.368124552684678
0.425779291565073
0.481753674101715
0.535826794978997
0.587785252292473
0.637423989748690
0.684547105928689
0.728968627421412
0.770513242775789
0.809016994374948
0.844327925502015
0.876306680043864
0.904827052466020
0.929776485888251
0.951056516295154
0.968583161128631
0.982287250728689
0.992114701314478
0.998026728428272
1
0.998026728428272
0.992114701314478
0.982287250728689
0.968583161128631
0.951056516295154
0.929776485888252
0.904827052466020

using:

angle = plot(samplingFrequency/2, angle(fft(x, 32)))

vs

fvtool(x)

With analysis parameter set for 32 points does not yield the same phase result. Magnitude result looks similar, though slightly different.

Thank you in advance for any help.

mkierc
  • 1,193
  • 2
  • 15
  • 28
user8481
  • 1
  • 1
  • It's difficult to say definitively without seeing an example, but I suspect the difference is due to the fact that `fvtool` uses *unwrapped* phase. To get a similar effect manually, you should plot `unwrap(phase)`. – Oliver Charlesworth Aug 15 '14 at 19:58
  • @OliCharlesworth Thank you for your response, to clarify, my example is to set x = (the array of values that I posted), and performed fft() on it, but when I did fvtool(x), the phase response shown was very different, so I dont understand the difference between the two. Also, I did do wrap() on the phase from fft(), the difference I mentioned was from the slope in which fvtool was a lot steeper and the phase was an order of magnitude lower – user8481 Aug 18 '14 at 21:37

1 Answers1

0

FFT phase has to be unwrapped to make sense. Otherwise there will be discontinuities of 2pi. using unwarp() function in matlab

Ahmad
  • 1