blob: 663ee5aa2644a925d93ddd5cae2d6b959b6b5c06 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
//Example 6.18b
//Program to design L.P.F. filter with following specifications:
//N=15, wc=pi/4
clear;
clc ;
close ;
N=15;
U=1;
for n=0+U:1:N-1+U
h(n)=(1+cos(2*%pi*(7-n)/N)+cos(4*%pi*(7-n)/N))/N;
end
[hzm ,fr ]= frmag (h ,256) ;
hzm_dB = 20* log10 (hzm)./ max ( hzm );
figure;
plot (2*fr , hzm_dB );
a= gca ();
xlabel ('Frequency w*pi');
ylabel ('Magnitude in dB');
title ('Frequency Response of FIR LPF with N=11');
xgrid (2)
|