0
$\begingroup$

I'm implementing Fourier transformation in my analysis and I wanted dig a bit deeper on the reasons why the absolute value of Fourier transformation is usually multiplied by the constant $2/N$ to get the peak amplitude value of a sinewave with certain frequency.

In the book Understanding Digital Signal Processing by Lyons, the author states the following relationship between the peak amplitude $A$ of a sinewave and the output magnitude $M_r$ of the discrete Fourier transformation (DFT) for that particular sinewave is:

$$M_r=AN/2,\;\;\;\;\;\; \tag{1}$$

where the $r$ stands for real input values to DFT and $N$ is the number of input values to DFT. From this relationship, I trivially get the amplitude I want to as $A=2M_r/N$, which I see is many times done in many fft-examples in Matlab found throughout the web.

Now my big question was, why is the relationship in $(1)$ true? I started to read more from the book Fourier Analysis and Its Applications by Folland and I found the following in his book (in section about DFT):

$$\widehat{f}\left(\frac{2\pi m}{\Omega}\right)\approx \frac{\Omega}{N}\widehat{a}_m,\;\;\;m=0,1,...,N-1\;\;\;\;\;\;\tag{2}$$

where $\widehat{f}$ is the amplitude function, $\widehat{a}_m$ is the $m^{th}$ output of DFT, $N$ is again the number of inputs and $\Omega$ is the length of the time interval $[0, \Omega]:$

$$\widehat{f}\left(\frac{2\pi m}{\Omega}\right)=\int_0^\Omega e^{-2\pi i m t/\Omega}\;f(t)\;dt,$$

where $f$ is the wave function. Now when I look at $(1)$ and $(2)$, there seems to be a connection between them:

$${\color{red}{\widehat{a}_m}} \approx{\color{blue}{\frac{N}{\Omega}}}{\color{green}{\widehat{f}\left(\frac{2\pi m}{\Omega}\right)}},\;\;\;\;\;\;{\color{red}{M_r}}={\color{blue}{\frac{N}{2}}}{\color{green}{A}}.$$

These two results are almost satisfying but I wondered why it seems to be the case that $\Omega=2$?

My questions: Where does this $2$ come from? Why in Lyons's book there is $2$ instead of $\Omega$?

I thought could it be somehow related to the symmetry of the DFT output? One time unit to left and right: $[-1,1]$ so the length of the interval would be $\Omega=2$? A bit vague this last part but could I be onto something here?

UPDATE:

The definition for DFT in book Understanding Digital Signal Processing is given as:

$$X(m)=\sum_{n=0}^{N-1} x(n) e^{-2\pi i nm/N},$$

where $x(n)$ is some continuous time-domain signal. In the book Fourier Analysis and Its Applications the corresponding definition is:

$$\widehat{a}_m = \sum_{n=0}^{N-1}a_n e^{-2\pi i mn/N}\;\;\;(0\leq m<N),$$

where $a_n = f\left(\frac{n\Omega}{N}\right)$.

$\endgroup$
  • $\begingroup$ Could you give the DFT definition used in book Understanding Digital Signal Processing ? $\endgroup$ – AlexTP Mar 23 '18 at 13:36
  • $\begingroup$ Hi @AlexTP see the updated post. $\endgroup$ – jjepsuomi Mar 23 '18 at 13:45
1
$\begingroup$

The two comes from the fact that a real valued sinusoid is really the average of two complex one.

$$ \cos( \theta ) = \frac{ e^{i \theta} + e^{-i \theta} }{2} $$

There is the "2" in the denominator. In the DFT, the other half is located at bin $N-k$, if $k$ is the bin number.

That definition of cosine comes straight from Euler's equation:

$$ e^{i \theta} = \cos( \theta ) + i \sin( \theta ) $$

The $N$ comes straight from the definition of the DFT. The relationship beteen the amplitude, N, and the magnitude of the DFT bin is why I like to use the $1/N$ normalized form of the the DFT over the more conventional unnormalized form.

I recommend that you read my first blog article The Exponential Nature of the Complex Unit Circle for an understanding of Euler's equation and my blog article DFT Bin Value Formulas for Pure Real Tones for understanding the bin values of a pure tone and what "leakage" really means. Equation (19) is the answer to your "big question".

The $\Omega$ comes from the continuous FT. The DFT is the Discrete Fourier Transform. Too often, they are conflated leaving confusion like yours. It takes a lot of heavy math to understand the relationship between the two. The premise of my blog articles is that the DFT can be learned and understood straight from the summation definition without any reference to the continuous case.

Hope this helps.

Ced

$\endgroup$
  • $\begingroup$ Hi @Cedron thank you for your answer. I don't mind the math. Could you give further directions to the link between FT and DFT? :) $\endgroup$ – jjepsuomi Mar 23 '18 at 13:31
  • $\begingroup$ @jjepsuomi, They key concept is that the DFT comes from a FT of the source signal convolved with a window of a train of Dirac Delta impulses. This is the approach taken by most textbooks and I am not a fan of this approach so I can't really make any recommendations. If you are looking for a "meaning' of the DFT, I recommend you read my second blog article "DFT Graphical Interpretation: Centroids of Weighted Roots of Unity". This same "wrapping" interpretation can also be applied to the continuous case and give you a differenct conceptual framework to relate the DFT to the FT. $\endgroup$ – Cedron Dawg Mar 23 '18 at 13:51
1
$\begingroup$

2/N does not come from the Fourier Transform itself, but from particular library implementations of a DFT or FFT. Some DFT/FFT and/or IDFT/IFFT implementations or formulations scale by N, some by sqrt(N), some by 1, some by 1/N, some by 1/sqrt(N), some are complex-to-complex, some are strictly-real-to-magnitude. etc.

The FFTs where some users use a 2/N scaling conform to Parseval's theorem, where the energy is conserved. In an FFT where energy is conserved, an aperture-spanning thus longer sinusoid will have more energy, thus result in a larger FFT result bin value. If you want to rescale from the longer, larger sinusoidal energy to the sinusoid's amplitude or height, then you need to remove the energy scaling by dividing by something proportional to the FFT's length, e.g. N.

The factor of 2 comes from the fact that a complex FFT of a strictly real signal is Hermitian symmetric, e.g. every FFT bin has a complex conjugate mirror image in the other half of the result. This allows the sum of the two complex conjugate result values to cancel out their imaginary components, and sum to a strictly real result for strictly real input. Again, if Parseval's theorem applies, and the FFT implementation you are using is energy conserving, then a sinusoid's energy ends up split between two complex FFT result bins. If you look at only one of them, you only see half the energy, thus you need to double the value you find in that one bin to catch the energy in the complex conjugate FFT result bin that you ignored. If you don't ignore the complex conjugate FFT result bin (given strictly real input), then you don't need that factor of 2.

Thus, 2/N (for that type of FFT implementation, other scaling factors might be required for other forms of FFT, depending on the type of result desired).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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