Power cross-spectral density
28 次查看(过去 30 天)
显示 更早的评论
Hi all,
I am curently working with frequency response functions on the basis of 1 input data sample and 1 output data sample. As I would like to plot the coherence function, I need to compute the cross-spectral densities. Since I am new to this field, I would like to ask some of you experts whether it is correct to compute a power cross-spectral density (pcsd) as
pcsd_xy = psd_xx.*conj(psd_yy)
where psd = power spectral density. Is this correct? I know that MATLAB has commands which can solve this for me, but I would really like to programme it myself.
Thanks in advance.
Kind regards, Martin Ulriksen.
0 个评论
采纳的回答
Wayne King
2012-10-27
That is not correct. The cross spectrum (the Fourier transform of the cross correlation) is not real-valued. The cross spectrum is (ignoring the scaling factors) the DFT of X times the complex conjugate of the DFT of Y.
The way you have it written there is no need to do conj(psd_yy) because the PSD of y is real-valued.
The cross-correlation of X and Y is not an even function of the lag, k, unlike the autocorrelation of X OR the autocorrelation of Y. That is why the Fourier transform of the cross-correlation (the cross spectrum) is complex-valued.
4 个评论
Fotios Kostarelos
2020-7-11
Hi
I'm currently trying to implement coherence in hardware for my project. To do that, I need to compute cross power spectrum and (auto)power spectrum density respectively. The first thing I did is to familiarize myself with the matlab calls mscohere, cpsd, and pwelch, and then I tried to write code in order to get the same results with these functions. My confusion started with cross power spectrum, and especially when I first searched about it and came up with the concept of cross correlation in order to obtain the cross spectrum(and auto correlation for auto power spectrum). In theory ℱ{crosscorrelation(x,y)} results in the cross power spectrum density, however in prectise I've managed to get the same results as the cpsd function using this equation ℱ{x}*conj(ℱ{y}) and not the above(ℱ{crosscorrelation(x,y)}), as you discuss on this post. So, first question is, is this the case ℱ{crosscorrelation(x,y)}=ℱ{x}*conj(ℱ{y})? The only thing I can verify with code is ℱ{convolution(x,y)}= ℱ{x} * ℱ{y}. Also, In the matlab documentation I haven't found any requirement for correlated signals in order to use mscohere cpsd or pwelch function. So, is it necessary to use correlation in order to obtain cross or (auto)power spectrum? What's the difference when I use correlation and when I dont?
Thank you
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!