retrieving the impulse response of a function using freqz (not impz)

5 views (last 30 days)
Can anyone help me retrieve the impulse response of a filter by USING freqz command and NOT impz command? I know that when you use freqz, its answer will be the H(W). So by using IDFT on H(W) I can retrieve h(n). But how do you do that?
Example I want 100 samples of the impulse response of the filter described by the lccde y(n)-3y(n-1) = x(n). I would input [H,~] = freqz(1,[1 -3],100,'whole'). From here, H output is H(w) right? So I would use [Y] = ifft(H',100) function to inverse fourier the H(w) to h(n) using 100 samples to obtain 100 samples. But checking the answer using [i,~] = impz(1,[1 -3],100) would net a very FAR result. Please help me, this would really help me pass my subject in college.

Answers (1)

Daniel kiracofe
Daniel kiracofe on 3 Dec 2016
I suspect your problem is that the system you are trying to study is unstable. i.e. the pole lies outside the unit circle, so the impulse response grows exponentially without bound. I think if you tried something like [H,~] = freqz(1,[1 -0.3],100,'whole') instead, which is a stable system, you would find that it would match better with impz. This page might help explain it a little better. http://ptolemy.eecs.berkeley.edu/eecs20/lectures/chapter12part1student.pdf
Also I don't think you need the transpose. ifft(H,100) should be good.

Tags

Community Treasure Hunt

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

Start Hunting!