Download Help (Windows Only) 
Owning Class: spectral analysis
Requires: MathScript RT Module
crosssd(x, y)
crosssd(x, y, fftsize, fs, window)
crosssd(x, y, fftsize, fs, window, noverlap)
crosssd(x, y, fftsize, fs, window, noverlap, flag)
Sxy = crosssd(x, y)
Sxy = crosssd(x, y, fftsize, fs, window)
Sxy = crosssd(x, y, fftsize, fs, window, noverlap)
Sxy = crosssd(x, y, fftsize, fs, window, noverlap, flag)
[Sxy, f] = crosssd(x, y)
[Sxy, f] = crosssd(x, y, fftsize, fs, window)
[Sxy, f] = crosssd(x, y, fftsize, fs, window, noverlap)
[Sxy, f] = crosssd(x, y, fftsize, fs, window, noverlap, flag)
Legacy Name: csd
Uses the Welch method to estimate the crossspectrum density. If you do not specify an output, this function plots the magnitude of the cross power spectrum in the current plot window.
Name  Description  

x  Specifies the first input sequence.  
y  Specifies the second input sequence. length(y) must equal length(x).  
fftsize  Specifies the length of the FFT to perform on each segment of data. The default is the minimum of 256 and the length of x.  
fs  Specifies the sampling frequency. The default is 2.  
window  Specifies the window to apply to x and y. The length of window must be less than or equal to fftsize. The default is a Hanning window with a length of fftsize.  
noverlap  Specifies the number of overlapping data elements between adjacent segments of data. noverlap must be less than the length of window. The default is 0.  
flag  Specifies the method to use to preprocess x and y before applying the window. flag is a string that accepts the following values.

Name  Description 

Sxy  Returns the cross power spectrum of the input signals x and y. If x and y are real, the length of Sxy is fftsize / 2 + 1 for an even fftsize and (fftsize + 1) / 2 for an odd fftsize. If x and y are complex, the length of Sxy is fftsize. 
f  Returns the frequencies that correspond to Sxy. 
The following table lists the support characteristics of this function.
Supported in the LabVIEW RunTime Engine  Yes (if you request output) 
Supported on RT targets  Yes (if you request output) 
Suitable for bounded execution times on RT  Not characterized 
fs = 1000;
f = 100;
T = 2;
t = 0:1 / fs:T  1/fs;
x = sin(2*pi*f*t) + 10*t;
y = sin(2*pi*0.5*f*t) + 20*t;
fftsize = 256;
[pxy fxy] = crosssd(x, y, fftsize, fs, win_hann2(fftsize), fftsize / 2, 'linear');
Helpful
Not Helpful