DSPRelated.com
Forums

phase of FFT

Started by weilai January 20, 2010
I am new to FFT and have read some online notes and help on FFT. For a
discrete time signal, I understand the FFT in Matlab will give
conjugate-symmetric phase response. Basically, the phases in the positive
and negative
frequencies have phases of the same value but opposite signs. However,
I read it online at several places that the phase shift between the
positive and negative frequencies is 180 degrees. I also read it
online that the negative frequency coefficient is the multiplication
of the positive frequency information by (-1)^(n-1). Neither of these
two cases correspond to what is happening in Matlab. I was wondering
if there are different implementations of FFT out there. I am asking this
because I have some experimental data which seem to suggest the phase
angles from a DSP in an instrument were all shifted by 180 degrees.


On 20 Jan, 13:27, "weilai" <wei.wei...@gmail.com> wrote:
> I am new to FFT and have read some online notes and help on FFT. For a > discrete time signal, I understand the FFT in Matlab will give > conjugate-symmetric phase response. Basically, the phases in the positive > and negative > frequencies have phases of the same value but opposite signs.
This is true if the original signal is real-valued. The FFT can be used to transform complex-valued data (data that have non-zero imaginary parts), in which case the result is not conjugate symmetric.
> However, > I read it online at several places that the phase shift between the > positive and negative frequencies is 180 degrees. I also read it > online that the negative frequency coefficient is the multiplication > of the positive frequency information by (-1)^(n-1).
Seems like something that might happen if the transformed signal is real-valued and symmetric: x[-n] = x[n].
> Neither of these > two cases correspond to what is happening in Matlab. I was wondering > if there are different implementations of FFT out there. I am asking this > because I have some experimental data which seem to suggest the phase > angles from a DSP in an instrument were all shifted by 180 degrees.
Whenever people state such properties, there is some sort of underlying assumption that may or may not be clearly stated. The trick is to 1) Realize that almost any result, theorem or statement is based on such assumptions 2) Try and dig out from somewhere exactky what those assumptions might be. Rune
>On 20 Jan, 13:27, "weilai" <wei.wei...@gmail.com> wrote: >> I am new to FFT and have read some online notes and help on FFT. For a >> discrete time signal, I understand the FFT in Matlab will give >> conjugate-symmetric phase response. Basically, the phases in the
positive
>> and negative >> frequencies have phases of the same value but opposite signs. > >This is true if the original signal is real-valued. The FFT >can be used to transform complex-valued data (data that have >non-zero imaginary parts), in which case the result is not >conjugate symmetric. > >> However, >> I read it online at several places that the phase shift between the >> positive and negative frequencies is 180 degrees. I also read it >> online that the negative frequency coefficient is the multiplication >> of the positive frequency information by (-1)^(n-1). > >Seems like something that might happen if the transformed signal >is real-valued and symmetric: x[-n] = x[n].
If the transformed signal is real-valued and symmetric: x[-n] = x[n], the phase difference should be 360 degrees? 180 degrees correspond to x[-n]=-x[n]?
> >> Neither of these >> two cases correspond to what is happening in Matlab. I was wondering >> if there are different implementations of FFT out there. I am asking
this
>> because I have some experimental data which seem to suggest the phase >> angles from a DSP in an instrument were all shifted by 180 degrees. > >Whenever people state such properties, there is some sort >of underlying assumption that may or may not be clearly >stated. The trick is to > >1) Realize that almost any result, theorem or statement > is based on such assumptions >2) Try and dig out from somewhere exactky what those > assumptions might be. > >Rune >
On Wed, 20 Jan 2010 06:27:22 -0600, "weilai" <wei.weilai@gmail.com> wrote:

>I have some experimental data which seem to suggest the phase >angles from a DSP in an instrument were all shifted by 180 degrees.
Be aware that, in some disciplines, the forward DFT is defined using a negative exponent (exp[-j2PIkn/N]), while in others the forward DFT is defined using a positive exponent (exp[+j2PIkn/N]). In signal processing we generally use the negative exponent form. I believe that Matlab uses the positive exponent form. Greg
On Wed, 20 Jan 2010 10:29:37 -0500, Greg Berchin <gberchin@comicast.net.invalid>
wrote:

