1
$\begingroup$

If I have two audio signals, say $A_{1}$ (music) and $A_{2}$ (Speech), I want to calculate the energy of the two signals for their relative comparisons. One method I can use is by adding the square of audio samples over its length as follows:

$$ E = \sum_{n = 0}^{N} A \left[ n \right]^{2} \tag{1} \label{1} $$

My doubt is: how do I find the energy of the same signals using the Fourier coefficients? Does Parseval's theorem hold for such signals? Because Fourier coefficients are continuously changing with time. So, what is an alternative way to compute the energy of the signal using the frequency representation? Can STFT help in it? If yes, then how?

$\endgroup$
3
  • $\begingroup$ Parseval's theorem holds and you can actually do the same operation in frequency (Fourier) domain, just make sure you use the complex conjugate for the calculation, or take the magnitude and square it (pretty much the same thing and efficiency depends on which environment you are working in). STFT would be needed if you work in real time or you want to see how energy changes with time. Do take care with windowing though if you use overlap as it may require some specific calculations to acquire the correct energy (windows do change the amplitude of the signal). $\endgroup$
    – ZaellixA
    Jun 24 at 7:53
  • $\begingroup$ Are you open to accepting another answer? $\endgroup$ Jun 27 at 8:46
  • $\begingroup$ No, after watching the NPTEL lectures, I have no more doubt about this. $\endgroup$ Jun 28 at 10:09

1 Answer 1

1
$\begingroup$

Perceval's theorem holds strictly if you use the appropriate DFT scaling.

If

$$X[k] = \frac{1}{\sqrt{N}} \sum_{n=0}^{N-1} x[n] e^{-j2\pi\frac{kn}{N}} \leftrightarrow x[n] = \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1} X[k] e^{j2\pi\frac{nk}{N}} $$

then

$$ \sum_{n=0}^{N-1} |x[n]|^2 = \sum_{k=0}^{N-1} |X[k]|^2 $$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.