sidFreqETFE¶
Python equivalent:
sid.freq_etfe
Empirical transfer function estimate.
result = sidFreqETFE(y, u)
result = sidFreqETFE(y, [])
result = sidFreqETFE(y, u, 'Smoothing', S)
result = sidFreqETFE(y, u, 'Smoothing', S, 'Frequencies', w, 'SampleTime', Ts)
Estimates the frequency response as the ratio of output and input discrete Fourier transforms. Provides maximum frequency resolution but high variance. Optional smoothing reduces variance.
This is an open-source replacement for the System Identification Toolbox function 'etfe'.
Inputs¶
| Name | Description |
|---|---|
y |
Output data, (N x n_y) matrix. Column vector for SISO. For multiple trajectories: (N x n_y x L) array or cell array {y1, y2, ...} for variable-length data. Cross-periodograms are ensemble-averaged across trajectories. |
u |
Input data, (N x n_u) matrix. Column vector for SISO. For multiple trajectories: (N x n_u x L) or cell array. Use [] for time series (periodogram). |
Name-value options¶
| Name | Description |
|---|---|
'Smoothing' |
Smoothing window length S (positive odd integer). Default: 1 (no smoothing). |
'Frequencies' |
Frequency vector in rad/sample, in (0, pi]. Default: 128 linearly spaced values. |
'SampleTime' |
Sample time in seconds. Default: 1.0. |
Outputs¶
| Name | Description |
|---|---|
result |
Struct with fields: |
.Frequency |
(n_f x 1) frequency vector, rad/sample |
.FrequencyHz |
(n_f x 1) frequency vector, Hz |
.Response |
(n_f x n_y x n_u) complex frequency response |
.ResponseStd |
(n_f x n_y x n_u) standard deviation (NaN) |
.NoiseSpectrum |
(n_f x n_y x n_y) noise spectrum |
.NoiseSpectrumStd |
(n_f x n_y x n_y) standard deviation (NaN) |
.Coherence |
[] (not applicable for ETFE) |
.SampleTime |
sample time in seconds |
.WindowSize |
N (data length) |
.DataLength |
number of samples N |
.NumTrajectories |
number of trajectories L |
.Method |
'sidFreqETFE' |
Examples¶
N = 1000; u = randn(N, 1);
y = filter([1], [1 -0.9], u) + 0.1*randn(N, 1);
result = sidFreqETFE(y, u, 'Smoothing', 5);
sidBodePlot(result);
Algorithm¶
- Compute DFTs Y(w) and U(w) of the data signals.
- Form raw ETFE: \(G(w)\) = Y(w) / U(w) (SISO) or matrix division (MIMO).
- Optionally smooth G with a length-S boxcar window.
- Noise spectrum: \(Phi_v(w)\) = (1/N) * |Y(w) - \(G(w)\) * U(w)|^2.
- Time series mode: periodogram \(Phi_y(w)\) = (1/N) * |Y(w)|^2.
References¶
Ljung, L. "System Identification: Theory for the User", 2nd ed., Prentice Hall, 1999. Sections 2.3, 6.3.
Specification¶
SPEC.md §4 — Empirical Transfer Function Estimate
See also¶
sidFreqBT, sidFreqBTFDR, sidBodePlot, sidSpectrumPlot
Changelog¶
- 2026-03-24: First version by Pedro Lourenço.