这是在" sigout"之间找到传递函数的简单代码。和" sigin"信号然后是由" invfreqz"估计的滤波器系数。功能
%% load simlated data
load CFDvsABAQUS_TC.mat
%% simulated data preprocessing (grid orientation B)
time = TCb(:,1);
sigin = TCb(:,2); % inlet temperature (TC signal by Abaqus)
sigout = TCb(:,3); % outlet temperature (by cfd FENIX)
Fs = 1/mean(diff(time)); % sampling frequency
%% Transfer Function Estimate outlet->inlet
[toi,foi]=tfestimate(sigout,sigin,2^13,[],[],Fs);
%% filter design by known transfer function
w = linspace(0,pi,length(fio)); % angular frequency f=[0,fs/2] -> w=[0,pi]
m = 500; % b coeffs
n = 500; % a coeffs
[boi,aoi] = invfreqz(toi,w,n,m);
%% final Digital filtering
esigin = filter(boi,aoi,sigout);
输入数据位于: https://www.dropbox.com/s/hj09ktc67mnzs4d/CFDvsABAQUS_TC.mat?dl=0
最终的过滤功能会产生完全错误的结果(结果应与原始" sigin"信号相似)。我不知道出了什么问题。
任何帮助对我都非常有用。提前谢谢。