|
"Sreevas " <mailsreevas@gmail.com> wrote in message <i0i2u7$ov9$1@fred.mathworks.com>...
> "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0ci50$gt6$1@fred.mathworks.com>...
> > "Sreevas " <mailsreevas@gmail.com> wrote in message <i0ceik$1i$1@fred.mathworks.com>...
> > > "Sreevas " <mailsreevas@gmail.com> wrote in message <i0adsu$p4n$1@fred.mathworks.com>...
> > > > "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0a5rp$pf1$1@fred.mathworks.com>...
> > > > > "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > > > > > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
> > > > >
> > > > >
> > > > > Wow.. It makes me so happy when i See people asking intereting question and then loooking at the power of Matlab turn to it forever..
> > > > >
> > > > > Here is the way to simulate ur response..
> > > > > u will use gensig command.
> > > > > To generate a sine wave of
> > > > > PERIOD = 3 sec,
> > > > > DURATION = 10 sec
> > > > > SAMPLED AT = 0.1 sec
> > > > > Use this..
> > > > > [u,t] = gensig('sin',3,10,0.1)
> > > > >
> > > > > Once you achieved it use this to find response..
> > > > > lsim(sys,u,t)
> > > > >
> > > > > Let me know if it was help..
> > > > >
> > > > > Regards,
> > > > > Muhammad Faraz
> > > >
> > > > Thanks a lot for the info. But how can I apply this to the matrix that I have created. I have 2 x 2 matrix for the low pass filter nd i gave step of (a b c d) to find step response. What sud i do for sinusoidal response
> > >
> > >
> > > Thanks once again. When I tried it out this was the result that i got .What could be the possible solution to this?
> > >
> > > >> [u.t]=gensig('sin',3,10,0.1)
> > >
> > > u =
> > >
> > > t: [101x1 double]
> > >
> > > >> sys=ss(1,2,3,0)
> > >
> > > a =
> > > x1
> > > x1 1
> > >
> > >
> > > b =
> > > u1
> > > x1 2
> > >
> > >
> > > c =
> > > x1
> > > y1 3
> > >
> > >
> > > d =
> > > u1
> > > y1 0
> > >
> > > Continuous-time model.
> > > >> z=lsim(sys,u,t)
> > > ??? Undefined function or variable 't'.
> >
> > no no no... No dear Sreevaas,,
> > go to the process step by step. follow the scheme.
> >
> > 1. Setup your A , B , C, and D matrices.
> > 2. sys = ss(A,B,C,D)
> > 3. [u,t]=gensig('sin',3,10,0.1) (There is comma between u and t but
> > not a dot like u did in your code.)..
> > 4. z=lsim(sys,u,t)
> > 5 plot(z)
> >
> > Or if u literally got ur matrices A,B,C,D as 1,2,3,0 , then follow (copy paste):
> > A = 1
> > B = 2
> > C = 3
> > D = 0
> > sys= ss(A,B,C,D)
> > [u,t] = gensig('sin',2,10,0.01);
> > z = lsim(sys,u,t)
> > plot(z)
> >
> > You can change your sine wave by changing its parameters as i explained long time ago.
> > Regards,
> > Let me know if it works
> >
> > Muhammad Faraz
>
> I hav one more doubt.How can i find the pulse response when I am using matrices?
:)) Sreevaas,
YOur doubt comes too late.. for impulse
use impulse(sys),
for step response
step(sys)
I hope it helps,
Regards,
Muhammad Faraz
|