EXPERIMENT NO.
5
ANALOG HP/LP FILTERS
Objective:
To obtain frequency response of analog LP/HP filters using MATLAB.
Tools Required:
Operating System : Windows XP
Software : MATLAB 7
Theory:
Analog filter is a filter which operates on continuous-time signals. In particular, linear,
time-invariant (LTI) analog filters can be characterized by their (continuous) impulse
response h(t), where‘t’ is time in seconds. Analog filters may be described by a differential
equation. To compute the transfer function of an analog filter, we use the Laplace transform.
(a)A simple low-passRC filter
The transfer function of the simple RC analog Low Pass filter is given by
H(s) =1/ (1+sωRC) ------> (1)
And the magnitude of the transfer function is given by
|H(s)|= 1/ (√1+ω²R²C²) ------> (2)
(b)High Pass filter
Vishnu Institute of Technology Page 16
The RC high-pass filter has the capacitor in series with the signal and the resistor
across the output as show in fig (b). At high frequencies, C has very low impedance, and the
signal passes through unhindered. As the frequency decreases, however, X C becomes
significant, until at the cutoff frequency, X C=R, just as with the low-pass filter. At still lower
frequencies, XC increases, and less of the signal reaches the output.
The transfer function of the simple RC High Pass analog filter is given by
H(s) = sωRC/ (1+sωRC) -------> (3)
And the magnitude of the transfer function is given by
|H(s)| = (ω²R²C²)/ (√ (1+ω²R²C²)) --------> (4)
Program:
%Analog HP/LP Filter
clc;
clear all;
close all;
disp('Input data for simple RC analog LPF');
R=input('Enter the resistance value in kilo ohms');
C=input('Enter the capacitor value in micro farads');
L=input('Enter the frequency range');
R=1000*R;
C=C/1000000;
W=0:0.1:L;
k=W*R*C;
ks=k.*k;
S=sqrt(1+ks);
MSofLPF=S.^-1;
Vishnu Institute of Technology Page 17
MSofHPF=k.*(S.^-1);
disp('Amplitude of magnitude spectrum of LPF');
disp(MSofLPF);
disp('Amplitude of magnitude spectrum of HPF');
disp(MSofHPF);
subplot(2,1,1);
plot(W,MSofLPF);
grid on;
title('Response of LPF');
xlabel('frequency');
ylabel('amplitude');
subplot(2,1,2);
plot(W,MSofHPF);
grid on;
title('Response of HPF');
xlabel('frequency');
ylabel('amplitude');
Result:
Input data for simple RC analog LPF
Enter the resistance value in kilo ohms: 500
Enter the capacitor value in micro farads: 0.1
Enter the frequency range: 100
Vishnu Institute of Technology Page 18
Wave forms of Analog Filter:
Response of LPF
1
0.8
0.6
amplitude
0.4
0.2
0
0 100 200 300 400 500 600 700 800 900 1000
frequency
Response of HPF
1
0.8
0.6
amplitude
0.4
0.2
0
0 100 200 300 400 500 600 700 800 900 1000
frequency
Vishnu Institute of Technology Page 19