How can use transfer function to find impulse response?
29 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens

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 commentaires
Réponse acceptée
Star Strider
le 20 Fév 2016
Modifié(e) : Star Strider
le 21 Fév 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 commentaires
Plus de réponses (3)
Tim Yeh
le 21 Fév 2016
1 commentaire
Star Strider
le 21 Fév 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
le 23 Fév 2016
2 commentaires
Star Strider
le 23 Fév 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.
Voir également
Catégories
En savoir plus sur Stability Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

