Signal Processing Toolbox    
tfe

Estimate the transfer function from input and output

Syntax

Description

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.

The relationship between the input 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 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. numoverlap is the number of samples by which the sections overlap. Any arguments that are 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 nfft 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.

[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 Hann 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,numoverlap) overlaps the sections of x by numoverlap samples.

You can use the empty matrix [] to specify the default value for any input argument except x or y. For example,

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

The '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 as decibels versus frequency in the current figure window.

Examples

Compute and plot the transfer function estimate between two colored noise sequences x and y:

Algorithm

tfe uses a four-step algorithm:

  1. It multiplies the detrended sections by window.
  2. It takes the length nfft FFT of each section.
  3. It averages the squares of the spectra of the x sections to form Pxx and averages the products of the spectra of the x and y sections to form Pxy.
  4. It calculates Txy:

Diagnostics

An appropriate diagnostic message is displayed when incorrect arguments are used:

See Also

etfe, cohere, csd, pwelch, spa


  tf2zpk triang