DSPRelated.com
Forums

About DFT

Started by Gert Baars September 26, 2005
With a little home-brew DFT program I am trying to some experiments.
When I draw one period of a sine with amplitude 1 no DC componenent and 
analyse it with M #samples I get only 1 freq. component at Fs/M (n=1).
I think this is correct. However the amplitude of the DTF component is
on half of the sine's amplitude. When I add a virtual DC component
to the sine of 1 the DFT component for n =0 (DC) =1 but for the sine 
still 1/2. I square sum and root the IM and RE components.

Why is the value of the for n=1 only 1/2 of the sine's amplitude?
Gert Baars wrote:
> With a little home-brew DFT program I am trying to some experiments. > When I draw one period of a sine with amplitude 1 no DC componenent and > analyse it with M #samples I get only 1 freq. component at Fs/M (n=1). > I think this is correct. However the amplitude of the DTF component is > on half of the sine's amplitude. When I add a virtual DC component > to the sine of 1 the DFT component for n =0 (DC) =1 but for the sine > still 1/2. I square sum and root the IM and RE components. > > Why is the value of the for n=1 only 1/2 of the sine's amplitude?
You should get both positive and negative frequencies if you use the exponential form to represent your sinusoidal components, each at half amplitude. So the question is not why is the amplitude 1/2, but rather where is your missing line? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Jerry Avins wrote:
> Gert Baars wrote: > >> With a little home-brew DFT program I am trying to some experiments. >> When I draw one period of a sine with amplitude 1 no DC componenent >> and analyse it with M #samples I get only 1 freq. component at Fs/M >> (n=1). >> I think this is correct. However the amplitude of the DTF component is >> on half of the sine's amplitude. When I add a virtual DC component >> to the sine of 1 the DFT component for n =0 (DC) =1 but for the sine >> still 1/2. I square sum and root the IM and RE components. >> >> Why is the value of the for n=1 only 1/2 of the sine's amplitude? > > > You should get both positive and negative frequencies if you use the > exponential form to represent your sinusoidal components, each at half > amplitude. So the question is not why is the amplitude 1/2, but rather > where is your missing line? > > Jerry
Thank you for the explaination. I guess it has to do with causiality.
Gert Baars wrote:

