tfestimate

Estimates the transfer function from time domain signals.

Syntax

tfe=tfestimate(x,y)

tfe=tfestimate(x,y,window)

tfe=tfestimate(x,y,window,overlap)

tfe=tfestimate(x,y,window,overlap,nfft)

tfe=tfestimate(x,y,window,overlap,nfft,fs)

tfe=tfestimate(x,y,window,overlap,nfft,fs,range)

[tfe,freq]=tfestimate(...)

Inputs

x
The signal.
Type: double
Dimension: vector
window
The window size, or the window vector.
Type: double | integer
Dimension: scalar | vector
overlap
The number of overlapping points in adjacent windows.
Type: integer
Dimension: scalar
nfft
The size of the fft.
Type: integer
Dimension: scalar
fs
The sampling frequency.
Type: double
Dimension: scalar
range
The spectrum type: 'onesided' or 'twosided'.
Type: string

Outputs

tfe
The transfer function estimate.
Type: vector
freq
The vector of frequencies corresponding to the transfer function estimate values.
Type: vector

Example

Use filtered noise to estimate the magnitude response of a 4th order Butterworth filter.

fc = 100;
fs = 1000;
[b, a] = butter(4, fc/(fs/2));
rand('seed', 2019)
signal1 = randn(1, 4096);
signal2 = filter(b, a, signal1);
tfestimate(signal1, signal2, 1024, 512, [], fs);

With no return arguments, the function will automatically plot the magnitude response.

It is often recommended to remove the signal means prior to calling tfestimate. The function does not remove the mean automatically.

The optional arguments can be defaulted using []. The defaults are as follows:
window
A Hamming window with the largest length that produces eight data segments.
overlap
One half of the window length.
nfft
The window length. A larger value will pad zeros to each block of windowed data.
fs
1.0 Hz.
range
'onesided'.