DSPRelated.com
Forums

Phase of FFT compared to phase of Sinusoid

Started by Unknown March 21, 2006
robert bristow-johnson wrote:
> Ron N. wrote: > > Referencing to sample 0 (without the odd rotation) only > > gives the smallest error for sample sinusoids of an exact bin > > frequency. > > i don't know what this is about. could you elaborate more about the > basis of this assertion you are making? > > > So referencing to sample 0 will give wrong results when > > any waveform which is not periodic in N is fed to an FFT/DFT and > > you want the best phase correlation from any single FFT result bin. > > i see no justification to this statement. me still suspects this has > something to do with the fact that the Hann window or whatever other > window used might be maximum around sample N/2.
Before diving into the math, I suggest trying a couple experiments. Assume we call the DC coefficient of an FFT "bin 0". Assume a full width rectangular window, no center weighting. Let's look at the real part of FFT bin 4. That should match a cosine wave of 4 cycles which has 0 phase (and a positive maxima) at both sample 0 and sample n/2. Now vary the test cosine from 3.9 cycles to 4.1 cycles per FFT aperature while first keeping the test cosine with a phase of 0 at sample 0, then again with the test cosine keeping a constant phase of 0 at sample n/2. Compare the FFT results looking at the phase represented by complex bin 4. Do the phase results differ? Now take the exact 4 cycle cosine of amplitude 1, whose samples should be the same as a FIR filter kernel which would calculate the real part of DFT/FFT bin 4. Compute the ASDF between the 4 cycle FIR and a 4.1 cycle sample with 0 phase at sample 0, then a 4.1 cycle cosine sample with 0 phase at sample n/2. Is the ASDF of the two different? Where might my understanding, calculations, or definitions be different from yours? Thanks. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
robert bristow-johnson wrote:
> in article e01aos$bbh$1@newslocal.mitre.org, Stan Pawlukiewicz at > stanp@spam.mitre.org wrote on 03/24/2006 12:37: > > >>robert bristow-johnson wrote: >> >>>in article 1143184207.713932.128110@j33g2000cwa.googlegroups.com, Ron N. at >>>rhnlogic@yahoo.com wrote on 03/24/2006 02:10: >>> >>> >>>>So I think the in general case, the DFT/FFT phase is really >>>>referenced to sample N/2, >>> >>>no. since the DFT is an operation that literally imposes periodicity or >>>circularity on the input data, there is no qualitative difference between >>>boundaries between N/2-1 and N/2 or between N-1 and N (or 0). >> >> >>You really need to post a disclaimer. > > > about what, Stan?
You sound like W.
> > do i need a disclaimer or a qualifier to say that the difference in > relationship between exp(j*2*pi*(N/2-1)/N) and exp(j*2*pi*(N/2)/N) is the > same as the difference in relationship between exp(j*2*pi*(N-1)/N) and > exp(j*2*pi*(0)/N) ? how do the relationship between those two pairs of > numbers differ? > > what disclaimer would you have me post, Stan? (i know i'm opening myself up > to satire here, but i'll chance it.)
>
in article e08pab$j6c$1@newslocal.mitre.org, Stan Pawlukiewicz at
spam@spam.mitre.org wrote on 03/27/2006 08:28:

> > You sound like W. >
not surprized. (i was expecting something satirical.) wanna answer the question? what disclaimer would you have me post? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
in article e08pab$j6c$1@newslocal.mitre.org, Stan Pawlukiewicz at
spam@spam.mitre.org wrote on 03/27/2006 08:28:

> > You sound like W. >
not surprized. (i was expecting something satirical.) wanna answer the question? what disclaimer would you have me post? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
in article e08pab$j6c$1@newslocal.mitre.org, Stan Pawlukiewicz at
spam@spam.mitre.org wrote on 03/27/2006 08:28:

> > You sound like W. >
not surprized. (i was expecting something satirical.) wanna answer the question? what disclaimer would you have me post? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
in article e08pab$j6c$1@newslocal.mitre.org, Stan Pawlukiewicz at
spam@spam.mitre.org wrote on 03/27/2006 08:28:

> > You sound like W. >
not surprized. (i was expecting something satirical.) wanna answer the question? what disclaimer would you have me post? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
in article e08pab$j6c$1@newslocal.mitre.org, Stan Pawlukiewicz at
spam@spam.mitre.org wrote on 03/27/2006 08:28:

> > You sound like W. >
not surprized. (i was expecting something satirical.) wanna answer the question? what disclaimer would you have me post? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
in article e08pab$j6c$1@newslocal.mitre.org, Stan Pawlukiewicz at
spam@spam.mitre.org wrote on 03/27/2006 08:28:

> > You sound like W. >
not surprized. (i was expecting something satirical.) wanna answer the question? what disclaimer would you have me post? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
in article 1143355670.885892.237250@g10g2000cwb.googlegroups.com, Ron N. at
rhnlogic@yahoo.com wrote on 03/26/2006 01:47:

> Let's look at the real part of FFT bin 4. That should match a > cosine wave of 4 cycles which has 0 phase (and a positive maxima) > at both sample 0 and sample N/2. Now vary the test cosine from > 3.9 cycles to 4.1 cycles per FFT aperature while first keeping > the test cosine with a phase of 0 at sample 0, then again with > the test cosine keeping a constant phase of 0 at sample N/2. > Compare the FFT results looking at the phase represented by > complex bin 4. Do the phase results differ? > > Now take the exact 4 cycle cosine of amplitude 1, whose samples > should be the same as a FIR filter kernel which would calculate the > real part of DFT/FFT bin 4. Compute the ASDF between the 4 cycle > FIR and a 4.1 cycle sample with 0 phase at sample 0, then a 4.1 cycle > cosine sample with 0 phase at sample N/2. Is the ASDF of the two > different?
sure, they are different. and the ASDF (i like that you use that term, the method seems to me to be so much more natural to me than AMDF) will be smallest for the two sinusoids centered or phase-aligned at n=(N-1)/2. that's slightly better than phase-aligning at n=N/2.
> Where might my understanding, calculations, or definitions be > different from yours?
i think it's about definitions. (one difference in definitions results in me changing your "n" to "N".) but even so, the phase of bin k (or arg{X[k]} ) of the DFT still reflects the phase of a complex sinusoidal component (of frequency ca. 2*pi*k/N) of the DFT input, x[n], at sample 0 (or "bin 0"). if the frequency is not precisely 2*pi*k/N, small errors will creep in (due to the smearing from other sinusoidal components that results from windowing that "contaminates" bin k or X[k]), but the reference time in x[n] that phase is measured against is still n = 0, not n = N/2. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
robert bristow-johnson wrote:
> in article e08pab$j6c$1@newslocal.mitre.org, Stan Pawlukiewicz at > spam@spam.mitre.org wrote on 03/27/2006 08:28: > >> You sound like W. >> > > not surprized. (i was expecting something satirical.) > > wanna answer the question?
Just like W, a 3 minute memory. what disclaimer would you have me post? Most of this has been hashed over before. Frankly, I find it tedious to go over all of this again. For starters. (1) If you assume a periodic input, the bins are interpreted as having infinitesimal band width, which is at at variance with several peer review journal papers that span over fifty years. Terms such as the effective noise bandwitdth of a bin (ENBW) associated with a window function become difficult to interpret.
>
I could go on and on, as I and others have in the past. Fundamentally, your essential assertion that the DFT REQUIRES a periodic estension has been disputed by many people and many times.