Use matlab identification tool to estimate the transfer function of the vibrating system

There are many functions in the Matlab identification toolbox. Here is a simple example to show how to use the estimated system transfer function.

For example, our task is to know the input and output of the system, but the system is unknown. It is a black box, and we need to estimate the transfer characteristics of the system .

Our system input and output data are as follows

67167798d9864c819b616e8065562e9c.png

5da1265cad7742ed80a1504cb643d270.png

 The system is unknown, we solve for the system response by estimating the power spectrum

 Transfer function estimate - MATLAB tfestimate6c049c56e6b442c881d9444ad4ceb57c.png

 The system frequency response is obtained by dividing the cross-power spectrum and the self-power spectrum

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

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

tfunc=pyx./pxx;

We get the system frequency response (magnitude and phase)

plot(f,(abs(tfunc)));
title('Transmission tf amplitude small range');
xlim([0,20]);
 

plot(f,(angle(tfunc)));
title('Transmission tf phase small range');
xlim([0,20]);
ypf = angle(tfunc);

 That 82fe94af9c9f44c298cf909c7bf86b7f.png's exactly the same frequency response as we're using

0da0ed2d125146ef9ab53eb404cfaf2d.png

The transfer function of the system is estimated as follows

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

 The above na nb nk are respectively, the number of denominator coefficients, the number of numerator coefficients and delay

Unfortunately, we don't know the number of poles and zeros of this unknown system (or the order of the polynomial)

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'));

Estimated system response, the characteristics of the two peaks have been simulated

 19e873d18f844bff9bbf3646b42b41d8.png

unit shock

step(modeltf)

47cec4ce73b1471f8982de34a40f5cf9.png

Transfer Function

f557454215ce4bf5a0087cbc83838cd5.png

pole-zero form

890051e8d93d47a68ae1f7b355cddae1.png

 zplane pole-zero plot 

 907fc4f1641e4663addbda186bc5a636.png

Guess you like

Origin blog.csdn.net/book_bbyuan/article/details/126298989