系统标识工具箱™ provides tools for analyzing data and for estimating and evaluating models in both the time and the frequency domains. To use tools and methods that are not in the same domain as your measured data, you can transform your data between the time domain and the frequency domain.
Theiddata
object stores time-domain or frequency-domain data.
Time-domaindata consists of one or more input variablesu(t)和一个或多个输出变量y(t), sampled as a function of time.
Frequency-domaindata consists of either transformed input and output time-domain signals or system frequency response sampled as a function of the independent variable frequency.
For detailed information about representing time-domain and frequency-domain data in MATLAB®, seeRepresenting Data in MATLAB Workspace.
您可以将数据从一个域转换为另一个域。该表总结了时间和频域之间转换数据的命令。有关更多命令信息,请参见相应的命令参考页面。
Command | Description | Syntax Example |
---|---|---|
FFT |
Transform time-domain data to the frequency domain. You can specify |
To transform time-domain f_data = fft(t_data,N) |
ifft |
Transform frequency-domain data to the time domain. Frequencies are linear and equally spaced. | To transform frequency-domain T_DATA= ifft(f_data) |
转换iddata
将数据数据形式IDFRD
frequency response is a type of estimation. If you want to estimate the frequency response using aniddata
object, seeTransforming Between Frequency-Domain and Frequency-Response Data.
将数据从时间域转换为频域,然后回到时域,并比较根据原始数据和转换数据估计的模型的性能。
加载和绘制时间域数据z1
, which contains 300 samples.
loadiddata1z1plot(z1)
Find the sample timeTs
的z1
.
TS = Z1.TS
TS = 0.1000
The sample time is 0.1 s.
Transformz1
into the frequency domain.
z1f = fft(z1)
Z1F =频域数据集,响应在151个频率下。频率范围:0至31.416 RAD/秒样本时间:0.1秒输出单元(如果指定)Y1输入单元(如果指定)U1
The frequency range extends to 31.416 rad/s, which is equal to the Nyquist frequency ofpi
/Ts
.
绘制频域数据。
plot(z1f)
Transformz1f
返回时域并将两个时间域信号绘制在一起。
Z1T = IFFT(Z1F)
z1t = Time domain data set with 300 samples. Sample time: 0.1 seconds Outputs Unit (if specified) y1 Inputs Unit (if specified) u1
plot(z1t,z1)
The signals line up precisely.
Estimate second-order state-space models forz1
和z1t
.
sys1 = sest(z1,2);sys1t = sest(z1t,2);比较(z1,sys1,sys1t)
Estimate a state-space model forz1f
.
sys1f = ssest(z1f,2); compare(z1f,sys1f)
The fit percentages for the time-domain and frequency-domain models are similar.
etfe
|FFT
|iddata
|ifft
|温泉
|SPAFDR