When computing the PSD, how to manipulate the DC component? 

PSD integral is the total signal power, does it include the power of DC component?

In other words, if there is one signal with DC value is high than 0, when we want to compute its PSD, do we need remove DC component first, then use function like pwelch() to compute PSD? If I want to evaluate the partition between spectral density of DC component and AC component, what should I do?

How to evaluate Spectral Density of DC component vs. AC component during computing PSD? My final target is : Computing the partition between spectral density of DC component and AC component in one signal.


1 Answer 1


PSD is the spectral power density and also has the DC component, but in practice finite length of window inevitably produce leaking (because of side-lobes), so to prevent masking of small amplitudes near zero frequency we have to remove DC component.

Functions like pwelch don't remove DC component but it's better to remove it manually and after PSD calculations find it manually.

  • $\begingroup$ If I first remove the DC component, then use pwelch function to plot the PSD in the figure, how can I add the DC component in the PSD? How to compute the spectral density of DC component? $\endgroup$
    – Yukai Chen
    May 30, 2017 at 10:00
  • $\begingroup$ If you remove DC from signal then use pwelch function, it still shows some small DC, to obtain DC power you have to add square mean of your signal to the DC value of pwelch. $\endgroup$
    – Mohammad M
    May 30, 2017 at 11:03
  • $\begingroup$ [pxx,f]=pwelch(data,window,noverlap,nfft,fs,range) Do you mean to modify data(1) becomes data(1)^2 then using above function to compute the DC power? Thanks. $\endgroup$
    – Yukai Chen
    May 31, 2017 at 10:02
  • $\begingroup$ no, you have to find the mean of data and subtract it from data (your modified data have zero mean), then compute PSD from modified data, after that add the square of mean to the DC component of PSD (first element of output). $\endgroup$
    – Mohammad M
    Jun 1, 2017 at 10:25
  • $\begingroup$ Thanks a lot. 1) Remove mean(data) 2) [pxx.f]=pwelch(data,...) 3) modify pxx(1) = mean(data)^2; is it correct in this way? $\endgroup$
    – Yukai Chen
    Jun 1, 2017 at 11:37

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.