Signal Processing Toolbox | Help Desk |
tfe
Transfer function estimate from input and output.
Txy = tfe(x,y)
Txy = tfe(x,y,nfft)
[Txy,f] = tfe(x,y,nfft,Fs)
Txy = tfe(x,y,nfft,Fs,window)
Txy = tfe(x,y,nfft,Fs,window,noverlap)
Txy = tfe(x,y,...,'dflag
')
tfe(x,y)
Txy = tfe(x,y)
finds a transfer function estimate Txy
given input signal vector x
and output signal vector y
. The transfer function is the quotient of the cross spectrum of x
and y
and the power spectrum of x
:x
and output y
is modeled by the linear, time-invariant transfer function Txy
.
Vectors x
and y
must be the same length. Txy = tfe(x,y)
uses the following default values:
nfft = min(256,(length(x))
Fs = 2
window = hanning(nfft)
noverlap = 0
nfft
specifies the FFT length that tfe
uses. This value determines the frequencies at which the power spectrum is estimated. Fs
is a scalar that specifies the sampling frequency. window
specifies a windowing function and the number of samples tfe
uses in its sectioning of the x
and y
vectors. noverlap
is the number of samples by which the sections overlap. Any arguments that omitted from the end of the parameter list use the default values shown above.
If x
is real, tfe
estimates the transfer function at positive frequencies only; in this case, the output Txy
is a column vector of length nfft/2+1
for nfft
even and (nfft+1)/2
for n
odd. If x
or y
is complex, tfe
estimates the transfer function for both positive and negative frequencies and Txy
has length nfft
.
Txy = tfe(x,y,nfft)
uses the specified FFT length nfft
in estimating the transfer function. Specify nfft
as a power of 2 for fastest execution.
[Txy,f] = tfe(x,y,nfft,Fs)
returns a vector f
of frequencies at which tfe
estimates the transfer function. Fs
is the sampling frequency. f
is the same size as Txy
, so plot(f,Txy
) plots the transfer function estimate versus properly scaled frequency. Fs
has no effect on the output Txy
; it is a frequency scaling multiplier.
Txy = tfe(x,y,nfft,Fs,window)
specifies a windowing function and the number of samples per section of the x
vector. If you supply a scalar for window
, Txy
uses a Hanning window of that length. The length of the window must be less than or equal to nfft
; tfe
zero pads the sections if the length of the window exceeds nfft
.
Txy = tfe(x,y,nfft,Fs,window,noverlap)
overlaps the sections of x
by noverlap
samples.
You can use the empty matrix []
to specify the default value for any input argument except x
or y
. For example,
Txy = tfe(x,y,[],[],kaiser(128,5))uses 256 as the value for
nfft
and 2 as the value for Fs
.
Txy = tfe(x,y,...,'dflag
')
specifies a detrend option, where dflag
is
linear
, to remove the best straight-line fit from the prewindowed sections of x
and y
mean
, to remove the mean from the prewindowed sections of x
and y
none
, for no detrending (default)
dflag
parameter must appear last in the list of input arguments. tfe
recognizes a dflag
string no matter how many intermediate arguments are omitted.
tfe
with no output arguments plots the magnitude of the transfer function estimate in decibels versus frequency in the current figure window.
Compute and plot the transfer function estimate between two colored noise sequences x
and y
:
h = fir1(30,0.2,boxcar(31)); x = randn(16384,1); y = filter(h,1,x); tfe(x,y,1024,[],[],512)
![]()
tfe
uses a four-step algorithm:
window
.
nfft
FFT of each section.
x
sections to form Pxx
and averages the products of the spectra of the x
and y
sections to form Pxy
.
Txy
:
Txy = Pxy./PxxAn appropriate diagnostic message is displayed when incorrect arguments are used:
Requires window's length to be no greater than the FFT length. Requires NOVERLAP to be strictly less than the window length. Requires positive integer values for NFFT and NOVERLAP. Requires vector (either row or column) input. Requires inputs X and Y to have the same length.
Compute empirical transfer function estimate and periodogram (see System Identification Toolbox User's Guide). |
|
Estimate magnitude squared coherence function between two signals. |
|
Perform spectral analysis for input-output data (see System Identification Toolbox User's Guide). |