MATLAB: Can I use ifft to find discrete impuluse response(like sinc finction)

ifftimpulse responsesinctransfer function

Excuse me,can I use ifft to find discrete impuluse response(like sinc finction)?
We know s=jw=j2*pi*f,so Transfer function(model as high pass filter
) :H(i)= R2/(R1/(sR1C+1)+R2) = R2/(R1/(1+(2*pi*f*C*R1*j)+R2))
Fs=100MHz
Scale:-Fs/2:Fs/100:Fs/2, sample(divide) frequency response to 100 points, so each step size is "Fs/100".
And then put this 100 points value to matlab matrix for doing ifft.
This is my code,I don't know how to next and I think its not the correct answer….
Thank you for your patience.
clear;
clc;
close all;
Fs = 100e6;
R1 = 2500;
R2 = 50;
C = 30*1e-12;
H = [];
for i = 1:100
f = -Fs/2+(Fs/100)*i; %f=-Fs/2:Fs/128:Fs/2
x(i) = f;
H(i) = R2/(R1/(1+(2*pi*f*C*R1*j)+R2));
end
Habs=abs(H);
plot(x,Habs);
y=abs(ifft((H)));

Best Answer

Actually, we solved this in your previous Question. The impulse response is the inverse Fourier transform of the transfer function:
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)
If you want to plot the impulse response of your filter, substitute in some component values use ezplot:
h = subs(h, {R1,R2,C}, {10000,100,1E-6});
figure(1)
ezplot(h, [0 1E-3])
For the Fourier transform of the square wave, use the Symbolic Math Toolbox to compute the analytic Fourier transform:
syms A T t w
SqWv = A/(2*t);
FSqWv = int(SqWv * exp(1j*w*T), T, -0.5*t, 0.5*t)
FSqWv =
(A*sin((t*w)/2))/(t*w)
Substitute values for ‘A’ and ‘w’ and plot the function from -t to +t for some value of t.