Estimates cross power spectral density between two signals. |
||
Syntax |
Y,F = CPSD(vec1, vec2, sample_rate, length) |
|
Arguments |
Name |
Description |
vec1 |
A vector representing one of the time domain signals. |
|
vec2 |
A vector representing the other time domain signal. Both must be of the same length. |
|
sample_rate |
The sample rate in units of Hz. Defaults to 1Hz. |
|
length (optional) |
The length of the output vectors if specified as a positive integer. If omitted or zero, the length will be the input signal length. If the length is specified as ‘pad’, the length will be rounded up (zero padding the inputs) if necessary to obtain a power of 2. |
|
Output |
Name |
Description |
Y |
A vector of the cross PSD at the frequency points. Its length is equal to that of input signals unless the argument length is specified. |
|
F |
A vector of the evenly spaced frequency points where the power densities are obtained. It has the same length as Y. |
|
Example |
Given time-domain signals data1 and data2, a vector is created, which is the cross PSD between data1 and data2, sampled at 1KHz. |
|
|
Syntax |
|
|
y,f = CPSD(data1, data2, 1000) |
|
|
Result |
|
|
y is a vector of the cross PSD. f is a vector of the evenly spaced frequency points where the cross PSD values are evaluated. |
|
Comments |
It is assumed that the signals are evenly sampled at the same rate. |
|
See Also: |