How to calculate the amplitude and phase angle of the output fft () from a real value?

I have 24 counts from a real sign. I execute the fft() function on the sample and get complex output. I want to get the amplitude and phase angle of each of the irregular harmonics. I know that my calculations should take into account pseudonyms, since I have reliable data. Like me:

(1) convert from two-way to one-way Fourier transform,

I heard a few things here. For example, multiply the first 12 harmonics (i.e., from the 2nd to the 13th elements of the output fft() ) by two and discard the remaining harmonics (i.e., keep the 1st-13th elements of the output fft() ) ?

(2) calculate the amplitude of the one-sided Fourier transform,

I know that I can use the Mod() function, but when will I do it? Before or after switching from two sides to one-sided?

(3) calculate the phase angle of the one-way Fourier transform.

I know that I can use the atan() function to relate the imaginary to the real parts of the output of fft() , but then again, when do I do this? Before or after two-way one-way conversion? Also, what if atan is undefined?

Thanks.

+4
source share
1 answer

Since your input is large, the output of the FFT will be symmetrical with respect to N / 2, so you can just look at the first N / 2 bins and scale the value 2 times. For the phase, you ideally need the atan2 function, which takes real and imaginary components as separate arguments and returns the result of 4 quadrants.

+3
source

Source: https://habr.com/ru/post/1382991/


All Articles