Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Impulse response of function

2 views
Skip to first unread message

zubair

unread,
Nov 29, 2008, 12:27:02 PM11/29/08
to
I need to find the Impulse Response of this function on Matlab:

g(t) = 3f(t) - 2f(t-1) +2f(t-2)

Kindly help me ...

Nasser Abbasi

unread,
Nov 29, 2008, 1:39:41 PM11/29/08
to

"zubair " <zuba...@hotmail.com> wrote in message
news:ggru16$l2d$1...@fred.mathworks.com...

>I need to find the Impulse Response of this function on Matlab:
>
> g(t) = 3f(t) - 2f(t-1) +2f(t-2)
>
> Kindly help me ...

I think you do this. Take laplace transform of the above

G(s)=3F(s)-2 Exp(-s) F(s) + 2 Exp(-2s) F(s)

Then the transfer function is G(s)/F(s) = 3-2 Exp(-s)+ 2 Exp(-2s)
The impulse response is when F(s)=1, then H(s)=3-2 Exp(-s)+ 2 Exp(-2s)

may be you can use matlab 'tf' to set it up.
also help laplace

Nasser


zubair

unread,
Nov 30, 2008, 9:53:02 AM11/30/08
to
"Nasser Abbasi" <n...@12000.org> wrote in message <R%fYk.8824$c45....@nlpi065.nbdc.sbc.com>...


Thanks but how can find the impulse by using just For-loop...??

BHUPALA

unread,
Nov 30, 2008, 12:11:08 PM11/30/08
to
On Nov 30, 7:53 pm, "zubair " <zubair...@hotmail.com> wrote:
> "Nasser Abbasi" <n...@12000.org> wrote in message <R%fYk.8824$c45.6...@nlpi065.nbdc.sbc.com>...
>
> > "zubair " <zubair...@hotmail.com> wrote in message

> >news:ggru16$l2d$1...@fred.mathworks.com...
> > >I need to find the Impulse Response of this function on Matlab:
>
> > > g(t) = 3f(t) - 2f(t-1) +2f(t-2)
>
> > > Kindly help me ...
>
> > I think you do this. Take laplace transform of the above
>
> > G(s)=3F(s)-2 Exp(-s) F(s) + 2 Exp(-2s) F(s)
>
> > Then the transfer function is G(s)/F(s) = 3-2 Exp(-s)+ 2 Exp(-2s)
> > The impulse response is when F(s)=1, then H(s)=3-2 Exp(-s)+ 2 Exp(-2s)
>
> > may be you can use matlab 'tf' to set it up.
> > also help laplace
>
> > Nasser
>
> Thanks but how can find the impulse by using just For-loop...??

Use impz function

h = impz(1,[3 -2 2],100);

It gives the first 100 samples of the impulse response starting from
0.

Hope this helps!

bhupala.

Lars

unread,
Nov 30, 2008, 12:24:02 PM11/30/08
to
> g(t) = 3f(t) - 2f(t-1) +2f(t-2)

I'm not a specialist, but why not simply

>> filter([3 -2 2], [1], [1 0 0 0 0 0 ]);

???

zubair

unread,
Nov 30, 2008, 12:48:02 PM11/30/08
to
"Lars" <mustermann.kl...@gmx.de> wrote in message <ggui7i$598$1...@fred.mathworks.com>...


I hav already implement like this but i need to implement it by using for loop and then compare both results

Lars

unread,
Dec 1, 2008, 4:11:06 AM12/1/08
to
Am I wrong saying that since this is a FIR-filter there's nothing to implement?

Andor

unread,
Dec 1, 2008, 6:47:50 AM12/1/08
to
Lars wrote:
> Am I wrong saying that since this is a FIR-filter there's nothing to implement?

No, you are right :-).

zubair

unread,
Dec 4, 2008, 8:35:02 AM12/4/08
to
I have succeeded to implement it .. here is the code

t = [-2:50]; % Time grid
d = zeros(size(t)); % Impulse function
d(t==0) = 1;
% g_t = 3f_t - 2f_{t-1} + 2f_{t-2}
h = zeros(size(t)); % Computation of impulse response
for k = 0:max(t),
h(t==k) = 3*d(t==k) - 2*d(t==k-1) + 2*d(t==k-2);
end

figure
stem(t,h) % Plot impulse response
title('a) Stable FIR system')
axis([-2 50 -3 3])

Andor <andor....@gmail.com> wrote in message <1abedda6-6560-43eb...@c1g2000yqg.googlegroups.com>...

Lars

unread,
Dec 20, 2008, 6:29:03 AM12/20/08
to
"zubair " <zuba...@hotmail.com> wrote in message <gh8ma6$bkn$1...@fred.mathworks.com>...

> I have succeeded to implement it .. here is the code

Why???

0 new messages