1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Power cross-spectral density

  1. Oct 26, 2012 #1
    1. The problem statement, all variables and given/known data
    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

    2. Relevant equations
    pcsd_xy = psd_xx.*conj(psd_yy)

    where psd = power spectral density.

    3. The attempt at a solution
    Is this a correct approach to obtain the cross-spectral density?

    Kind regards,
  2. jcsd
  3. Oct 26, 2012 #2


    User Avatar
    Science Advisor
    Gold Member

    No, that's not going to do it. Look at the definition of the cross-power PSD from the Wiener-Khinchin theorem
    [tex]S_{xy}(\omega)=\int_{-\infty}^{\infty}{R_{xy}(\tau)e^{-i\omega \tau} d\tau},[/tex]where R is the cross-correlation function
    [tex]R_{xy}(\tau)=\int_{-\infty}^{\infty}{x(t) y^*(t+\tau)dt}.[/tex]You can see that you can't get the above from what you wrote (note that your PSD S_xx is found by setting x=y).
  4. Oct 27, 2012 #3
    Thanks for the answer. Then I have probably made an error on an earlier state since I obtain compliance between the frequency response function when I use

    S_xx(w)=|H(w)|^2 S_ff(w)



    I have posted a small MATLAB script in which I compute these quantities. I know it is a lot to ask for but can you spot something wrong with my computation of the PSDs?

    % Time increment %

    % Number of samples %

    % Frequency band %

    % --- Fast Fourier transformation --- %

    % Input data %

    % Output data %

    % --- Power spectral densities --- %

    % Power spectral density of input data %

    % Power spectral density of output data %

    % Power cross-spectral densities of input and output data %

    % Frequency response function %

    Your answer would be highly appreciated.

    Thanks in advance and kind regards,
  5. Oct 27, 2012 #4


    User Avatar
    Science Advisor
    Gold Member

    Your input and output PSD's are correct, your cross power calculation is not. You are getting a pleasing result because cross-power would be the wrong thing to use, were you to calculate it correctly. The transfer function is [tex]H(\omega)=\frac{Y(\omega)}{X(\omega)},[/tex] where Y and X are the output and input spectra of your system. Look at your code--you in fact calculate H*, albeit through a very convoluted process.
  6. Oct 28, 2012 #5
    Again, thank you very much for the answer.

    The reason why I want to use the cross-power is that I want informations about the phase angle as well as the magnitude.
    So what you are saying is that I through


    actually get the complex conjugate of H?
  7. Oct 28, 2012 #6


    User Avatar
    Science Advisor
    Gold Member

    Take a look at your own code:
    What does it look like to you?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook