Scaling with Imp2SS function

I was wondering if there is a scaling factor with imp2ss function? I have an impulse response curve, i.e. K(t), at every 0.05s. When I use sys = imp2ss(K(t),0.05), and use impulse(sys) the result is 20*K(t). Therefore, if I use sys = imp2ss(K(t)/20,0.05), then use impulse(sys) I get back the exact K(t) function I inputted. I was hoping you can confirm what I did was correct or if there is something I am overlooking.
I am using ver 2009a.

Respuestas (2)

Fangjun Jiang
Fangjun Jiang el 30 de Ag. de 2011

0 votos

I think you need to use impulse(sys,Ti:Ts:Tf) where Ts is 0.05 for you to make it match.
Update
This is an interesting question!
First,the observation of the scaling factor is correct. It could be explained though. For that, we need to understand that impulse() means differently for continuous system and discrete system. From doc impulse, "impulse calculates the unit impulse response of a linear system. The impulse response is the response to a Dirac input for continuous-time systems and to a unit pulse at t=0 for discrete-time systems."
So if we think of the energy input by the impulse, for continuous system, the energy is 1. For discrete system, the energy is 1*Ts where Ts is the sample time because impulse for discrete system just provides one pulse at the beginning. That causes the scaling at the output because the system is linear.
Second, we need to understand the function imp2ss(). Assume y is a measured impulse response, imp2ss(y) will return a discrete system with unknown sample time (or inherient, -1). imp2ss(y,Ts) will return a continuous system.
Many people think that the same A,B,C,D matrix applied to ss(A,B,C,D) and ss(A,B,C,D,Ts) will result in the corresponding continuous system and discrete system and their response should be the same. That is wrong. The conversion between continuous system and discrete system need to be done through c2d() or d2c(). The A,B,C,D matrix will depend on the discretization method.
So how to make the story? The identified system by imp2ss() should match the original system, right? That is right, but you need to pick the right system. The following example should show that they can match. Note the curves in figure 3 are almost identical most of the times.
ConSys=rss(2); %continuous system
[y_ConSys,t_ConSys]=impulse(ConSys);
Ts=0.1;
DisSys=c2d(ConSys,Ts); %discrete system
[y_DisSys,t_DisSys]=impulse(DisSys);
figure(1);
plot(t_ConSys,y_ConSys,'r',t_DisSys,y_DisSys,'b');
legend({'ConSys','DisSys'});
%
Id_ConSys=imp2ss(y_DisSys,Ts); %identified continuous system
[y_Id_ConSys,t_Id_ConSys]=impulse(Id_ConSys);
figure(2);
plot(t_ConSys,y_ConSys,'r',t_Id_ConSys,y_Id_ConSys,'b');
legend({'ConSys','Id\_ConSys'});
Id_DisSys=imp2ss(y_DisSys); %identified discrete system
set(Id_DisSys,'Ts',Ts);
[y_Id_DisSys,t_Id_DisSys]=impulse(Id_DisSys);
figure(3);
plot(t_DisSys,y_DisSys,'r',t_Id_DisSys,y_Id_DisSys,'b');
legend({'DisSys','Id\_DisSys'});

1 comentario

Nathan
Nathan el 25 de Sept. de 2011
Thank you for your suggestion, and I apologize for my late response. Unfortunately, trying the above solution still does not provide the same overlapping results that I am looking for. If anyone has any additional thoughts I would greatly appreciate any feedback. Thank you.

Iniciar sesión para comentar.

MANASES TELLO RUIZ
MANASES TELLO RUIZ el 19 de Oct. de 2011

0 votos

I have the same problem, I used the K(t)/20 and it works, however this 20 seems to be equal to ts =0.05 =1/20. Can someone explain this ?

Etiquetas

Preguntada:

el 30 de Ag. de 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by