1. Not finding help here? Sign up for a free 30min 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!

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,
    Martin.
     
  2. jcsd
  3. Oct 26, 2012 #2

    marcusl

    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)

    and

    S_xx(w)=H(jw)S_xf(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 %
    dt=t(2)-t(1);

    % Number of samples %
    N=2^nextpow2(length(t));

    % Frequency band %
    f=1/dt/N*(0:(N-2)/2);

    % --- Fast Fourier transformation --- %

    % Input data %
    Ft_in=fft(wdata_in,N);

    % Output data %
    xt_out=fft(wdata_out,N);

    % --- Power spectral densities --- %

    % Power spectral density of input data %
    PSD_in=Ft_in.*conj(Ft_in)/N;

    % Power spectral density of output data %
    PSD_out=xt_out.*conj(xt_out)/N;

    % Power cross-spectral densities of input and output data %
    PCSD_in_out=Ft_in.*conj(xt_out)/N;
    PCSD_out_in=xt_out.*conj(Ft_in)/N;

    % Frequency response function %
    H=PSD_out(1:N/2)./PCSD_out_in(1:N/2);

    Your answer would be highly appreciated.

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

    marcusl

    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

    H=PSD_out(1:N/2)./PCSD_out_in(1:N/2)

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

    marcusl

    User Avatar
    Science Advisor
    Gold Member

    Take a look at your own code:
    What does it look like to you?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Power cross-spectral density
  1. The Spectral Theorem (Replies: 2)

  2. Spectral Decomposition (Replies: 18)

Loading...