Hi, I need to find energy for several harmonics of a signal, but feel confused about the relationship between the energy and DFT (FFT) values. 1. I wanted to prove that for a periodic signal $s(t)$ with $N$ harmonics we can get its energy through its $2N$ points DFT as long as the highest frequency is in Nyquist Range. Through instinct I think there will be a relation such that $$\frac{1}{T} \int_0^T |s(t)|^2 dt = \sum_{k=-\infty}^{\infty} |c_k|^2 = \sum_{k =0}^{2N-1} |S[k]|^2 $$. where $c_k$ is the Fourier coefficients of $s(t)$ and $S[k]$ is the DFT of sampled signal. But I can't prove that. 2. I also feel confused about the energy of harmonics $k$. When $k=0$, it's DC. When $k = 1...N-1$, they are harmonics and the power needs to time $2$. How about when $k = N$? Isn't it also a harmonic? Shall I times it with $2$? If so, doesn't it agree to $ \sum_{k =0}^{2N-1} |S[k]|^2$ ? Thanks a lot for your help, Brian
obtaining continuous time signal bin energy
Started by ●September 14, 2007
Reply by ●September 14, 20072007-09-14
On Sep 14, 12:21 pm, Brian Zhang <sunny...@myrealbox.com> wrote:> Hi, > > I need to find energy for several harmonics of a signal, but feel > confused about the relationship between the energy and DFT (FFT) > values. > > 1. I wanted to prove that for a periodic signal $s(t)$ with $N$ > harmonics we can get its energy through its $2N$ points DFT as long as > the highest frequency is in Nyquist Range. Through instinct I think > there will be a relation such that > $$\frac{1}{T} \int_0^T |s(t)|^2 dt = \sum_{k=-\infty}^{\infty} |c_k|^2 > = \sum_{k =0}^{2N-1} |S[k]|^2 $$. > where $c_k$ is the Fourier coefficients of $s(t)$ and $S[k]$ is the > DFT of sampled signal. But I can't prove that. > > 2. I also feel confused about the energy of harmonics $k$. When > $k=0$, it's DC. When $k = 1...N-1$, they are harmonics and the power > needs to time $2$. How about when $k = N$? Isn't it also a > harmonic? Shall I times it with $2$? If so, doesn't it agree to $ > \sum_{k =0}^{2N-1} |S[k]|^2$ ? > > Thanks a lot for your help, > BrianBrian, What you want is Bessel's equality - this is a special case of Parseval's relation. In Parseval's relation let both functions be the same and you will quickly see how the time domain and frequency domain energies relate. Clay
Reply by ●September 14, 20072007-09-14
Sorry, a mistake. I forgot to divide $S[k]$ by $2N$. The equation I assume should be $$\frac{1}{T} \int_0^T |s(t)|^2 dt = \sum_{k=-\infty}^{\infty} |c_k|^2 = \sum_{k =0}^{2N-1} \|\frac{S[k]}{2N}\|^2 $$ On Sep 14, 11:21 am, Brian Zhang <sunny...@myrealbox.com> wrote:> Hi, > > I need to find energy for several harmonics of a signal, but feel > confused about the relationship between the energy and DFT (FFT) > values. > > 1. I wanted to prove that for a periodic signal $s(t)$ with $N$ > harmonics we can get its energy through its $2N$ points DFT as long as > the highest frequency is in Nyquist Range. Through instinct I think > there will be a relation such that > $$\frac{1}{T} \int_0^T |s(t)|^2 dt = \sum_{k=-\infty}^{\infty} |c_k|^2 > = \sum_{k =0}^{2N-1} |S[k]|^2 $$. > where $c_k$ is the Fourier coefficients of $s(t)$ and $S[k]$ is the > DFT of sampled signal. But I can't prove that. > > 2. I also feel confused about the energy of harmonics $k$. When > $k=0$, it's DC. When $k = 1...N-1$, they are harmonics and the power > needs to time $2$. How about when $k = N$? Isn't it also a > harmonic? Shall I times it with $2$? If so, doesn't it agree to $ > \sum_{k =0}^{2N-1} |S[k]|^2$ ? > > Thanks a lot for your help, > Brian
Reply by ●September 14, 20072007-09-14
Hi, assume a complex-valued FFT, even if your data is real-valued. And forget about any factors of N for now: One bin is 0 Hz, as you said. The other bins form pairs, corresponding to the amplitude of - an exp(i ... t) term - an exp(-i ... t) term For a real-valued signal in the time domain, they are conjugate. Every pair sums up to a sin(...+phi). For the first pair of bins adjacent to DC, it rotates one cycle over the length of the interval. The second pair of bins rotates two cycles and so on. Now the last bin... Here we've got again - an exp(i ... t) term - an exp(-i ... t) term Those do one full turn every two samples. Since it's on the Nyquist limit (2 samples per period), we can't distinguish between them. Both are just sequences of +/- 1 Other than the other exp-terms, those two are CORRELATED - in other words, one is redundant. BOTH amplitudes add up in ONE bin, which is the "opposite" of the DC bin. So I could write the signal from said bin as 0.5 exp(i ... t) + 0.5 exp(-i ... t) or exp(i ... t) or exp(-i ... t) or anything in between, it's all the same. So much for intuition. I hope this clarifies more than it confuses. Cheers Markus
Reply by ●September 14, 20072007-09-14
On Sep 14, 12:05 pm, "mnentwig" <mnent...@elisanet.fi> wrote:> Hi, > > assume a complex-valued FFT, even if your data is real-valued. > And forget about any factors of N for now: > > One bin is 0 Hz, as you said. > The other bins form pairs, corresponding to the amplitude of > - an exp(i ... t) term > - an exp(-i ... t) term > For a real-valued signal in the time domain, they are conjugate. > Every pair sums up to a sin(...+phi). > For the first pair of bins adjacent to DC, it rotates one cycle over the > length of the interval. The second pair of bins rotates two cycles and so > on. > > Now the last bin... > Here we've got again > - an exp(i ... t) term > - an exp(-i ... t) term > Those do one full turn every two samples. Since it's on the Nyquist limit > (2 samples per period), we can't distinguish between them. Both are just > sequences of +/- 1 > Other than the other exp-terms, those two are CORRELATED - in other words, > one is redundant. BOTH amplitudes add up in ONE bin, which is the > "opposite" of the DC bin. > > So I could write the signal from said bin as > 0.5 exp(i ... t) + 0.5 exp(-i ... t) > or exp(i ... t) > or exp(-i ... t) > or anything in between, it's all the same. > > So much for intuition. I hope this clarifies more than it confuses. > > Cheers > > MarkusThanks Markus. It's like flipping between 0 and PI and can be viewed as coming from either direction on the unit circle. This is clarified. Do you have idea about the first question? Besides, I also feel confused about Nyquist Limit. For a sine wave sampled twice per period, if sampling is started at 1 or -1, we get 1, -1, 1, -1 ..., while if sampling is started at zero crossing, we always get zeros. I really don't get it. Thanks, Brian
Reply by ●September 14, 20072007-09-14
Hello, The Nyquist limit is "one-sided": For either positive or negative frequencies you can or cannot reconstruct the signal. It's up to what you decide beforehand, when you lowpass (bandpass)-filter the signal: - include Nyquist frequency on negative side, exclude on positive side of frequency axis - vice versa It matters for example when I use FFT to delay a signal: http://www.elisanet.fi/mnentwig/webroot/FFT_delay_special_case/index.html and http://www.elisanet.fi/mnentwig/webroot/Nyquist_on_the_edge/index.html The first question: You get the amplitude a of a sine wave per frequency. All sine waves (from different bins) are uncorrelated. => power is a3^2+a6^2+a9^2 if the harmonics of interest are 3, 6, 9. -mn
Reply by ●September 14, 20072007-09-14
Brian Zhang wrote: ...> Besides, I also feel confused about Nyquist Limit. For a sine wave > sampled twice per period, if sampling is started at 1 or -1, we get 1, > -1, 1, -1 ..., while if sampling is started at zero crossing, we > always get zeros. I really don't get it.The Nyquist limit applied to reconstruction is a "not a as great as" one. You seem to be familiar with aliasing above Nyquist. *At* the Nyquist limit, Fs/2 aliases with DC. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply by ●September 14, 20072007-09-14
"mnentwig" <mnentwig@elisanet.fi> writes:> Hello, > > The Nyquist limit is "one-sided": For either positive or negative > frequencies you can or cannot reconstruct the signal. It's up to what you > decide beforehand, when you lowpass (bandpass)-filter the signal: > > - include Nyquist frequency on negative side, exclude on positive side of > frequency axis > - vice versaNot true. Counterexample: x[n] = A*cos(n*pi). This is a "Nyquist frequency" that is reconstructable for both A = 1 and A = -1. Unless I misunderstand you, which is very possible since you use terminology and language that is very unconventional. What is true, however, is that a sinusoid at the Nyquist frequency with arbitrary phase cannot be reconstructed. -- % Randy Yates % "Midnight, on the water... %% Fuquay-Varina, NC % I saw... the ocean's daughter." %%% 919-577-9882 % 'Can't Get It Out Of My Head' %%%% <yates@ieee.org> % *El Dorado*, Electric Light Orchestra http://home.earthlink.net/~yatescr
Reply by ●September 14, 20072007-09-14
Randy Yates <yates@ieee.org> writes:> Not true. Counterexample: x[n] = A*cos(n*pi). This is a "Nyquist frequency" that > is reconstructable for both A = 1 and A = -1. > > Unless I misunderstand you, which is very possible since you use > terminology and language that is very unconventional. > > What is true, however, is that a sinusoid at the Nyquist frequency > with arbitrary phase cannot be reconstructed.Didn't you just contradict yourself? Ciao, Peter K. -- "And he sees the vision splendid of the sunlit plains extended And at night the wondrous glory of the everlasting stars."
Reply by ●September 14, 20072007-09-14
p.kootsookos@remove.ieee.org (Peter K.) writes:> Randy Yates <yates@ieee.org> writes: > >> Not true. Counterexample: x[n] = A*cos(n*pi). This is a "Nyquist frequency" that >> is reconstructable for both A = 1 and A = -1. >> >> Unless I misunderstand you, which is very possible since you use >> terminology and language that is very unconventional. >> >> What is true, however, is that a sinusoid at the Nyquist frequency >> with arbitrary phase cannot be reconstructed. > > Didn't you just contradict yourself?Not at all. The sinusoids I gave were only two out of an infinite number of phases, +pi, and -pi, or equivalently, +/- cos(n*pi). I.e., in my example the phases were specific, not arbitrary. -- % Randy Yates % "She has an IQ of 1001, she has a jumpsuit %% Fuquay-Varina, NC % on, and she's also a telephone." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://home.earthlink.net/~yatescr