summaryrefslogtreecommitdiff
path: root/758/CH7/EX7.4/Ex_7_4.sce
blob: 15ef34ce76c321a84511f501b01c2186200db213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//Example 7.4

clc;clear;close;
M=7;w=2*%pi/M;

//Calculation of filter co-efficients
k=[0 1 6];
for n=0:M-1
    h(n+1)=sum(exp(-%i*3*w*k).*exp(%i*w*k*n))/M;
end
h=clean(h);

//Displaying filter co-efficients
disp(M,'Filter Order M= ');
disp('Filter co-efficients:');
disp(h,'h(n)= ');

plot2d3(h);
title('Filter transfer function h(n)');xlabel('n-->');