sidFreqMap¶
Python equivalent:
sid.freq_map
Time-varying frequency response map.
result = sidFreqMap(y, u)
result = sidFreqMap(y, [], 'SegmentLength', 256)
result = sidFreqMap(y, u, 'Algorithm', 'welch')
Estimates a time-varying frequency response G(w,t) by applying spectral analysis to overlapping segments of input-output data. For an LTI system the map is constant along time; for an LTV system it reveals how the transfer function, noise spectrum, and coherence evolve.
Two algorithms are supported: 'bt' (default) - Blackman-Tukey correlogram via sidFreqBT 'welch' - Welch averaged periodogram (tfestimate compatible)
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. Spectral estimates within each segment are ensemble-averaged. |
u |
Input data, (N x n_u) matrix, or [] for time series mode. For multiple trajectories: (N x n_u x L) or cell array. NAME-VALUE OPTIONS (common): |
'SegmentLength' |
Number of samples per segment L. Default: min(floor(N/4), 256). |
'Overlap' |
Overlap P between segments, 0 <= P < L. Default: floor(L/2). |
'Algorithm' |
'bt' (default) or 'welch'. |
'SampleTime' |
Sample time in seconds. Default: 1.0. BT-specific options: |
'WindowSize' |
Hann lag window size M. Default: min(floor(L/10), 30). |
'Frequencies' |
Frequency vector in rad/sample, in (0, pi]. Default: 128-point linear grid. Welch-specific options: |
'SubSegmentLength' |
Sub-segment length within each segment. Default: floor(L/4.5). |
'SubOverlap' |
Sub-segment overlap. Default: floor(SubSegmentLength/2). |
'Window' |
'hann' (default), 'hamming', 'rect', or numeric vector. |
'NFFT' |
FFT length. Default: max(256, 2^nextpow2(SubSegmentLength)). |
Outputs¶
| Name | Description |
|---|---|
result |
Struct with fields: |
.Time |
(K x 1) center time of each segment (seconds) |
.Frequency |
(n_f x 1) frequency vector, rad/sample |
.FrequencyHz |
(n_f x 1) frequency vector, Hz |
.Response |
(n_f x K [x n_y x n_u]) complex, [] in time series |
.ResponseStd |
(n_f x K [x n_y x n_u]) real, [] in time series |
.NoiseSpectrum |
(n_f x K [x n_y x n_y]) real |
.NoiseSpectrumStd |
(n_f x K [x n_y x n_y]) real |
.Coherence |
(n_f x K) real (SISO), [] for MIMO/time series |
.SampleTime |
sample time |
.SegmentLength |
L |
.Overlap |
P |
.WindowSize |
M (BT) or [] (Welch) |
.Algorithm |
'bt' or 'welch' |
.NumTrajectories |
number of trajectories L |
.Method |
'sidFreqMap' |
Examples¶
% Time-varying frequency map (Blackman-Tukey)
N = 4000; u = randn(N, 1);
y = filter([1], [1 -0.9], u) + 0.1*randn(N, 1);
result = sidFreqMap(y, u, 'SegmentLength', 512);
sidMapPlot(result);
Specification¶
SPEC.md §6 — Time-Varying Frequency Response Map
See also¶
sidFreqBT, sidSpectrogram, sidMapPlot
Changelog¶
- 2026-03-29: Refactored from sidFreqBTMap, added Welch support.