>I believe that Matlab uses the positive exponent form.
I just checked, and currently Matlab does use the signal processing standard (negative exponent on the forward transform). Seems to me that this is a change from early Matlab versions, but I could be wrong. Greg
On Jan 21, 6:14&#4294967295;am, Greg Berchin <gberc...@comicast.net.invalid>
wrote:
> On Wed, 20 Jan 2010 10:29:37 -0500, Greg Berchin <gberc...@comicast.net.invalid> > wrote: > > >I believe that Matlab uses the positive exponent form. > > I just checked, and currently Matlab does use the signal processing standard > (negative exponent on the forward transform). &#4294967295;Seems to me that this is a change > from early Matlab versions, but I could be wrong. > > Greg
Why do people in modern times leave out the 1/N scaling for direct FFT and put it in the inverse FFT? Makes more sense if you go from time to freq to have the 1/N in eg for dc we get the average and must divide by N. Don't say "it's just scaling" and doesn't matter - it does! Hardy
On Wed, 20 Jan 2010 16:31:25 -0800 (PST), HardySpicer <gyansorova@gmail.com>
wrote:

>Why do people in modern times leave out the 1/N scaling for direct FFT >and put it in the inverse FFT? >Makes more sense if you go from time to freq to have the 1/N in eg for >dc we get the average and must divide by N. >Don't say "it's just scaling" and doesn't matter - it does!
I agree, and this has been a topic of discussion here on comp.dsp many times in the past. I think that the only answer is "tradition". The issue becomes even more important when implementing convolution as transform-domain multiplication. It's easy to accidentally end up with an extra N or 1/N factor. Greg
On Jan 20, 8:04&#4294967295;pm, Greg Berchin <gberc...@comicast.net.invalid>
wrote:
> On Wed, 20 Jan 2010 16:31:25 -0800 (PST), HardySpicer <gyansor...@gmail.com> > wrote: > > >Why do people in modern times leave out the 1/N scaling for direct FFT > >and put it in the inverse FFT? > >Makes more sense if you go from time to freq to have the 1/N in eg for > >dc we get the average and must divide by N. > >Don't say "it's just scaling" and doesn't matter - it does! > > I agree, and this has been a topic of discussion here on comp.dsp many times in > the past. &#4294967295;I think that the only answer is "tradition".
well, there are a couple of traditions. to me, clearly the most natural fundamental definition would be N-1 x[n] = SUM{ X[k] * exp(+j*2*pi*n*k/N) } k=0 the orthonormal basis functions are exp(j*2*pi*n*k/N) and X[k] are the coefficients. X[0], unscaled, is the DC component. then the inverse of that (the forward DFT) is N-1 X[k] = 1/N * SUM{ x[n] * exp(-j*2*pi*n*k/N) } n=0 the X[k] are now means rather than sums.
> The issue becomes even more important when implementing convolution as > transform-domain multiplication. &#4294967295;It's easy to accidentally end up with an extra > N or 1/N factor.
maybe it should be 1/sqrt(N) in both the forward and inverse DFT. i think, for the most prevalent convention, N-1 X[k] = SUM{ x[n] * exp(-j*2*pi*n*k/N) } n=0 N-1 x[n] = 1/N * SUM{ X[k] * exp(+j*2*pi*n*k/N) } k=0 then, defining X[k] = DFT{ x[n] } Y[k] = DFT{ y[n] } H[k] = DFT{ h[n] } it is true that if Y[k] = H[k] * X[k] (multiplication, not convolution) then N-1 y[n] = SUM{ h[i] * x[n-i] } i=0 with no 1/N scaling. if the DFT were defined the "natural" way, there would be a 1/N factor in that convolution summation. r b-j