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?
John Michell answered .
2025-11-20
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);