> ... I guess it has to do with causiality.
I don't see that. Would you care to explain? -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Gert Baars wrote:
> With a little home-brew DFT program I am trying to some experiments. > When I draw one period of a sine with amplitude 1 no DC componenent and > analyse it with M #samples I get only 1 freq. component at Fs/M (n=1). > I think this is correct. However the amplitude of the DTF component is > on half of the sine's amplitude. When I add a virtual DC component > to the sine of 1 the DFT component for n =0 (DC) =1 but for the sine > still 1/2. I square sum and root the IM and RE components. > > Why is the value of the for n=1 only 1/2 of the sine's amplitude?
Gert, Your program is working well, but there should be one other component present, which you have not mentioned. If you have calculated the DFT for M frequency samples ( and not merely M/2 samples), you will have found a component at n=(M-1). This represents the amplitude of the (Fs/M) negative-frequency part of the signal, and has an amplitude of -1/2. The real signal you describe is made up of these two components, which of course sum to 1.0. Regards, John
"Gert Baars" <g.baars13@chello.nl> wrote in message 
news:9c843$4338818c$3ea3a972$26379@news.chello.nl...
> With a little home-brew DFT program I am trying to some experiments. > When I draw one period of a sine with amplitude 1 no DC componenent and > analyse it with M #samples I get only 1 freq. component at Fs/M (n=1). > I think this is correct. However the amplitude of the DTF component is > on half of the sine's amplitude. When I add a virtual DC component > to the sine of 1 the DFT component for n =0 (DC) =1 but for the sine still > 1/2. I square sum and root the IM and RE components. > > Why is the value of the for n=1 only 1/2 of the sine's amplitude?
There will be samples at Fs/M *and* at Fs-Fs/M for a sinusoid. If the sinusoid is a cosine, then they will both be of the same sign and real. Each of them represents a complex exponential with the magnitude of the sample. One rotates in one direction, the other opposite. When the exponential vectors sum 100%, the result is 2X the magnitude of either one. Fred
Fred Marshall wrote:
> "Gert Baars" <g.baars13@chello.nl> wrote in message > news:9c843$4338818c$3ea3a972$26379@news.chello.nl... > >>With a little home-brew DFT program I am trying to some experiments. >>When I draw one period of a sine with amplitude 1 no DC componenent and >>analyse it with M #samples I get only 1 freq. component at Fs/M (n=1). >>I think this is correct. However the amplitude of the DTF component is >>on half of the sine's amplitude. When I add a virtual DC component >>to the sine of 1 the DFT component for n =0 (DC) =1 but for the sine still >>1/2. I square sum and root the IM and RE components. >> >>Why is the value of the for n=1 only 1/2 of the sine's amplitude? > > > There will be samples at Fs/M *and* at Fs-Fs/M for a sinusoid. > If the sinusoid is a cosine, then they will both be of the same sign and > real. > Each of them represents a complex exponential with the magnitude of the > sample. > One rotates in one direction, the other opposite. > When the exponential vectors sum 100%, the result is 2X the magnitude of > either one. > > Fred > >
I am aware of the aliases that occur at Fs-F. Therefore the area beyond the Nyquist frequency is not interesting. I have no purpose for the DC component and think I will just double the magnitudes for the freq. components for n = 1 to M/2-1.
"Gert Baars" <g.baars13@chello.nl> wrote in message 
news:4223$43395034$3ea3a972$26448@news.chello.nl...
> Fred Marshall wrote: >> "Gert Baars" <g.baars13@chello.nl> wrote in message >> news:9c843$4338818c$3ea3a972$26379@news.chello.nl... >> >>>With a little home-brew DFT program I am trying to some experiments. >>>When I draw one period of a sine with amplitude 1 no DC componenent and >>>analyse it with M #samples I get only 1 freq. component at Fs/M (n=1). >>>I think this is correct. However the amplitude of the DTF component is >>>on half of the sine's amplitude. When I add a virtual DC component >>>to the sine of 1 the DFT component for n =0 (DC) =1 but for the sine >>>still 1/2. I square sum and root the IM and RE components. >>> >>>Why is the value of the for n=1 only 1/2 of the sine's amplitude? >> >> >> There will be samples at Fs/M *and* at Fs-Fs/M for a sinusoid. >> If the sinusoid is a cosine, then they will both be of the same sign and >> real. >> Each of them represents a complex exponential with the magnitude of the >> sample. >> One rotates in one direction, the other opposite. >> When the exponential vectors sum 100%, the result is 2X the magnitude of >> either one. >> >> Fred >> >> > > I am aware of the aliases that occur at Fs-F. Therefore the area > beyond the Nyquist frequency is not interesting. > I have no purpose for the DC component and think I will just double > the magnitudes for the freq. components for n = 1 to M/2-1.
Gert, "is not interesting" may be to the human observer of plots if you already know what you're looking at. However, it is essential to the math. The component at Fs-F isn't an alias, it's a component of the sinusoid as I tried to explain in my last post. I hope this helps. Fred
Gert Baars wrote:

   ...

> I am aware of the aliases that occur at Fs-F. Therefore the area > beyond the Nyquist frequency is not interesting. ...
It is not an alias and it is not beyond the Nyquist frequency. It is a negative frequency, on the other side of DC. FFT results are often tabulated with the Nyquist frequency in the middle of the array. They can also be tabulated with DC in the center. Most packages have functions to adjust the order. This is especially useful for 2D FFTs. Most of us interpret them more easily if zero frequency in in the center rather than distributed among the four corners. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:
> Gert Baars wrote: > > I am aware of the aliases that occur at Fs-F. Therefore the area > > beyond the Nyquist frequency is not interesting. ... > > It is not an alias and it is not beyond the Nyquist frequency. It is > a negative frequency, on the other side of DC.
Then why are the DFT/FFT equations usually not written that way? (given that the eqn. coeff's or twiddle factors come out identical.) IMHO. YMMV. -- rhn A.T nicholson d.O.t C-o-M