Finding the phase from FFT on MATLAB -


I know the basic frequency of my signal and therefore I also know other frequencies for harmonics, I used the FFT command Have to calculate the first 5 harmonics (for which I know their frequencies) Is it possible for me to find the phase with the available information?

Please note that I can not make sure my signal is only a duration and therefore it is necessary to calculate the phase through known frequency values.


The code is working:

  l = length (te (1, :)); % Sign length x = to (1, :); NFFT = 2 ^ next pose 2 (L); The next power of 2 y from y y = fft (x, NFFT) / L; F = linsept (1,5,5); Y (1) = []; % First value is the sum of all harmonic shapes (1); Bar (F, 2 * Ab (Y (1: 5)), 'Red' title ('Transmission error harmonics') xlabel ('harmonic') ylabel ('| y (f)' ')' figure (2); Bar (F (angle (Y (1: 5))) ('Transmission error phase') xlabel ('harmony') ylabel ('angle (radians)')  

Normally changing your Fourier is complex. So if you want to know the phase of a fixed frequency, Can calculate (ImaginePart (sample) / Realtor T (Sample)). It can be done using angle () in your case you

1- calculation fft ()

2- For all samples of FFT or

Edit: An example would be

  t = [0 0 0] To measure the angle () for those samples (which are of interest to you, the basic frequency / harmonic)  

0 = 0];; F = FFT (t); phase = angle (f); phase = angle (f (3));% If you are only interested in the phase of one frequency then < / Pre>

EDIT2: A real valuable spec The mixture should not be mixed [which originally replaced with ABS (FFT)] a complex Fourier [which is only FFT] but as you wrote that you calculate FFT, I think That's you have 'basic' FFT with complex numbers.


Comments