Here is the circuit diagram.
R = 1 kΩ; C = 10 µF; L = 5 mH.
$$H(j \omega) = \frac{R} {\frac{1}{j \omega C} + j \omega L + R}$$
Amplitude
Phase
The above is what I get from MATLAB, using the code below:
syms C w f
R = 1000;
% Capacitor Impedance
C = 10^(-5);
ZC = 1/(i*w*C);
% Inductor Impedance
L = 5 * 10^(-3);
ZL = i*w*L;
% Frequency Response
H(w) = R/(R + ZC + ZL)
y(f) = subs(eval(H),w,2*pi*f)
degrees(f) = atand(imag(y(f))/real(y(f))) % Phase Response
f = logspace(-3,6,10000);
% first plot figure
f1 = figure('Name','Amplitude Response','NumberTitle','off');
semilogx(f, abs(y(f)), '.b') % Amplitude response
vpa(abs(y(15.26)), 8)
grid on
% second plot figure
f2 = figure('Name','Phase Response','NumberTitle','off');
semilogx(f,degrees(f), '.r')
vpa(degrees(15.26), 8)
grid on
Now, this is what I get from LTspice:
When freq = 15.26 Hz, LTspice says the amplitude is 692.246 mV. But MATLAB tells me it is 692.252 mV. Although it's close, it's different.
lin
andlog
in the.AC
card? Also, 1000G points is not only ridiculous but, LTspice will limit that, internally, to65536
(or65535
). \$\endgroup\$