【发布时间】:2013-10-17 18:39:31
【问题描述】:
我正在尝试使用 FFT 方法找到一组输入输出数据的系统传递函数。我遵循的算法如下:
- 将输入数据和输出数据加载到matlab中。
- 对输入数据和输出数据进行 FFT。
- 将输出 FFT 除以输入 FFT 并取幅值。由于我们示例的输入是单位脉冲,因此输入 FFT 为 1.0。
- 将结果绘制为波特图。
- 将生成的 Bode' 图视为频率响应 - 它确实如此 - 并使用频率响应方法将传递函数拟合到计算出的 Bode' 图。
我的代码是:
load testdata.mat; // testdata is a 2 column matrix (1001x2 matrix)
input = fft(signal(:,1)); // FFT of input data (1001x1 complex matrix)
output = fft(signal(:,2)); // FFT of output data (1001x1 complex matrix)
fft_ratio = output/input; // (1001x1001 complex matrix)
fft_ratio_mag = abs(fft_ratio); // (1001x1001 matrix) except column 1, all other columns have '0' data
bode(fft_ratio_mag(:,1))
我收到以下错误:
Error using bode (line 84)
Not enough input arguments.
请指导我如何执行上述算法中的第 4 步和第 5 步。
【问题讨论】:
-
fft_ratio 作为 1001x1001 矩阵;听起来对吗?
-
如果这是 mathworks 波特函数,它适用于系统对象,而不是矩阵。 mathworks.com/help/ident/ref/bode.html
-
除第一列外,其他列均为0 + 0i。所以我猜这并不重要。我看过 mathworks.in/help/ident/ref/bode.html 页面。但是,我无法生成系统。
-
根本不要使用那个功能,看我的回答。
标签: matlab