dsp.TransferFunctionEstimator System object

Package: dsp

Estimate transfer function

Description

The dsp.TransferFunctionEstimator computes the transfer function of a system, using the Welch algorithm and the Periodogram method.

To implement the transfer function estimation object:

  1. Define and set up your transfer function estimator object. See Construction.

  2. Call step to implement the estimator according to the properties of dsp.TransferFunctionEstimator. The behavior of step is specific to each object in the toolbox.

Construction

H = dsp.TransferFunctionEstimator returns a System object™, H, that computes the transfer function of real or complex signals. This System object uses the periodogram method and Welch's averaged, modified periodogram method.

H = dsp.TransferFunctionEstimator('PropertyName', PropertyValue,...) returns a Transfer Function Estimator System object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).

Properties

SpectralAverages

Number of spectral averages

Specify the number of spectral averages as a positive, integer scalar. The Transfer Function Estimator computes the current estimate by averaging the last N estimates. N is the number of spectral averages defined in the SpectralAverages property. The default value is 8.

FFTLengthSource

Source of the FFT length value

Specify the source of the FFT length value as one of 'Auto' | 'Property'. The default value is 'Auto'. If you set this property to 'Auto', the Transfer function Estimator sets the FFT length to the input frame size. If you set this property to 'Property', then you specify the number of FFT points using the FFTLength property.

FFTLength

FFT Length

Specify the length of the FFT that the Transfer Function Estimator uses to compute spectral estimates as a positive, integer scalar. This property applies when you set the FFTLengthSource property to 'Property'. The default value is 128.

Window

Window function

Specify a window function for the Transfer Function estimator as one of 'Rectangular' | 'Chebyshev' | 'Flat Top' | 'Hamming' | 'Hann' | 'Kaiser'. The default value is 'Hann'.

SidelobeAttenuation

Side lobe attenuation of window

Specify the side lobe attenuation of the window as a real, positive scalar, in decibels (dB). This property applies when you set the Window property to 'Chebyshev' or 'Kaiser'. The default value is 60 dB.

FrequencyRange

Frequency range of the transfer function estimate

Specify the frequency range of the transfer function estimator as one of 'twosided' | 'onesided' | 'centered'.

If you set the FrequencyRange to 'onesided', the transfer function estimator computes the onesided transfer function of real input signals, x and y. If the FFT length, NFFT, is even, the length of the transfer function estimate is NFFT/2+1 and is computed over the interval [0,SampleRate/2]. If NFFT is odd, the length of the transfer function estimate is equal to (NFFT+1)/2 and the interval is [0,SampleRate/2).

If FrequencyRange is set to 'twosided', the transfer function estimator computes the twosided transfer function of complex or real input signals, x and y. The length of the transfer function estimate is equal to NFFT and is computed over [0, SampleRate).

If you set the FrequencyRange to 'centered', the transfer function estimator computes the centered twosided transfer function of complex or real input signals, x and y. The length of the transfer function estimate is equal to NFFT and it is computed over (-SampleRate/2, SampleRate/2] for even lengths, and (-SampleRate/2, SampleRate/2) for odd lengths. The default value is 'Twosided'.

Methods

cloneCreate Transfer Function estimator object with same property values
getFrequencyVectorGet vector of frequencies at which transfer function is estimated
getRBWGet resolution bandwidth of transfer function
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics to change
resetReset internal states of transfer function estimator
stepEstimate transfer function of system

Examples

Estimate transfer function of a system represented by an order-64 FIR filter

Generate a sine wave. Use the Transfer Function Estimator to estimate the system transfer function, and use Array Plot to display it.

hsin = dsp.SineWave('Frequency',100, 'SampleRate', 1000);
hsin.SamplesPerFrame = 1000;
hs = dsp.TransferFunctionEstimator('SampleRate', hsin.SampleRate,...
     'FrequencyRange','centered');
hplot = dsp.ArrayPlot('PlotType','Line','XOffset',-500,'YLimits',...
        [-120 5],'YLabel','Frequency Response (dB)',...
        'XLabel','Frequency (Hz)',...
        'Title','System Transfer Function');

Create an FIR Filter System object of order 64 and (normalized) cutoff frequency of 1/4. Add random noise to the sine wave. Step through the System objects to obtain the data streams, and plot the log of the magnitude of the transfer function.

hfilt = dsp.FIRFilter('Numerator',fir1(64,1/4));
for ii = 1:100
x = step(hsin) + 0.05*randn(1000,1);
y = step(hfilt,x);
Txy = step(hs,x,y);
step(hplot,20*log10(abs(Txy)))
end		

Algorithms

Given two signals x and y as inputs. We first window the two inputs, and scale them by the window power. We then take FFT of the signals, calling them X and Y. This is followed by calculating Pxx which is the square magnitude of the FFT, X, and Pyx which is X multiplied by the conjugate of Y. The transfer function estimate is calculated by dividing Pyx by Pxx.

For further information refer to the Algorithms section in Spectrum Analyzer, which uses the same algorithm.

References

[1] Hayes, Monson H. Statistical Digital Signal Processing and Modeling. Hoboken, NJ: John Wiley & Sons, 1996

[2] Kay, Steven M. Modern Spectral Estimation: Theory and Application. Englewood Cliffs, NJ: Prentice Hall, 1999

[3] Stoica, Petre and Randolph L. Moses. Spectral Analysis of Signals. Englewood Cliffs, NJ: Prentice Hall, 2005

[4] Welch, P. D. ``The use of fast Fourier transforms for the estimation of power spectra: A method based on time averaging over short modified periodograms,'' IEEE Transactions on Audio and Electroacoustics, Vol. 15, pp. 70–73, 1967.

Was this topic helpful?