Wave Walker DSP

Trending

DSP for Beginners: Simple Explanations for Complex Numbers! The second edition includes a new chapter on complex sinusoids.

What is Power Spectral Density (PSD)?
February 1, 2024

Introduction

This blog describes the power spectral density (PSD) mathematically, algorithms for estimating the PSD, and real world challenges in PSD estimation. The analysis in this blog ignores the use of a windowing function for mathematical simplicity, but a windowing function should almost always be used in spectral analysis.

Check out these blogs:

Power Spectral Density (PSD) Mathematically

The instantaneous power of a signal x[n] is defined as

(1)

where

(2)

(3)

(4)

where N is the length of x[n] and the size of the DFT. The average power in the frequency domain, or power spectral density (PSD), is represented similarly to (1) [Lyons2011, p.63, p.140],

(5)

The PSD represents the average power at each frequency bin k. Often the PSD is represented in dB,

(6)

When x[n] is known the PSD can be derived mathematically by finding X[k] followed by , however it is a challenge when receiving unknown signals in a real world environment when a solution cannot be found analytically. In this case the PSD has to be estimated from the received signal.

Algorithms for PSD Estimation

A common problem in spectral analysis is being able to estimate the power spectral density using a received signal. The two foundational tools for spectral estimation are:

Both the Bartlett and Daniell methods produce estimates of the PSD which may be referred to as periodograms [Oppenheim1999, p. 730]. Welch’s method is commonly used in spectral estimation but is a variation on the Bartlett method.

The objective is to produce the best PSD estimate with a finite data set. The following examples consider an input data length of 24 samples.

Bartlett's Method

Bartlett’s method computes several discrete Fourier transforms (DFT) over time with a smaller DFT size than the total data length and averages the results. For an example input sequence of 24 samples, consider the case in which an 8-point DFT is computed over each time segment and 3 DFTs are averaged together. The first DFT would be computed over time segment such that

(7)

followed by the DFT over non-overlapping time series

(8)

(9)

The power for each DFT would be computed according to (5),

(10)

(11)

(12)

and averaged such that Bartlett’s PSD estimate is

(13)

Equation (13) can be generalized for M DFTs according to [Gardner1988, p.193],

(14)

or equivalently,

(15)

Note that many textbook and online references average the magnitude squared as in (15). Averaging the power in dB is given by

(16)

Experimentally it would seem that averaging in dB (16) produces a smoother spectral response due to the compression in dB as the averages are not distorted by outliers as they would be in the linear domain. If you would be interested in this explanation please comment below and I will write a blog post about it.

Welch's Method

Welch’s method is a specific implementation of Bartlett’s method which uses 50% overlapping time series. Continuing with the example in (7) the DFTs are:

(17)

(18)

(19)

(20)

(21)

Due to the overlapping time-windows in (17) – (21) there are more DFTs to average which will require more computation but will also produce a smoother spectral response. Welch’s method is completed by averaging the power of the DFTs according to (16).

Welch’s method refers to exactly 50% overlap between successive time segments, however the amount of overlap can be varied based on the trade-offs between computation and desire for smoothness in the PSD estimate.

Daniell's Method

Where Bartlett’s method computes a smaller DFT and averages them over time, Daniell’s method takes a larger DFT and averages the frequency bins. For the same data length of N=24 samples, consider a 24-point DFT,

(22)

whose power is

(23)

Daniell’s method averages the frequency bins in (23) using a convolution according to [Gardner1988, p.195]

(24)

where g[k] is a smoothing filter. The averaging can also be computed in dB according to

(25)

An example of g[k] is a moving average filter with length L,

(26)

PSD estimates (24) and (25) are computed through the convolution of an N-point DFT and smoothing filter g[k] with length L, producing an output of length N+L-1. The additional L-1 samples are invalid because they are outside the valid bounds of the PSD estimate only exist as a byproduct of the convolution. One method to handle the additional samples is to:

• discard L-1 samples from the left side of the convolution (to remove all transients from the filtering)
• extend the left most sample (L-1)/2 times
• discard L-1 samples from the right side of the convolution
• extend the right most sample (L-1)/2 times

If you have a better way to handle the transition areas with Daniell’s method please drop a comment below!

Conclusion

The Bartlett and Daniell methods are the two algorithms for estimating the power spectral density (PSD) of a given set of samples. Bartlett’s method computes a larger number of DFTs and averages them over time, whereas Daniell’s method computes a larger DFT but applies a smoothing filter over the frequency bins. Welch’s algorithm is a specific implementation of Bartlett’s method which includes the averaging of DFTs coming from 50% overlapping time segments. The analysis in this blog ignores the use of a windowing function for mathematical simplicity, but a windowing function should almost always be used in spectral analysis.

Check out these blogs:

God, the Lord, is my strength; He makes my feet like the deer's; He makes me tread on my high places. Habakkuk 3:19
For everything there is a season, and a time for every matter under heaven. A time to cast away stones, and a time to gather stones together. A time to embrace, and a time to refrain from embracing. Ecclesiastes 3:1,5
The earth was without form and void, and darkness was over the face of the deep. And the Spirit of God was hovering over the face of the waters. Genesis 1:2
Behold, I am toward God as you are; I too was pinched off from a piece of clay. Job 33:6
Enter His gates with thanksgiving, and His courts with praise! Give thanks to Him; bless His name! Psalm 100:4
Lift up your hands to the holy place and bless the Lord! Psalm 134:2
Blessed is the man who trusts in the Lord, whose trust is the Lord. He is like a tree planted by water, that sends out its roots by the stream, and does not fear when heat comes, for its leaves remain green, and is not anxious in the year of drought, for it does not cease to bear fruit. Jeremiah 17:7-8
He said to him, “You shall love the Lord your God with all your heart and with all your soul and with all your mind. This is the great and first commandment. And a second is like it: You shall love your neighbor as yourself. On these two commandments depend all the Law and the Prophets.” Matthew 22:37-39
Then He said to me, “Prophesy over these bones, and say to them, O dry bones, hear the word of the Lord. Thus says the Lord God to these bones: Behold, I will cause breath to enter you, and you shall live." Ezekiel 37:4-5
Riches do not profit in the day of wrath, but righteousness delivers from death. Proverbs 11:4
The angel of the Lord appeared to him in a flame of fire out of the midst of a bush. He looked, and behold, the bush was burning, yet it was not consumed. And Moses said, “I will turn aside to see this great sight, why the bush is not burned.” When the Lord saw that he turned aside to see, God called to him out of the bush, “Moses, Moses!” And he said, “Here I am.” Exodus 3:2-3
Daniel answered and said: “Blessed be the name of God forever and ever, to whom belong wisdom and might. He changes times and seasons; He removes kings and sets up kings; He gives wisdom to the wise and knowledge to those who have understanding." Daniel 2:20-21

This website participates in the Amazon Associates program. As an Amazon Associate I earn from qualifying purchases.