How can use transfer function to find impulse response?
27 views (last 30 days)
Show older comments

Hello everybody, I need to find time domain impulse response from the transfer function,and my transfer function is H(W)=R2/(R1/(sR1C+1)+R2),modeling as high pass RC filter. Because I want to use convolution(matlab conv) to convolute input signal and RC filter impulse response(H(t)) to obtain output signal.I think I can use ifft to transfer frequency domain to time domain,obtaining its impulse response but I don't know how to do that. Can someone help me?How to use matlab ifft to do it? Best wish have matlab code example. Thank you for your patience
0 Comments
Accepted Answer
Star Strider
on 20 Feb 2016
Edited: Star Strider
on 21 Feb 2016
Just do this all analytically. It’s easiest to describe the derivation with the Symbolic Math Toolbox:
syms C R1 R2 s vi vo
i1 = (vi - vo)/(R1 + 1/(s*C)); % First Branch Equation
i2 = vo/R2; % Second Branch Equation
Node1 = i1 + i2 == 0; % Node Equation
vo = solve(Node1, vo);
H = simplify(collect(vo/vi, s), 'steps', 10) % Transfer Function
h = ilaplace(H); % Impulse Response Is The Inverse Laplace Transform Of The Transfer Function
h = simplify(h, 'steps',10)
hf = matlabFunction(h) % Create An Anonymous Function For Evaluation
H =
-(C*R2*s)/(s*(C*R1 - C*R2) + 1)
h =
(R2*exp(-t/(C*(R1 - R2))))/(C*(R1 - R2)^2) - (R2*dirac(t))/(R1 - R2)
hf = @(C,R1,R2,t) -(R2.*dirac(t))./(R1-R2)+(R2.*exp(-t./(C.*(R1-R2))).*1.0./(R1-R2).^2)./C;
So to plot the impulse response, just substitute in the appropriate values of the components and your time vector in the ‘hf’ anonymous function, and plot the results. I leave that to you.
-----------------------------------------------------------------
EDIT — The expression for ‘i1’ has the components in series in this code. It is corrected in the code in my Comment.
0 Comments
More Answers (3)
Tim Yeh
on 21 Feb 2016
1 Comment
Star Strider
on 21 Feb 2016
My pleasure!
It’s been a while since I did circuit analysis, so this was interesting. It was also educational for me, in that I need to pay more attention to what I’m doing. (I apparently do not multi-task well.)
You’re correct. I erroneously set them up in series rather than in parallel. I corrected ‘i1’ here.
‘And Node1 = i1 + i2 == 0; can be writing as Node1 = i1 - i2 == 0?’
The sum of the currents entering and leaving a node have to be equal to zero. It depends on how you set up the arrows
The (corrected) code:
syms C R1 R2 s vi vo
i1 = (vi - vo)/R1 + (vi - vo)/(1/(s*C)); % First Branch Equation
i2 = -vo/R2; % Second Branch Equation
Node1 = i1 + i2 == 0; % Node Equation
vo = solve(Node1, vo);
H = simplify(collect(vo/vi, s), 'steps', 10) % Transfer Function
h = ilaplace(H); % Impulse Response Is The Inverse Laplace Transform Of The Transfer Function
h = simplify(h, 'steps',10)
hf = matlabFunction(h) % Create An Anonymous Function For Evaluation
H =
1 - R1/(R1 + R2 + C*R1*R2*s)
h =
dirac(t) - exp(-(t*(R1 + R2))/(C*R1*R2))/(C*R2)
hf = @(C,R1,R2,t) dirac(t)-exp(-(t.*(R1+R2))./(C.*R1.*R2))./(C.*R2)
Tim Yeh
on 23 Feb 2016
2 Comments
Star Strider
on 23 Feb 2016
That’s actually a new Question and should be a new post.
I would do it with the Symbolic Math Toolbox instead. Use the int function to do the integral, and set the limits at the times and set the amplitude as in the diagram. You will have to define the ‘t’ constant, or use different variables for the lower-case ‘t’ in the diagram and the integration time variable (perhaps ‘T’) in your integration.
See Also
Categories
Find more on Stability Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
