0
$\begingroup$

I want to estimate the power spectrum of a given signal using Bartlett's method. I understand the general purpose of the method. However, I do not get my head around the algorithmic description of the method given in the Wikipedia article.

The part I am stumbling over, is in the 2nd step:

For each segment, compute the periodogram by computing the discrete Fourier transform (DFT version which does not divide by M), then computing the squared magnitude of the result and dividing this by M.

Why should one square the magnitude before dividing by M? In my mind, it is the other way round: first normalise the magnitude and then square it to get the power.

I see, that the method works, when I implement it on my own. However, I would like to understand better, what I am doing (and why).
The question arises partly because I intend to plot the power estimate (obtained by Bartlett's method) in dB. I am a little unsure whether I should square the result again or not (as this has already been done)? More specifically, when plotting the power estimate in dB - should I use 10*log10(X) or 20*log10(X)?

Thank you in advance!

$\endgroup$

1 Answer 1

1
$\begingroup$

The reason the DFT results are squared first and then divided by $M$, where $M$ is the length of the DFT is because the power spectrum is the Fourier Transform of the auto-correlation function. Doing the steps as defined makes this result identical.

Consider one block prior to the final averaging of $M$ samples for $x[m]$ with $0\le m < M$:

The autocorrelation function is

$$r_{xx}(k) = \frac{1}{M}\sum_{m=-\infty}^{\infty}x[m+k]x^*[m] = \frac{1}{M}x[k]*x^*[-k]$$

Where $x^* $ represents the complex conjugate.

The power spectrum is given as:

$$P(e^{j\omega}) = \mathscr{F}\{r_{xx}(k)\} = \frac{1}{M}X(e^{j\omega})X^*(e^{j\omega}) = \frac{1}{M}|X(e^{j\omega})|^2$$

Note that the DFT of $x[m]$ is $\sum_{m=0}^{M-1}x[n]e^{j2\pi n k/N}$ = $X[k]$ resulting in the relationship between the DFT and power spectrum as:

$$P[k] = \frac{1}{M}|X[k]|^2$$

To plot in dB when the qty is in units of power, use $10\log_{10}()$.

$\endgroup$
2
  • $\begingroup$ Thank you so much! Maybe one last question. When only working with real-valued input and using rfft - Do I still normalise with 1/N or would one use 2/N ? $\endgroup$
    – Helmut
    Feb 20, 2023 at 22:37
  • $\begingroup$ That depends if on if the spectrum is one sided or two sided. Consider Euler’s formula for a sinusoid: cos(wt) = 1/2 e^{jwt} + 1/2 e^{-jwt}. If you want to see a two sided spectrum, then you are looking at the coefficients of e^{jwt}, I’d you want to see a one sided spectrum (allowed for real signals only), then you are looking at coefficients of cos(wt) $\endgroup$ Feb 21, 2023 at 0:48

Your Answer

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

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