Is the unit of Cxy from cpsd in decibel?

Illustration
Sophia - 2021-03-08T10:47:17+00:00
Question: Is the unit of Cxy from cpsd in decibel?

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

Profile picture of John Michell John Michell answered . 2025-11-20

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);


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!