0% found this document useful (0 votes)
134 views

Window Function

This document discusses verifying different windowing functions - Blackman, Hamming, and Kaiser - for implementing finite impulse response (FIR) filters in MATLAB. It provides theory on each windowing function and examples of code using fir1() with each window to design an FIR filter and plot its frequency response. The result is that windowing functions can be used to implement FIR filters, as verified through examples with the Blackman, Hamming, and Kaiser windows.

Uploaded by

Tanmay Saxena
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
134 views

Window Function

This document discusses verifying different windowing functions - Blackman, Hamming, and Kaiser - for implementing finite impulse response (FIR) filters in MATLAB. It provides theory on each windowing function and examples of code using fir1() with each window to design an FIR filter and plot its frequency response. The result is that windowing functions can be used to implement FIR filters, as verified through examples with the Blackman, Hamming, and Kaiser windows.

Uploaded by

Tanmay Saxena
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

8.

VERIFY WINDOWING FUNCTIONS FOR IMPLEMENTATION OF FIR FILTER


AIM- Verify windowing functions for implementation of FIR FILTER (Blackman,
Hamming, Kaiser)

APPARATUS- MATLAB 7.5.0(R2007b) PROCEDURE Open MATLAB Open new M file Type the program code Save, Compile and run the program See the output on command window or figure window

THEORYBLACKMANw = blackman(L) returns the L-point symmetric Blackman window in the column vector w, where L is a positive integer. w = Blackman (L,'sflag') returns an L-point Blackman window using the window sampling specified by 'sflag', which can be either 'periodic' or 'symmetric' (the default). The 'periodic' flag is useful for DFT/FFT purposes, such as in spectral analysis. The DFT/FFT contains an implicit periodic extension and the periodic flag enables a signal windowed with a periodic window to have perfect periodic extension. When 'periodic' is specified, blackman computes a length L+1 window and returns the first L points. When using windows for filter design, the 'symmetric' flag should be used. HAMMINGw = hamming(L) returns an L-point symmetric Hamming window in the column vector w. L should be a positive integer. The coefficients of a Hamming window are computed from the following equation. The window length is w = hamming (L,'sflag') returns an L-point Hamming window using the window sampling specified by 'sflag', which can be either 'periodic' or 'symmetric' (the default). The 'periodic' flag is useful for DFT/FFT purposes, such as in spectral analysis. The DFT/FFT contains an implicit periodic extension and the periodic flag enables a signal windowed with a periodic window to have perfect periodic extension. When 'periodic' is specified, hamming computes a length L+1 window and returns the first L points. When using windows for filter design, the 'symmetric' flag should be used. KAISER[1]

w = Kaiser (L,beta) returns an L-point Kaiser window in the column vector w. beta is the Kaiser window parameter that affects the sidelobe attenuation of the Fourier transform of the window. The default value for beta is 0.5.To obtain a Kaiser window that designs an FIR filter with sidelobe attenuation of a dB, use the following . Increasing beta widens the main lobe and decreases the amplitude of the sidelobes (i.e., increases the attenuation).

PROGRAMKAISER
N=50; Wn=0.4; coef=fir1(N,Wn,kaiser(N+1,5.653)) disp('coef') [H,W]=freqz(coef,1,500) plot(W/pi,abs(H)); title('fir filter') xlabel('freq') ylabel('magnitude')

OUTPUT USING KAISER FUNCTION[2]

BLACKMANN
N=50; Wn=0.4; coef=fir1(N,Wn,Blackman(N+1)) disp('coef') [H,W]=freqz(coef,1,500) plot(W/pi,abs(H)); title('fir filter') xlabel('freq') ylabel('magnitude')

OUTPUT USING BLACKMAN FUNCTION-

[3]

HAMMINGN=50; Wn=0.4; coef=fir1(N,Wn,hamming(N+1)) disp('coef') [H,W]=freqz(coef,1,500) plot(W/pi,abs(H)); title('fir filter') xlabel('freq') ylabel('magnitude') OUTPUT USING HAMMING FUNCTION-

[4]

RESULT- Windowing function for implementation of FIR FILTER was verified using
Blackman, Hamming and Kaiser functions.

[5]

You might also like