You are on page 1of 4

Spectral Analysis and Signal Processing

Homework 4
R06521206 楊亞衡 (Yang Ya-Heng)

 ARX Model (SISO)

A(q) y (t )  B(q)u (t )  e(t )


A(q)  1  a1q 1   ana q  na (1)
B(q)  b1q 1   bnb q  nb

, where y(t), u(t) are system output and input respectively. na , nb are the order of system output
and input respectively. A(q), B(q) are the AR and X polynomials, in terms of the delay operator.

 Linear Regression

y (t )   T (t )  e(t )
 (t )  [ y (t  1),  y (t  na ), u (t  1), u (t  nb )] (2)
  [a1 , ana , b1 bnb ]

, where na  2  M , M  degree of freedom for system .

 Least Square Method



min( y  y )2
 N N (3)
  [  (t ) T (t )]1 [  (t ) y(t )]
i 1 i 1
 Input Record (Group A)

 Output Record (Group A)


 Input File
0.05 Sampling time
par.dat – design parameter 1 Input number
1 Output number
na.dat - order of system output 38
nb.dat – order of system input 30
nk.dat – order of time delay 1

 Transfer Function

 Frequency & Damping (f = 0.148705sec, damping ratio = 0.017166 )


0.148705 0.017166 2.747777 0.028958 9.772620 0.020384 6.896377 0.024329
0.148705 0.017166 2.747777 0.028958 9.772620 0.020384 6.896377 0.024329
0.482603 0.021511 3.510088 0.060371 9.186835 0.026385 5.355931 0.028184
0.482603 0.021511 3.510088 0.060371 9.186835 0.026385 5.355931 0.028184
1.060378 0.020497 3.648127 0.047629 8.645758 0.027111 6.301381 0.027690
1.060378 0.020497 3.648127 0.047629 8.645758 0.027111 6.301381 0.027690
1.700193 0.031389 4.443830 0.055461 8.050678 0.024211 5.818496 0.034678
1.700193 0.031389 4.443830 0.055461 8.050678 0.024211 5.818496 0.034678
2.334892 0.071955 4.602296 0.041920 7.514411 0.028811
2.334892 0.071955 4.602296 0.041920 7.514411 0.028811
 MATLAB CODE
gA = importdata('case5-Group A.txt');
time = gA.data(:,1);
input = gA.data(:,2);
output = gA.data(:,3);
save inp.dat input -ascii
save out.dat output -ascii
amplitude = importdata('amp1.dat');
freq = importdata('fre1.dat');
FD = importdata('fq_Damp.dat');
% plot input & output record
figure(1)
plot(time,input,'LineWidth',1);
xlabel('Time (sec)'), ylabel('Accelation (gal)'),title('Excitation')
grid on
figure(2)
plot(time,output,'LineWidth',1);
xlabel('Time (sec)'), ylabel('Accelation (gal)'),title('Response')
grid on
% plot transfer function
figure(3)
plot(freq,amplitude,'LineWidth',2);
xlabel('Frequency (Hz)'), ylabel('Amplitude'),title('Transfer Function')
grid on

 Try

na nb f1 d1
24 24 0.15456 0.12968
30 30 0.15117 0.07072
32 32 0.14953 0.04556
34 34 0.14888 0.02933
36 36 0.1488 0.0204
36 30 0.14883 0.02048
38 38 0.14871 0.01712
38 30 0.14871 0.01717

You might also like