cross power spectral density explanation in matlab

let us consider following code

>> fs=100;
>> t=0:1/fs:2.93;
>> x=25*sin(2*pi*30*t)+20*cos(2*pi*25*t)+10*rand(size(t));
>> y=23*sin(2*pi*30*t)+21*cos(2*pi*25*t)+11*rand(size(t));


i would like to ask question related to Cross Power Spectral Density function , which in matlab can be easily estimated using function

>> cpsd(x,y,[],[],1024,fs)


can this method used tool for identify if two time series have identical spectral structure? i mean suppose we have two time series which is supposed to have same spectral structure(periodic components with same frequencies as it is given in our case) can this function help us to proof that give two series have same structure? thanks in advance

• downvoting without explaining reason cool – dato datuashvili Oct 1 '14 at 13:15

I think that the picture is more or less what should be expected. There are strong components at 25 Hz and 30 Hz, which are the frequencies of the tones in $x$ and $y$. There is also a strong DC (0 Hz) component because the noise has a strong mean, because it ranges from 0 to 1, not -1 to 1. Without the noise the cpsd looks like this-