使用matlab辨识工具来估算震动系统的传递函数

Matlab辨识工具箱里面的函数很多,这里用一个简单的例子来展示估算系统传递传递函数的使用方法。

比如我们的任务是,已知系统的输入输出,而系统未知,是个黑盒子,需要我们去估算系统的传递特性

我们的系统输入输出数据如下

67167798d9864c819b616e8065562e9c.png

5da1265cad7742ed80a1504cb643d270.png

 系统未知,我们通过 功率谱估算 来求解系统响应

 Transfer function estimate - MATLAB tfestimate6c049c56e6b442c881d9444ad4ceb57c.png

 互功率谱和自功率谱相除就得到了系统频响

[pxx,f1] = pwelch(x,window,noverlpap,Nfft,fs);

[pyx ,f2]= cpsd(y,x,window,noverlpap,Nfft,fs);

tfunc=pyx./pxx;

我们得到系统频响(幅度和相位)

plot(f,(abs(tfunc)));
title('传输tf幅度 小范围');
xlim([0,20]);
 

plot(f,(angle(tfunc)));
title('传输tf相位 小范围');
xlim([0,20]);
ypf = angle(tfunc);

 这刚好和我们用82fe94af9c9f44c298cf909c7bf86b7f.png得到的 频响是一致的

0da0ed2d125146ef9ab53eb404cfaf2d.png

下面估算系统的传递函数

Create Frequency Response Object

sysfr = idfrd(ResponseData,Frequency,Ts) creates a discrete-time idfrd object that stores the frequency response ResponseData of a linear system at frequency values FrequencyTs is the sample time. For a continuous-time system, set Ts to 0.

sys = arx(data,[na nb nk]) estimates the parameters of an ARX or an AR idpoly model sys using a least-squares method and the polynomial orders specified in [na nb nk]. The model properties include covariances (parameter uncertainties) and goodness of fit between the estimated and measured data.

e87e8e39fc0a43adacfcf391c485ef21.png

 上na nb nk分别是,分母系数个数,分子系数个数和delay

很遗憾,我们也不具体了解这个未知系统的 零极点个数(或者说多项式的阶数)

ypf = abs(tfunc);
xpf = f;

frdobj = idfrd(ypf,xpf,1/fs);

modelobj = arx(frdobj,[4 3 0])

modeltf = tf(modelobj);

b = cell2mat(get(modeltf,'Numerator'));
a = cell2mat(get(modeltf,'Denominator'));

估算的系统响应,已经把两个峰值的特性 仿真出来了

 19e873d18f844bff9bbf3646b42b41d8.png

单位冲击

step(modeltf)

47cec4ce73b1471f8982de34a40f5cf9.png

传递函数

f557454215ce4bf5a0087cbc83838cd5.png

零极点形式

890051e8d93d47a68ae1f7b355cddae1.png

 zplane 零极点图 

 907fc4f1641e4663addbda186bc5a636.png

猜你喜欢

转载自blog.csdn.net/book_bbyuan/article/details/126298989