Estimates the transfer function using the Welch method.
TFESTIMATE(x, y, win, overlap, nfft, fs, detrend, zeropad, range, output, estimator)
x |
- |
A series or array, the input series. |
|||||||||
y |
- |
A series or array, the response. |
|||||||||
win |
- |
An integer or series, the segment size or window. If a series, each input segment is multiplied by win with the segment size set to length(win). Defaults to a Hamming window of where the length is 1/8 the length of the input series. |
|||||||||
overlap |
- |
Optional. An integer, the number of points to overlap each segment. Defaults to length(series)/2. |
|||||||||
nfft |
- |
Optional. An integer or series. If nfft is an integer, nfft is the FFT length. If nfft is a series, the series contains the frequencies used to evaluate the transfer function. Defaults to the integer bestpow2(win). |
|||||||||
fs |
- |
Optional. A real, the sample rate. Defaults to rate(series). |
|||||||||
detrend |
- |
Optional. A string, the segment detrend mode:
|
|||||||||
zeropad |
- |
Optional. A string, the short segment zero pad mode:
|
|||||||||
range |
- |
Optional. A string, the frequency range of the transfer function:
|
|||||||||
output |
- |
Optional. A string, the output real/complex form:
|
|||||||||
estimator |
- |
Optional. A string, the estimation method:
|
A complex series or array, the complex transfer function estimate.
W1: {1, -3, 4, 6, 2}
W2: gnorm(10000, 1)
W3: conv(w1, w2)
W4: tfestimate(w2, w3)
W1 contains the impulse response of the system.
W2 contains 10000 samples of normally distributed random noise.
W3 computes the response of the system in W1 to the random noise in W2.
W4 computes the one-sided complex transfer function estimate by dividing W2 and W3 into 8 overlapping segments multiplied by a Hamming window and averaging the FFTs of the segments.
W1: {1, -3, 4, 6, 2}
W2: gnorm(10000, 1)
W3: conv(w1, w2)
W4: tfestimate(w2, w3, "twosided")
W5: real(ifft(w4));extract(w0, 1, length(w1))

Same as above, except the twosided complex transfer function estimate is computed in W4.
W5 computes the impulse response from the transfer function estimate. The estimated values compare with the actual impulse response values in W1.
W1: {1, -3, 4, 6, 2}
W2: gnorm(10000, 1)
W3: conv(w1, w2)
W4: tfestimate(w2, w3, hamming(128), 64, 1024, "twosided")
W5: real(ifft(w4))
Same as above, except the input and response series are divided into segments of 128 samples overlapped by 64 samples. Each segment is multiplied by a Hamming window and the 1024 point FFTs are averaged.
W5 computes the impulse response from the transfer function estimate. The estimated values compare with the actual impulse response values in W1.
W1: {1, -3, 4, 6, 2}
W2: gnorm(10000, 1)
W3: conv(w1, w2)
W4: tfestimate(w2, w3, hamming(128), 64, 1024, "twosided")
W5: real(ifft(w4))
W6: mag(fft(w1, 10000))
W7: mag(w4)
W8: W6;overp(W7);h=legend(0, 0, "Actual","Estimated");h.target=PAPER;h.location=5;h.orientation=1
Same as above, except W6 and W7 display the magnitude of the actual and estimated transfer functions. W8 visually compares the results.
Given a perfect, noise-free system where the Fourier transform of the
input
However, real world systems are almost always affected by noise. Simply dividing the Fourier transforms can lead to significant errors particularly where the signal power is low.
Two widely used estimators that account for noise in the input and output
series are derived from the
The H1
Estimator is considered optimal when the output noise is uncorrelated
with the input signal. It is the most common choice in practice, as it
assumes the noise primarily affects the measurement of the output. It
is calculated as the ratio of the
The H2
Estimator is more suitable when the input noise is uncorrelated with the
output signal. It is calculated as the ratio of the power spectral density
of the output
If nfft is an array of one or
more target frequencies, TFESTIMATE uses the GOERTZEL
algorithm to compute the transfer function at each input frequency. The
input frequencies can be any real values. Frequency values less than zero
or greater than rate(x)
are wrapped to the range between 0 and
If detrend is "constant" or "linear", the mean or linear trend is computed and removed from each segment before FFT processing.
If zeropad is "zeropad", the last column is padded with zeros to make it the same length as the other columns. If zeropad is "none" or empty, the last column is ignored if it is shorter than the others.
If range is "twosided",
the TFESITMATE produces the full transfer function from 0 to
If range is "center",
the full transfer function is displayed from
If both inputs are real, range defaults to "onesided", else if any input is complex, range defaults to "twosided".
By default, the output of TFESTIMATE is complex. Use MAGNITUDE
and PHASE to compute the magnitude
and phase components from the complex transfer function. For example,
the
and phase of the transfer function is computed with:
If output
is "mag2" or "mag", TFESTIMATE returns the
See CPSD
to estimate the complex
See MSCOHERE
to estimate the
See PWELCH to estimate the power spectral density.
[1] |
P. Welch |
|
The use of the fast Fourier transform for the estimation of power spectra: A method based on time averaging over short, modified periodograms. |
|
IEEE Trans. Audio Electroacoust. vol. 15, 1967 |
|
pp 70-73 |
[2] |
Rabiner, Lawrence R., and B. Gold |
|
Theory and Application of Digital Signal Processing |
|
Prentice-Hall, 1975 |
|
pp 414-419 |