Hi everyone, I'm generating a sinusoid of the form cos(wt + phi), then taking the FFT. I was expecting to find the phase of the FFT (at the frequency peak) allows me to determine 'phi' in the generating sinusoid, but there appears to be little correlation! For example, plotting cos(2 Pi x/10) from x=0 to 2million (with step 1) , the phase at the FFT is 2.82?!! Surely the phase should be zero since the inital phase at x=0 was zero? Thanks for your help! Peter Moreton
Phase of FFT compared to phase of Sinusoid
Started by ●March 21, 2006
Reply by ●March 21, 20062006-03-21
peter.moreton@gmail.com wrote:> Hi everyone, > > I'm generating a sinusoid of the form cos(wt + phi), then taking the > FFT. > > I was expecting to find the phase of the FFT (at the frequency peak) > allows me to determine 'phi' in the generating sinusoid, but there > appears to be little correlation! > > For example, > > plotting cos(2 Pi x/10) from x=0 to 2million (with step 1) , the phase > at the FFT is 2.82?!! Surely the phase should be zero since the inital > phase at x=0 was zero? > > Thanks for your help! > > > Peter Moreton >So you're saying you took a 2 million point FFT? I have my doubts about this. Could you describe exactly what you did. Cheers, David
Reply by ●March 21, 20062006-03-21
<peter.moreton@gmail.com> wrote in message news:1142941236.513153.267210@j33g2000cwa.googlegroups.com...> Hi everyone, > > I'm generating a sinusoid of the form cos(wt + phi), then taking the > FFT. > > I was expecting to find the phase of the FFT (at the frequency peak) > allows me to determine 'phi' in the generating sinusoid, but there > appears to be little correlation! > > For example, > > plotting cos(2 Pi x/10) from x=0 to 2million (with step 1) , the phase > at the FFT is 2.82?!! Surely the phase should be zero since the inital > phase at x=0 was zero? >That's odd -what do you get if you fft(cos(2 Pi x/16)) with x=0 to 15 ? best of luck - Mike
Reply by ●March 21, 20062006-03-21
Thanks guys, I have worked out the problem. When i did fft(cos(2 Pi x/16)) with x=0 to 15, the phase was correct. My problem was coming from the fact that my frequency was not an integer number of wavelengths over the range. This gives spectral leakage into neighbouring bins and the phase is no longer correct. But say the corrrect frequency is at f =15.125, and there is a pi phase jump between 15 and 16. If i interpolate the phase by doing 0.125 x pi= 0.393, then add the phase i would expect(phi), this gives the correct phase! Thanks for your help Mike, sometimes i forget the best advise is keep it simple! Cheers, Peter
Reply by ●March 21, 20062006-03-21
Thanks guys, I have worked out the problem. When i did fft(cos(2 Pi x/16)) with x=0 to 15, the phase was correct. My problem was coming from the fact that my frequency was not an integer number of wavelengths over the range. This gives spectral leakage into neighbouring bins and the phase is no longer correct. But say the corrrect frequency is at f =15.125, and there is a pi phase jump between 15 and 16. If i interpolate the phase by doing 0.125 x pi= 0.393, then add the phase i would expect(phi), this gives the correct phase! Thanks for your help Mike, sometimes i forget the best advise is keep it simple! Cheers, Peter
Reply by ●March 21, 20062006-03-21
Thanks guys, I have worked out the problem. When i did fft(cos(2 Pi x/16)) with x=0 to 15, the phase was correct. My problem was coming from the fact that my frequency was not an integer number of wavelengths over the range. This gives spectral leakage into neighbouring bins and the phase is no longer correct. But say the corrrect frequency is at f =15.125, and there is a pi phase jump between 15 and 16. If i interpolate the phase by doing 0.125 x pi= 0.393, then add the phase i would expect(phi), this gives the correct phase! Thanks for your help Mike, sometimes i forget the best advise is keep it simple! Cheers, Peter
Reply by ●March 21, 20062006-03-21
Thanks guys, I have worked out the problem. When i did fft(cos(2 Pi x/16)) with x=0 to 15, the phase was correct. My problem was coming from the fact that my frequency was not an integer number of wavelengths over the range. This gives spectral leakage into neighbouring bins and the phase is no longer correct. But say the corrrect frequency is at f =15.125, and there is a pi phase jump between 15 and 16. If i interpolate the phase by doing 0.125 x pi= 0.393, then add the phase i would expect(phi), this gives the correct phase! Thanks for your help Mike, sometimes i forget the best advise is keep it simple! Cheers, Peter
Reply by ●March 21, 20062006-03-21
Thanks guys, I have worked out the problem. When i did fft(cos(2 Pi x/16)) with x=0 to 15, the phase was correct. My problem was coming from the fact that my frequency was not an integer number of wavelengths over the range. This gives spectral leakage into neighbouring bins and the phase is no longer correct. But say the corrrect frequency is at f =15.125, and there is a pi phase jump between 15 and 16. If i interpolate the phase by doing 0.125 x pi= 0.393, then add the phase i would expect(phi), this gives the correct phase! Thanks for your help Mike, sometimes i forget the best advise is keep it simple! Cheers, Peter
Reply by ●March 21, 20062006-03-21
Thanks guys, I have worked out the problem. When i did fft(cos(2 Pi x/16)) with x=0 to 15, the phase was correct. My problem was coming from the fact that my frequency was not an integer number of wavelengths over the range. This gives spectral leakage into neighbouring bins and the phase is no longer correct. But say the corrrect frequency is at f =15.125, and there is a pi phase jump between 15 and 16. If i interpolate the phase by doing 0.125 x pi= 0.393, then add the phase i would expect(phi), this gives the correct phase! Thanks for your help Mike, sometimes i forget the best advise is keep it simple! Cheers, Peter
Reply by ●March 21, 20062006-03-21
Thanks guys, I have worked out the problem. When i did fft(cos(2 Pi x/16)) with x=0 to 15, the phase was correct. My problem was coming from the fact that my frequency was not an integer number of wavelengths over the range. This gives spectral leakage into neighbouring bins and the phase is no longer correct. But say the corrrect frequency is at f =15.125, and there is a pi phase jump between 15 and 16. If i interpolate the phase by doing 0.125 x pi= 0.393, then add the phase i would expect(phi), this gives the correct phase! Thanks for your help Mike, sometimes i forget the best advise is keep it simple! Cheers, Peter