What is the difference between CSD and CPSD in Signal Processing Toolbox 6.11 (R2009a)?

Technical Source
2 min readMar 12, 2021

--

I was using CSD from the Signal Processing Toolbox to compute power spectral densities but since Release R14 I am receiving a warning that CSD has been replaced by CPSD and CSD still works but may be removed in future.

I was trying to adapt my code to use CPSD however I was not able to produce the same results.

What is the difference between CSD and CPSD and how can produce the same results using CPSD?

ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

CPSD returns the power spectral density, while CSD returns neither power nor power spectral density. Depending on the application, this difference may be critical.

In addition, when calling CSD(x,y), it returns the FFT of autocorrelation E(yx*) while CPSD(x,y) returns the FFT of autocorrelation E(xy*). This explains the phase inverse observed in the result. CPSD’s approach is more natural if one wants to find out the cross power spectral density between x and y.

In summary, to get CSD result with CPSD, please do the following:

1. Use Hanning window instead of Hamming (default).

2. Set ‘noverlap’ to zero.

3. Scale the result with Fs.

4. Pass the input arguments in opposite order.

Here is some additional information regarding step 3 — how to scale the result. In CSD, if the signal is real, the function returns the positive side of the

spectrum, period. However, in CPSD, it does a little more to come up with

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet