HAM­MING.M

Electronics For You - - Section -

X(k)=x(k)+(w(n)*exp(-1j*w*(n-1))); end M(k)=abs(x(k)); A(k)=an­gle(x(k)); k=k+1; end M=20*log10(m); w=-pi:0.01:pi n=0:n-1; fig­ure(1); stem(n,w); grid on; ti­tle(‘fil­ter’); xla­bel(‘sam­ples ­­>’); yla­bel(‘am­pli­tude ­­>’); fig­ure(2) plot(w,m); grid on; ti­tle(‘mag­ni­tude ‘); xla­bel(‘sam­ples ­­>’) ; yla­bel(‘am­pli­tude ­­>’) ; fig­ure(3) plot(w,a); grid on; ti­tle(‘an­gle’); xla­bel(‘sam­ples ­­>’) ; yla­bel(‘am­pli­tude ­­>’) ; %Out­put. %En­ter the length of fil­ter = 31

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.