Nothing Special   »   [go: up one dir, main page]

Academia.eduAcademia.edu

Designing a Low- Pass Fir Digital Filter by Using Hamming Window and Blackman Window Technique

In this paper is simulated the time- domain unit sample response of sine function and frequency- domain response of sine function. Digital filter plays an important role in today’s world of communication and computation. Without digital filter we cannot think about proper communication because noise occurs in channel. For removing noise or cancellation of noise we use various type of digital filter. In signal processing, there are mainly two types of filters exist .they are the Finite Impulse Response (FIR) filter and Infinite Impulse Response (IIR) filter. Finite Impulse Response (FIR) filter can be designed form Infinite Impulse Response (IIR) filter by various techniques. The widely used technique is the window technique. This paper low-pass FIR filter is implemented using an efficient adjustable window function based on Hamming window and Blackman window function. The output of the FIR design by Blackman window and the Blackman window are shown in this paper by simulating the code in Matlab. The Matlab program returns with a satisfactory result with proper magnitude plotting.

Science Journal of Circuits, Systems and Signal Processing 2015; 4(2): 9-13 Published online June 2, 2015 (http://www.sciencepublishinggroup.com/j/cssp) doi: 10.11648/j.cssp.20150402.11 ISSN: 2326-9065 (Print); ISSN: 2326-9073 (Online) Designing a Low- Pass Fir Digital Filter by Using Hamming Window and Blackman Window Technique Mohammed Mynuddin1, Md. Tanjimuddin2, Md. Masud Rana3, Abdullah4 1 Dept of EEE, Atish Dipankar University of Science and Technology, Dhaka, Bangladesh Dept. of EEE, Leading University, Sylhet, Bangladesh 3 Dept. of EEE, World University of Bangladesh, Dhaka, Bangladesh 4 (O& M Elect.) Dutch Bangla Power & Associate Limited (DBPL), Orion Group, Dhaka, Bangladesh 2 Email address: myn101eee@gmail.com (M. Mynuddin), tanjim0023@gmail.com (M. Tanjimuddin), ranaemon21@yahoo.com (M. M. Rana), abdullaeee06@gmail.com (Abdullah) To cite this article: Mohammed Mynuddin, Md. Tanjimuddin, Md. Masud Rana, Abdullah. Designing a Low- Pass Fir Digital Filter by Using Hamming Window and Blackman Window Technique. Science Journal of Circuits, Systems and Signal Processing. Vol. 4, No. 2, 2015, pp. 9-13. doi: 10.11648/j.cssp.20150402.11 Abstract: In this paper is simulated the time- domain unit sample response of sine function and frequency- domain response of sine function. Digital filter plays an important role in today’s world of communication and computation. Without digital filter we cannot think about proper communication because noise occurs in channel. For removing noise or cancellation of noise we use various type of digital filter. In signal processing, there are mainly two types of filters exist .they are the Finite Impulse Response (FIR) filter and Infinite Impulse Response (IIR) filter. Finite Impulse Response (FIR) filter can be designed form Infinite Impulse Response (IIR) filter by various techniques. The widely used technique is the window technique. This paper low-pass FIR filter is implemented using an efficient adjustable window function based on Hamming window and Blackman window function. The output of the FIR design by Blackman window and the Blackman window are shown in this paper by simulating the code in Matlab. The Matlab program returns with a satisfactory result with proper magnitude plotting. Keywords: Hamming Window, Blackman Window, Fir Filters, Low-Pass Filter, Unit Sample Response, Frequency Response Time domain sequence of the Blackman window [10]-[15] 1. Introduction is Finite-duration Impulse Response (FIR) [1]-[9]filter are most popular type of filters implementation in software. This introduction will help understand both theoretical and practical level. For finite-duration impulse response (FIR) digital filter, the operation is governed by linear constantcoefficient difference equations of a non-recursive nature. A Finite-duration Impulse Response (FIR) filter is a filter structure that can be used to implement almost any sort of frequency response digitally. An FIR filter is usually implemented by using a series of delay, multipliers and adder to create the filter’s output. The transfer function of FIR digital filter is a polynomial in Time domain sequence of the Hamming window [10]-[15] is 0.54 − 0.46 cos (i) 0.42 − 0.5 cos + 0.08 cos (ii) FIR filter of length M having the impulse response is ! ℎ " ! = (iii) " A digital filter takes a digital input gives a digital output and consist of digital components. In typical digital filtering application software running on a DSP reads input sample from an A/D converter [16], performs the mathematical manipulations by theory for the required filter type, and output the result via D/A converter [17]. A digital filter is a filter that works by performing digital mathematical operations on an intermediate form of a signal. Mohammed Mynuddin et al.: Designing a Low- Pass Fir Digital Filter by Using Hamming Window and Blackman Window Technique 3. Frequency Response Frequency response [19] is the quantitative measure of the output spectrum of a system or device in response to a stimulus, and is used to characterize the dynamics of the system. It is a measure of magnitude and phase of the output as a function of frequency, in comparison to the input. In simplest terms, if a sine wave is injected into a system at a given frequency, a linear system will respond at that same frequency with a certain magnitude and a certain phase angle relative to the input. Also for a linear system, doubling the amplitude of the input will be double the amplitude of the output. In addition, if the system is time-invariant, then the frequency response also will not vary with time. MATLAB Commands for Hamming Window coding: m=80; % The length of the Karnel% n=0:1:m-1; %Defines Range of position value% p=n-(m-1)/2; %Angle% fc=0.1; %Define Cutoff frequency% Z=sin(2*pi*fc*p)./(pi*p); %Define truncated Sinc function% stem(n,Z);grid %To represent the discrete signal value & draw the grid lines% title('Unit Sample Response of the sin function') %Define the title of the figure% xlabel('n') %Define the label of on x axis% ylabel('Z') %Define the label of on y axis% figure; %To draw a figure% [h,w]=freqz(Z); %get Frequency Response% plot(w/pi,abs(h));grid title('Frequency response of the sin function') xlabel('Frequency') ylabel('Amplitude') figure; s=2*pi*(n/(m-1)); %Angle% w=0.54-0.46*cos(s); %Define Hamming window function% stem(n,w);grid title('Hamming Window') xlabel('n') ylabel('w') figure; t=Z.*w; %Multiplication of Hamming Window and sin function% stem(n,t);grid Unit Sample Response of the sin function 0.2 0.15 0.1 Z In signal processing, the impulse response [18], or impulse response function (IRF), of a dynamic system is its output when presented with a brief input signal, called an impulse. More generally, an impulse response refers to the reaction of any dynamic system in response to some external change. In both cases, the impulse response describes the reaction of the system as a function of time (or possibly as a function of some other independent variable that parameterizes the dynamic behavior of the system). title('Multiplication of Hamming Window and sin function') xlabel('n') ylabel('t') figure; [h,w]=freqz(t); plot(w/pi,abs(h));grid xlabel('Frequency') ylabel('Magnitude') title('Frequency response of the windowed sin function') figure;grid freqz(t) title('Frequency Response of the windowed sin function in dB') Simulated Results of Hamming window 0.05 0 -0.05 0 10 20 30 40 n 50 60 70 80 Fig. 1a. Unit Sample Response of the sin function. Frequency response of the sin function 1.4 1.2 1 Amplitude 2. Impulse Response 0.8 0.6 0.4 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 Frequency 0.7 0.8 0.9 1 Fig. 2a. Frequency response of the sin function. Hamming Window 1 0.9 0.8 0.7 0.6 w 10 0.5 0.4 0.3 0.2 0.1 0 0 10 20 30 40 n 50 Fig. 3a. Hamming Window. 60 70 80 Science Journal of Circuits, Systems and Signal Processing 2015; 4(2): 9-13 Multiplication of Hamming Window and sin function 0.2 0.15 t 0.1 0.05 0 -0.05 0 10 20 30 40 n 50 60 70 80 Fig. 4a. Multiplication of Hamming Window and sin function. Frequency response of the windman sin function 1.4 1.2 Magnitude 1 0.8 0.6 0.4 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 Frequency 0.7 0.8 0.9 1 Fig. 5a. Frequency response of the windowed sin function. Frequency Response of the windowed sin function in dB Magnitude (dB) 50 0 11 plot(w/pi,abs(h));grid %Plot figure & draw the grid lines% title('Frequency response of the sin function') xlabel('Frequency') ylabel('Amplitude') figure; s=2*pi*(n/(m-1));%Angle% w=0.42-0.5*cos(s)+.08*cos(2*s); %Define Blackman window function% stem(n,w);grid title('Blackman Window') xlabel('n') ylabel('w') figure; t=Z.*w; %Mulplying truncated Sinc function by Blackman window% stem(n,t);grid title('Multiplication of Blackman Window and sin function') xlabel('n') ylabel('t') figure; [h,w]=freqz(t); plot(w/pi,abs(h));grid title('frequency response of the windowed sin function') xlabel('frequency') ylabel('Magnitude') figure; freqz(t) title('frequency Response of the windowed sin function in dB') Simulated Results of Blackman Window -50 Unit Sample Response of the sin function 0.2 -100 -150 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Normalized Frequency (×π rad/sample) 0.9 1 0.15 -500 0.1 -1000 Z Phase (degrees) 0 -1500 -2000 0.05 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Normalized Frequency (×π rad/sample) 0.9 1 0 Fig. 6a. Frequency Response of the windowed sin function in dB. -0.05 0 10 20 30 40 n 50 60 70 80 Fig. 1b. Unit Sample Response of the sin function. Frequency response of the sin function 1.4 1.2 1 Amplitude MATLAB Commands for Blackman Window coding: m=80; % The length of the Karnel% n=0:1:m-1; %Defines Range of position value% p=n-(m-1)/2; %Angle% fc=0.1; %Define Cutoff frequency% Z=sin(2*pi*fc*p)./(pi*p); %Define truncated Sinc function% stem(n,Z);grid %To represent the discrete signal value & draw the grid lines% title('Unit Sample Response of the sin function') %Define the title of the figure% xlabel('n') %Define the label of on x% axis% ylabel('Z') %Define the label of on y% axis% figure; %To draw a figure% [h,w]=freqz(Z); %get Frequency Response% 0.8 0.6 0.4 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 Frequency 0.7 0.8 0.9 Fig. 2b. Frequency response of the sin function. 1 12 Mohammed Mynuddin et al.: Designing a Low- Pass Fir Digital Filter by Using Hamming Window and Blackman Window Technique 4. Conclusion Blackman Window 1 0.9 To create a Finite-duration Impulse Response (FIR), truncate it by applying window. Digital filter Finite-duration Impulse Response has greater response compared to other impulse response filter. Because FIR filter have following primary: i) They can exactly linear phase. ii) There are always stable. iii) The design method is generally linear. iv) They can realize efficiently in hardware and v) The filter startup transients have finite duration. Comparatively, the Blackman has better stop-band attenuation than that of Hamming but unfortunately Blackman has slower (about 20%) roll-off than that of Hamming. The Blackman should be our first choice; a slow roll- off is easier to handle than poor stop-band attenuation. A low pass filter allows only low frequency signal through its output so it can be used to eliminate high frequency. 0.8 0.7 0.6 w 0.5 0.4 0.3 0.2 0.1 0 0 10 20 30 40 n 50 60 70 80 Fig. 3b. Blackman window. Multiplication of Blackman Window and sin function 0.2 0.15 References t 0.1 [1] http://www.mikroe.com/chapters/view/72/chapter-2fir-filters/ [2] Vinay K. Lngle, John G. Proakis, Digital Signal Processing using MATLAB. [3] John G. Proakis, Dimitris G. Manolakis, Digital Signal Processing: Principles’, Algorithms, and Applications,4th edition. [4] http://www.mathworks.com/help/dsp/examples/designinglow-pass-fir-filters.html [5] https://ccrma.stanford.edu/~jos/fp/Simplest_Lowpass_Filter.ht ml 1 [6] http://www.arc.id.au/FilterDesign.html 0.8 [7] http://www.wavemetrics.com/products/igorpro/dataanalysis/si gnalprocessing/digitalfilters.htm [8] Mahrokh G. Shayesteh and Mahdi Mottaghi-Kashtiban “FIR filter design using a new window function” 978-1-4244-32981/09,2009 IEEE. [9] Chonghua Li, “Design and Realization of FIR Digital Filters Based on MATLAB” ,IEEE 2010. 0.05 0 -0.05 0 10 20 30 40 n 50 60 70 80 Fig. 4b. Multiplication of Blackman Window and sin function. frequency response of the windowed sin function 1.4 Magnitude 1.2 0.6 0.4 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 frequency 0.7 0.8 0.9 1 Fig. 5b. Frequency response of the windowed sin function. [10] http://www.labbookpages.co.uk/audio/firWindowing.html [11] http://www.mathworks.com/help/signal/ug/windows.html frequency Response of the windowed sin function in dB Magnitude (dB) 100 [12] Window Function, Wikipedia, the free encyclopedia 2012 0 [13] http://en.wikipedia.org/wiki/Window_Function. -100 -200 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Normalized Frequency (×π rad/sample) 0.9 1 Phase (degrees) 0 -1000 -2000 -3000 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Normalized Frequency (×π rad/sample) 0.9 1 Fig. 6b. Frequency Response of the windowed sin function in dB. [14] Roy, T.K.; Morshed, M., "Performance analysis of low pass FIR filters design using Kaiser, Gaussian and Tukey window function methods," Advances in Electrical Engineering (ICAEE), 2013 International Conference on , vol., no., pp.1,6, 19-21 Dec. 2013 [15] Sonika Gupta, AmanPanghal Performance, “Performance Analysis of FIR Filter Design by Using Rectangular, Hanning and Hamming Windows Methods”, International Journal of Advanced Research in Computer Science and Software Engineering Volume 2, Issue 6, June 2012. Science Journal of Circuits, Systems and Signal Processing 2015; 4(2): 9-13 [16] http://en.wikipedia.org/wiki/Analog-todigital_converter#ADC_types 13 [18] http://en.wikipedia.org/wiki/Impulse_response [19] http://en.wikipedia.org/wiki/Frequency_response [17] http://en.wikipedia.org/wiki/Digital-toanalog_converter#DAC_types Biography Mohammed Mynuddin has received his B.Sc. degree with Engineering in Electrical and Electronic Engineering (EEE) from Chittagong University of Engineering & Technology (CUET), Chittagong-4349, and Bangladesh, in 2011. Currently he is a Lecturer dept. of EEE at Atish Dipankar University of Science and Technology, Dhaka, Bangladesh .He is a member of the Institution of Engineers, Bangladesh (IEB) His membership ID is M-32776. His current research interest is in the area of OFDM, Cognitive Radio, Wireless Communication, Digital Signal Processing, Industrial Automation, Power System Analysis and Electrical Machine, Renewable Energy. Md. Tanjinuddin has received his B.Sc. degree with Engineering in Electrical and Electronic Engineering (EEE) from Chittagong University of Engineering & Technology (CUET), Chittagong-4349, and Bangladesh, in 2011. Currently he is a Senior Lecturer dept. of EEE at Leading University, Sylhet, Bangladesh. His current research interest is in the area of Wireless Communication, Digital Signal Processing, Smart Grid Systems, Power System Analysis and Electrical Machine. Md. Masud Rana has received his B.Sc. degree with Engineering in Electrical and Electronic Engineering (EEE) from Chittagong University of Engineering & Technology (CUET), Chittagong-4349, and Bangladesh, in 2011. Currently he is a Lecturer dept. of EEE at World University of Bangladesh, Dhaka, Bangladesh. His current research interest is in the area of Wireless Communication, Digital Signal Processing and Power System. Abdullah has received his B.Sc. degree with Engineering in Electrical and Electronic Engineering (EEE) from Chittagong University of Engineering & Technology (CUET), Chittagong-4349, and Bangladesh, in 2011. Currently he is an Assistant Engr. (O& M Elect.) Dutch Bangla Power & Associate Limited (DBPL), Orion Group, Dhaka, Bangladesh. He is a member of the Institution of Engineers; Bangladesh (IEB) His membership ID is M-33485. His current research interest is in the area of Industrial Automation, Wireless Communication, Digital Signal Processing, Power System Analysis and Electrical Machine, Electric Power Generation.