Вы находитесь на странице: 1из 5

WOLKITE

University
College of Engineering and Technology
Department of Electrical and Computer
Engineering
Section – B Group 3
Digital signal processing
Title: -Mathlab code to
design rectangular and hamming window
RNO group members id no.

Getasew Muluye------------------------- 411/08


Abebe Haile-------------------------------- 028/08
Gashaw Bayih------------------------------389/08

Submitted to:- Submission date:


Mr.Kashaye 21/09/2010
Objective
To develop mat lab code to design a 25 tap band reject filter with cutoff frequency of
0.25*pi radian and 0.75pi radian using

A, rectangular window

B, hamming window

Write a short report of your observation and evaluation on the effect of the band reject filter
by varying the given values (cutoff frequency and tap length)

Using rectangular and hamming windows: -


Mathlab code
%using rectangular window
clc;
clear all;
wc1=.25*pi;wc2=.75*pi;
N=25;a=(N-1)/2;
eps=.001;
n=0:1:N-1;
hd=(csc(wc2*(n-a+eps))-csc(wc1*(n-
a+eps)))./(pi*(n-a+eps));
wr=boxcar(N);
hn=hd.*wr';
w=0:0.01:pi;
h=freqz(hn,1,w);
subplot(1,2,1);
plot(w/pi,abs(h));
title('RECTANGULAR WINDOW');
xlabel('normalized frequence\omega/\pi');
ylabel('magnitud');
wh=hamming(N);
hn=hd.*wh';
w=0:0.01:pi;
h=freqz(hn,1,w);
subplot(1,2,2);
plot(w/pi,abs(h));
title('HAMMING WINDOW');
xlabel('normalized frequence\omega/\pi');
ylabel('magnitud');
Figure 1 simulation for rectangular and
hamming windows
Result

For rectangular window as the tap length increase more information


is present in the side lobe and the main lobe became linear approaching x-
axis and when tap length decrease the main lobe became wider from top to
bottom.
For hamming window when the tap length increase the side lobe becomes
sinusiodal and the main lobe become constantly linear and overlap the x-
axis.
For rectangular windows as the tap length decrease the lobe become narrow
and the side lobe become wider from top to bottom.
For hamming window when the tap length decrease then the main lobe
become narrow and the side lobe narrow .

For rectangular window when the cutoff frequency increase the main lobe
became sinusoidal wave and the side become narrow .
For hamming window when the cutoff frequency increase the side lobe
becomes narrow and the lobe become linear.
For rectangular window as decrease then the main lobe and the side lobe
approximately become linear
For hamming window as the cutoff frequency decrease the lobe become
narrow and the main lobe become sinusoidal .

Вам также может понравиться