Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
EXPERIMENT: 6
BASIC FUNCTIONS USING MATLAB
THEORY:
A low-pass filter (LPF) is a filter that passes signals with a frequency lower than a
selected cut-off and attenuates signals with frequencies higher than the cut-off
frequency.
In signal processing, a sinc filter is an idealized filter that removes all frequency components
above a given cut-off frequency, without affecting lower frequencies, and has linear
phase response. The filter's impulse response is a sinc function in the time domain, and
its frequency response is a rectangular function.
It is an "ideal" low-pass filter in the frequency sense, perfectly passing low frequencies,
perfectly cutting high frequencies; and thus may be considered to be a brick-wall filter.
PROGRAM:
clc;
close all;
clear all;
M=20;%length of filter
a=M/2;
fc=300;
wc=300/1000;
%Inbuit
Function----------------------------------------------------
b=fir1(20,(300/1000),rectwin(M+1))%calculating cofficients of
rectangular filter
[H,w]=freqz(b,1,216);
q=abs(H)%magnitude plot using inbuilt function
subplot(221)
plot(w/pi,q)
xlabel('Normalized Frequency')
ylabel('Magnitude(dB)')
title('Magnitude Plot using inbuilt function')
subplot(223)%magnitude plot
plot(w/pi,abs(H1))
xlabel('Normalized Frequency')
ylabel('Magnitude(dB)')
title('Magnitude Plot')
subplot(224)%phase plot
plot(w/pi,phase(H1))
xlabel('Normalized Frequency')
ylabel('Phase(degrees)')
title('Magnitude Plot')
OUTPUT:
CONCLUSION:
In the experiment we implemented the low pass filter with a given pass band and
stop band frequency, using a rectangular window technique. We plotted its
magnitude and phase response and verified the same using the inbuilt function.