0

I have a periodic series of 360 values. How can I use the fftw c libraries to get the amplitude and phase of the first, second, third and fourth harmonic?

If I do this for N=360

fftw_plan_r2r_1d(N,input_array,output_array,FFTW_R2HC,FFTW_ESTIMATE);

I can get the Discrete Fourier Transform where output_array[i] is the real portion of the ith element of a halfcomplex array while output_array[N-i] is the imaginary portion of the ith value.

So if I want the amplitude or magnitude(??) of the first harmonic should I do this?

ampl_1sth=sqrt(output_array[1]*output_array[1]+output_array[N-1]*output_array[N-1])

Is that correct? then the amplitude of the second harmonic will be the same but with output_array[2] and so on right?

And then how can I get the phase of the first, second, third and fourth harmonic?

Thank you.

Atirag
  • 1,660
  • 7
  • 32
  • 60
  • Duplicate: http://dsp.stackexchange.com/questions/9664/getting-the-amplitude-and-phase-of-harmonics-in-c – Paul R Jun 21 '13 at 06:00
  • 1
    Check my [answer](http://dsp.stackexchange.com/questions/9664/getting-the-amplitude-and-phase-of-harmonics-in-c/9672#9672) to your question on dsp.SE. – Matt L. Jun 21 '13 at 08:03

0 Answers0