[Master Index]
[Index for /tools/hpmatlab/toolbox/signal]
cohere
(/tools/hpmatlab/toolbox/signal/cohere.m)
Function Synopsis
[Cxy, f] = cohere(P1, P2, P3, P4, P5, P6, P7)
Help text
COHERE Coherence function estimate
Cxy = COHERE(X,Y,NFFT,Fs,WINDOW) estimates the coherence of X and Y
using Welch's averaged periodogram method. Coherence is a function
of frequency with values between 0 and 1 that indicate how well the
input X corresponds to the output Y at each frequency. X and Y are
divided into overlapping sections, each of which is detrended, then
windowed by the WINDOW parameter, then zero-padded to length NFFT.
The magnitude squared of the length NFFT DFTs of the sections of X and
the sections of Y are averaged to form Pxx and Pyy, the Power Spectral
Densities of X and Y respectively. The products of the length NFFT DFTs
of the sections of X and Y are averaged to form Pxy, the Cross Spectral
Density of X and Y. The coherence Cxy is given by
Cxy = (abs(Pxy).^2)./(Pxx.*Pyy)
Cxy has length NFFT/2+1 for NFFT even, (NFFT+1)/2 for NFFT odd, or NFFT
if X or Y is complex. If you specify a scalar for WINDOW, a Hanning
window of that length is used. Fs is the sampling frequency which does
not effect the cross spectrum estimate but is used for scaling of plots.
[Cxy,F] = COHERE(X,Y,NFFT,Fs,WINDOW,NOVERLAP) returns a vector of freq-
uencies the same size as Cxy at which the coherence is computed, and
overlaps the sections of X and Y by NOVERLAP samples.
COHERE(X,Y,...,DFLAG), where DFLAG can be 'linear', 'mean' or 'none',
specifies a detrending mode for the prewindowed sections of X and Y.
DFLAG can take the place of any parameter in the parameter list
(besides X and Y) as long as it is last, e.g. COHERE(X,Y,'none');
COHERE with no output arguments plots the coherence in the current
figure window.
The default values for the parameters are NFFT = 256 (or LENGTH(X),
whichever is smaller), NOVERLAP = 0, WINDOW = HANNING(NFFT), Fs = 2,
P = .95, and DFLAG = 'linear'. You can obtain a default parameter by
leaving it off or inserting an empty matrix [], e.g.
COHERE(X,Y,[],10000).
See also PSD, CSD, TFE
ETFE, SPA, and ARX in the Identification Toolbox.
Cross-Reference Information
This function calls
- abs /tools/hpmatlab/toolbox/matlab/elfun/abs.m
- any /tools/hpmatlab/toolbox/matlab/ops/any.m
- conj /tools/hpmatlab/toolbox/matlab/elfun/conj.m
- detrend /tools/hpmatlab/toolbox/signal/detrend.m
- else /tools/hpmatlab/toolbox/matlab/lang/else.m
- elseif /tools/hpmatlab/toolbox/matlab/lang/elseif.m
- end /tools/hpmatlab/toolbox/matlab/lang/end.m
- error /tools/hpmatlab/toolbox/matlab/lang/error.m
- eval /tools/hpmatlab/toolbox/matlab/lang/eval.m
- fft /tools/hpmatlab/toolbox/matlab/datafun/fft.m
- fix /tools/hpmatlab/toolbox/matlab/elfun/fix.m
- for /tools/hpmatlab/toolbox/matlab/lang/for.m
- grid /tools/hpmatlab/toolbox/matlab/plotxy/grid.m
- i /tools/hpmatlab/toolbox/matlab/elmat/i.m
- if /tools/hpmatlab/toolbox/matlab/lang/if.m
- imag /tools/hpmatlab/toolbox/matlab/elfun/imag.m
- length /tools/hpmatlab/toolbox/matlab/general/length.m
- mean /tools/hpmatlab/toolbox/matlab/datafun/mean.m
- nargchk /tools/hpmatlab/toolbox/matlab/lang/nargchk.m
- nargin /tools/hpmatlab/toolbox/matlab/elmat/nargin.m
- nargout /tools/hpmatlab/toolbox/matlab/elmat/nargout.m
- newplot /tools/hpmatlab/toolbox/matlab/graphics/newplot.m
- optargs /tools/hpmatlab/toolbox/signal/optargs.m
- plot /tools/hpmatlab/toolbox/matlab/plotxy/plot.m
- psdchk /tools/hpmatlab/toolbox/signal/psdchk.m
- rem /tools/hpmatlab/toolbox/matlab/elfun/rem.m
- xlabel /tools/hpmatlab/toolbox/matlab/plotxy/xlabel.m
- ylabel /tools/hpmatlab/toolbox/matlab/plotxy/ylabel.m
- zeros /tools/hpmatlab/toolbox/matlab/elmat/zeros.m
Produced by mat2html on Wed Feb 8 12:25:18 EST 1995
Cross-Directory links are: ON