0
$\begingroup$

On many websites, including MathWorks, it was suggested to normalize the fft spectrum (MATLAB or numpy) by dividing it by the total number of samples ($N$). For a sinusoidal signal, for example:

$$x(t)=5cos(2\pi f_0t)$$

This produces a two-sided spectrum peak at $f_0$ with a peak amplitude of 2.5. However, that's not the result of the exact fourier transform, which should be:

$$X(f)=2.5(\delta(f-f_c)+\delta(f+f_c))$$

That is, I expect the amplitude to increase as the frequency bin shrinks (with the total area remaining at 2.5). That is not the case if I normalize with respect to $N$. If I normalize instead with respect to the sampling frequency ($F_s$), then it works out for the sinusoidal signal. The total power density is obviously finite ($P=\frac{1}{T}\int_{0}^{T}x(t)^2dt=12.5$); but the numerical power spectrum (unit^2/Hz) will have varying results depending on the bin size.

Questions:

  1. Can I assume that the division by sampling frequency normalization would be more physically relevant for vibration analysis, if I want to extract things like $g^2/Hz$?

  2. If my signal is a finite sum of sines, what's the best way to visualize the power? I would expect the power spectrum to vary again with the total sample time (i.e. not very useful).

  3. If I assume all continuous signals can be represented by fourier series, how come non-sinusoidal signals have finite and well-defined power spectrum?

$\endgroup$
1
$\begingroup$

I would say most of your confusion arises from conflating the continuous case with the discrete case of the FT. The are similar, and related, but not equivalent. "Area" is a continuous concept. "Sum" is discrete.

I normalize my DFTs by 1/N principally because it makes the bin values essentially sample count independent. Other reasons too. For the sum of squares to hold, you should normalize with $1/\sqrt{N}$.

It would be helpful to know if you have a Linear Algebra background in order to better explain some of these things. Also if you are talking about the continuous case or the discrete one.


How much energy is there in the fluctuation of a color pattern in a fabric? Meaningless question, right? The concept of energy is an application issue and is not inherent in the DFT. What is inherent is the ability to sum squares of values. With a $1/\sqrt{N}$ normalization, the discrete fourier transform can be represented as the multiplication of a unitary matrix, thus the sum of squares is preserved.

$$ Z = F S $$

Suppose Z is a complex vector of the DFT bins, F is the tranformation matrix, and S is a complex vector with your signal. Of course, a real valued signal will fit too.

Let ($^*$) stand for Hermitian, aka, the conjugate transpose.

$$ Z^* = S^* F^* $$

$$ Z^* \cdot Z = ( S^* F^* ) \cdot F S $$

$F^*$ also happens to be the inverse DFT so $ F^* \cdot F = I $, the identity matrix.

$$ Z^* \cdot Z = S^* \cdot I \cdot S = S^* \cdot S $$

The left and right parts of these equations are simply the sum of the squares of the magnitudes.

Between the forward and inverse DFTs, a factor of $1/N$ needs to be included. To split it evenly, it becomes $1/\sqrt{N}$ in each direction.

The "energy" term is associated with the sum of squares. The units are dependent on the application. The DFT doesn't care.

$\endgroup$
  • $\begingroup$ If I normalize by N, then each bin becomes power*freq_size, which is no longer a power density. My objective is to resolve the physical quantity, namely, g^2/Hz, of the signals. The absolute magnitude matters for me. I'm not really interested in DFT. Please math on if can explain further. $\endgroup$ – Jimmy Jul 17 at 19:36
  • $\begingroup$ @Jimmy The DFT is what an FFT actually is. The FFT is merely an efficient implementation. If you search on how a FFT works you are likely to get results on the calculation. If you search on DFT you are likely to get results on the meaning and the math. I've added a bit. $\endgroup$ – Cedron Dawg Jul 17 at 20:02
  • $\begingroup$ @Jimmy, again your questioning is hard to understand as your equations are for the continuous case and your verbiage is a mixture. Perhaps my answer here will help you understand the DFT better. "Normalizing by N" is meaningless in the context of the continuous case. dsp.stackexchange.com/questions/59580/… $\endgroup$ – Cedron Dawg Jul 17 at 20:13
  • $\begingroup$ Appreciate the explanation on DFT. However, I'm not really interested in DFT per se; fft is just a tool to get my objective, which is the spectral density. For example, manufacturer will specify some mechanical component only able to tolerate x lb^2/Hz during vibration testing. My other two questions aren't about DFT either, they are more concerned with fourier transform in general. $\endgroup$ – Jimmy Jul 17 at 20:13
  • $\begingroup$ Once again. FFT is DFT, it is not FT. $\endgroup$ – Cedron Dawg Jul 17 at 20:15

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.