Question
I want to use the Signal Processing Toolbox to compute the Cross spectrum gain and phase for my sequences X and Y. I wondered the Cxy that cpsd gives me is in the units of dB? I saw the example and it says the unit is dB/rad/freq, how can I convert it to dB?
Expert Answer
John Michell
PhD Expert
Answered Aug 11, 2026
Hi, no, the output is the cross spectrum, it is complex-valued. If you want the output in db. Use
10*log10(abs(Pxy));
For example:
Fs = 1000; t = 0:1/Fs:.296; x = cos(2*pi*t*200)+randn(size(t)); y = cos(2*pi*t*100)+randn(size(t)); [Pxy,F] = cpsd(x,y,[],[],[],Fs); plot(F,10*log10(abs(Pxy))); grid on; % compare to figure; cpsd(x,y,[],[],[],Fs);
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related matlab Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →