This actually produces 8 outputs
P = spectrum(signal1,signal2,NFFT);
In other words, P is a Nx8 matrix. The first column is the power spectral density of signal1 using a Welch estimate.
You can get that with pwelch
The second column is a power spectral density of signal2 using a Welch estimate. (again pwelch)
The 3rd column is the cross spectral density of x and y. You can use cpsd()
The 4th column is transfer function estimate -- you can use tfestimate.m
The 5th column is the magnitude-squared coherence. You can use mscohere.m
The last three are confidence intervals for column 1, column 2, and column3.
Best Answer