Sei sulla pagina 1di 10

Bass Filter Design

Fan, Andrew Van Ryan F. Fetalvero, Analyn


ECE/ICE/MexE Department ECE/ICE/MexE Department
College of Engineering Architecture and Fine Arts College of Engineering Architecture and Fine Arts
Batangas State University Batangas State University
Alangilan, Batangas City, Philippines Alangilan, Batangas City, Philippines
Andrew0695@gmail.com Zuluetaanalyn7@gmail.com

Abstract. This paper discuss about finite impulse 3. Frequency sampling method
response filter or also known as FIR Filter. It also
4. Optimal filter design method
focused in bass filter design at 250Hz frequency.
A simple and efficient way to design an FIR filter is
I. INTRODUCTION wind 4. Hamming window ow method. In the
Window Design Method the unit impulse response
A filter is essentially a system or network that of ideal filter is obtained by applying Inverse Fourier
selectively changes the wave shape, amplitude– Transform to the ideal frequency characteristics of
frequency and/or phase-frequency characteristics of digital filter. Then this unit sample response must be
a signal in desired manner. Common filtering truncated at some point, this process is equivalent to
objectives are to improve the quality of a signal, to multiplying it by a finite length window function.
extract information from signal or to separate two or After truncation and windowing, FFT is used to
more signals previously combined. A digital filter is generate the corresponding frequency response of
mathematical algorithm implemented in hardware FIR filter. The frequency response can also be
and/or software that operates on a digital input modified by choosing different window functions.
signal to produce a digital output signal for the
purpose of achieving a filtering objective. Digital Finite Impulse Response digital filter has strictly
filters often operate on digitized analog signals or exact linear phase, relatively easy to design, highly
stable, computationally intensive, less sensitive to
just numbers, representing some variable, stored in
finite word-length effects, arbitrary amplitude-
a computer memory.
frequency characteristic and real-time stable signal
Digital filtering is one of the most powerful tools of processing requirements etc. Thus, it is widely used
DSP. Digital filters are capable of performing that in different digital signal processing applications
specifications which are extremely difficult to
Window technique involves a function called
achieve with an analog implementation. In addition
window function or apodization function which
the characteristics of a digital filter can be easily
changed under software control. Many digital states that if some interval is choosen, it returns with
systems use signal filtering to remove unwanted finite non-zero value inside that interval and zero
noise to provide spectral shaping or to perform value outside that interval. So, if the window with
choosen interval is applied on a IIR system, it will
signal detection or analysis. Two types of filters
obviously return with a finite non-zero value inside
provide these functions are finite impulse response
(FIR) filters and infinite impulse response (IIR) that interval producing a FIR system and all other
filters. In actual procedure for designing digital FIR value that are outside the interval will be zero. So,
filters first the desired filter responses are We can view the finite response inside some
predefined interval
characterized and the filter coefficient methods
values are calculated for a causal FIR filter. There A window is a finite array consisting of coefficients
are different to find the coefficients of digital filter selected to satisfy the desirable requirements. While
from frequency specifications: designing digital FIR filter using window function it
1. Fourier series method is necessary to specify a window function to be used
and the filter order according to the required
2. The window method specifications (selectivity and stop band
attenuation). These two requirements are function is to provide accurate type of responses
interrelated. Each function is a kind of compromise with reduced side lobes and comparatively less pass-
between the two following requirements i.e. the band and stop-band ripples.
higher the selectivity the narrower the transition
region andthe higher suppression of undesirable
spectrum the higher the stop band attenuation. Some
frequently used windows are:- II. RELATED LITERATURE

1. Rectangular window For designing FIR digital filters there are several
windows available. The order of the digital filter
must be kept as small as possible for high speed and
low power digital filters.Several Computer Aided
Design tools are available to make the digital filter
fast and power efficient. Filter design and analysis
2. Triangular window tool (FDA) is also one of the Computer Aided
Design tool available with MATLAB which enables
design of the digital filter blocks faster and more
accurate.
Subhadeep Chakraborty demonstrated a
comparative study between Blackman and hamming
3. Hanning window
window in “Advantages of Blackman Window over
Hamming Window method for designing FIR
filter”. The output response of these two windows
was compared and the results showed that Blackman
window technique is more powerful, perfect and
useful than Hamming window. Throughout the
paper it was also shown that Blackman window has
4. Hamming window more terms compared to the Hamming window.
More term in calculation indicates more accuracy in
result. There are extra cosine terms in Blackman
function. This extra term reduces the side lobes and
hence increases less losing power. For FIR low pass
filter design, there are four side lobes exist in
5. Blackman window Hamming window but for same specification and
filter order, in Blackman window, there exists only
two side lobes. Similar thing found in other filters
(high pass filter, band pass and band stop filter) and
for this reason the result and simulation both are
more accurate in Blackman window.
Alia Ahmed Eleti and Amer R. Zerek put forward a
paper “FIR Digital Filter Design By Using Windows
6. Blackman-Harris window Method With MATLAB”. The work reported in this
paper deals with Finite Impulse Response (FIR)
digital filter designed by using window method.
Also some common windows Triangular,
Hamming, Hanning and Blackaman had also been
discussed and there response was compared by
simulating these in MATLAB software. The results
of this paper shows that window method is simple to
apply and easy to understand.
These are the windows which can be used for
Shalu Pandeyet al.,introduced a paper “FIR filter
designing FIR filters. The main aim of a window
implementation and itsperformance analysis” that
illustrates practical aspects of FIR filter design. This Now, substituting the value of 012 a0 a1 a2 , , into
paper gives a short review of best windowing eqn (1.11), we get the actual equation for the
technique for implementing the FIR filter and also Blackman window sequence i.e.
reviews on how to apply multirate techniques for
constructing digital FIR filter. They discussed the
windowing technique and compared the magnitude
and phase response of Bartlett window, Hamming
window and Kaiser window(Filter order= 20 & fc=
0.6). They also observed that Kaiser window shows
the best possible result than the other windowing
techniques. Process of decimation and interpolation
had also been discussed in this paper to increase or
decrease the sampling frequency. Now, with the FIR filter can be designed with the
In this method we begin with the desired help of these two window technique and this can be
frequency response specification HD(ω ) and best viewed in the magnitude reqsponse plot which
determine the corresponding impulse response hd will be shown latter.
(n). hd (n) is related to HD (ω ) by the inverse Then to realize the FIR filter using the eqn (1.14),
Fourier transform relation, this method usually the Transversal structure or simply the Direct form
called the Fourier series method. structure can be used. So, using the transversal
structure, the eqn(1.14) can be realized as follows

The Blackman window sequence can be defined by:

III. METHODOLOGY
In the GUI we will take the filter button and when
click on the filter sound button than a new window
will open named filter sound. Then choose the
desired filter for denoising and enter its various
The coefficient 012 a0 a1 a2 , , can be defined with parameters namely type, order, pass-band
frequency, stop-band frequency, pass-band ripple
help of the value of  i.e,
and stop band ripple. Then click on ‘okay’ than a
new window filtered sound will open. This window
shows filtered sound along with the graphs and
various details about the filters like Transfer
function, Step impulse and Frequency response.
Generally, the value of  for Blackman window is
IV. FIR DESIGN
static and it is  =0.16. Now, putting the value of 
into 012 a0 a1 a2 , , , we can achieve the actual value Designers used fdatools in MATLAB Software to
of the coeficients for the Blackman window filter the song entitled “it’s a Beautiful Day” ny
sequences and they are, Michael Buble.
[St,Fs,nbits] =
wavread('Michael_Bubble.wav'); % Create the window vector for the
L = size(St,1); design algorithm.
T = 1/Fs; win = blackman(N+1);
t = (0:L-1)*T;
% Input signal chart S(t) to plot the Low pass filter in MATLAB. We used
subplot(2,3,1); command low to filter the bass with frequency of
plot(t,St);grid; 250Hz. The command shows below.
title('Signal S(t)')
xlabel('Time,s') % Calculate the coefficients using
the FIR1 function.
ylabel('Signal amplitude S(t)')
% BASS filter command
b = fir1(N, Fc/(Fs/2), 'low',
In this code, it shows the original song was win, flag);
transferred to a signal. The images shows below [H,w]=freqz(b,1,NFFT);
subplot(2,3,3);
plot(w(1:NFFT)*Fs/(2*pi),abs(H(1:N
FFT)));grid;
% Frequency response of the filter
title('Frequency response')
xlabel('Frequency (Hz)')
ylabel('Response factor')
axis([0 300 0 1.5]);
SL=filter(b,1,St);
sound(SL,Fs)

Fig. 1 signal of original song (It’s a beautiful day)

Fig. 3 signal for low pass Filter

Fig. 2 Signal Spectrum analysis

We choose the Blackman window technique


because it is high …….. with sampling rate of
44.1KHz ad cutoff frequency 250Hz.
% Band filter
Fs = 44100; % Sampling Frequency

N = 700; % Order
Fc = 250; % Cutoff Frequency
flag = 'scale'; % Sampling Flag
Fig. 4 Signal Spectrum analysis
The cutoff frequency of low pass filter shows below

Next is the high pass Filter, the only need to do is


change the command ‘low’ to ‘high’ in MATLAB
because the equation is
𝑺𝑳𝟐 = 𝑺(𝒕) − 𝑺𝑳𝟏

% Calculate the coefficients using


the FIR1 function.
% BASS filter command
%sound without bass
b = fir1(N, Fc/(Fs/2), 'high', Fig. 7 Signal Spectrum analysis
win, flag);
[H,w]=freqz(b,1,NFFT); And lastly the frequency response of high pass Filter
subplot(2,3,3);
plot(w(1:NFFT)*Fs/(2*pi),abs(H(1:N
FFT)));grid;
% Frequency response of the filter
title('Frequency response')
xlabel('Frequency (Hz)')
ylabel('Response factor')
axis([0 300 0 1.5]);
SL=filter(b,1,St);
sound(SL,Fs)

Fig. 5 Frequency response for low pass filter

Fig. 8 Frequency Response


Graphical user Interface
In command window, GUIDE Quick Start
will be opened. Guide is a set of MATLAB tools
designed to make building GUIs easier and faster.
Just as writing math in MATLAB is much like
writing it on paper, building a GUI with Guide is
much like drawing one on paper. As a result, you can
lay out a complex graphical tool in minutes. Once
your buttons and plots are in place, the Guide
Fig. 6 signal for high pass Filter Callback Editor lets you set up the MATLAB code
that gets executed when a particular button is
pressed.
Fig.9 starter
In this section, we suggest a road map for
creating GUIs in MATLAB. Like everything Fig. 11 Original song
associated with design, this really amounts to some
suggestions about how to think, rather than a step-
by-step recipe. It’s helpful to think about the GUI
creation process as breaking into a design phase and
an implementation phase. This concept is illustrated
in the diagram below.

Fig. 12 sound without bass

Conceptual framework for GUI

Fig.13 Bass Only

Fig.10 GUI Design


V. CONCLUSION Electronics and Mechanical Controls, Volume 1
Issue 1 November 2012.
In this project, The main advantage of the window
method is simple to apply and simple to understand. [7] Ravinder Kaur, Ashish Raman, Hardev Singh
An important disadvantages is lack of flexibility and Jagjit Malhotra, “Design and Implementation
because both the peak passband ∂p and stop band ∂ of High Speed IIR and FIR Filter using Pipelining”,
s ripples are approximately equal, so that the International Journal of Computer Theory and
designer cannot make a passband ripple very small Engineering, Vol. 3, No. 2, April 2011,ISSN: 1793-
or a stopband attenuation very large. So, it is clear 8201,pp 292-295.
that Blackman window technique is more powerful [8] Ramesh .R, Nathiya .R, “Realization of fir
and perfect filter in all window technique. filter using modified distributed arithmetic
MATLAB is better software to simulate and design architecture”, Signal & Image Processing : An
diffrerent technique in Finite impulse response Filter International Journal (SIPIJ) Vol.3, No.1, February
design. 2012,pp 83-94.
[9] S. M. Shamsul Alam , Md. Tariq Hasan,
“Performance Analysis of FIR Filter Design by
REFERENCES Using Optimal, Blackman Window and Frequency
[1] Datar A., Jain A.,Sharma, P.C. ,ʻʻPerformance Sampling Methods”, International Journal of
of Blackman window famiy in M-channel cosine Electrical & Computer Sciences IJECS-IJENS Vol:
modulated filter bank for ECG signal”, 10 No: 01, pp13-18.
Multimedia, Signal Processing and Communication [10] Sarita Chouhan, Yogesh Kumar, “Low power
Technologies, 2009. IMPACT '09. International, designing of FIR filters”, International Journal of
IEEE Conference,Aligarh,ISBN: 978-1-4244-3602- Advanced Technology & Engineering Research,
6, pp 98 – 101. ISSN NO: 2250-3536 Volume 2, Issue 2,
[2] Yu-Chi Tsao, Ken Choi,ʻʻ Hardware-Efficient May2012, pp-59-67.
Vlsi Implementation For 3-Parallel Linear-Phase [11] T Ramesh Reddy,Dr. K. Soundara Rajan,
Fir Digital Filter Of Odd Length”, Circuits And “Low Power and Low Area Digital FIR Filter
Systems (Iscas), 2012 Ieee Conference, Isbn:978-1- Using Different Multipliers and Adders”,
4673-0218-0,Pp 998 – 1001. International Journal of Engineering Research &
[3] Soni, V., Shukla P.,Kumar M.,ʻʻApplication Of Technology (IJERT),Vol. 1 Issue 3, May –
Exponential Window To Design A Digital 2012,ISSN: 2278-0181,pp 1-4.
Nonrecursive Fir Filter”, Advanced [12] Magatha Nayak Bhukya, K. Anjaiah, G.
Communication Technology (Icact), 2011 13th Sravya, P. Nagaraju, “The Design of High Speed
International Conference,Ieee,Isbn: 978-1-4244- FIR Filter using Improved DA Algorithm and it’s
8830-8,Pp 1015-1019. FPGA Implementation”, International Journal of
[4] Mehboob, R., Khan, S.A. ; Qamar, R. ,“Fir Engineering Trends and Technology-
Filter Design Methodology For Hardware Volume3Issue2- 2012, pp 123-126.
Optimized Implementation”, Consumer
Electronics, Ieee Transactions,2009, Volume:55 ,
Issue: 3 ,Pp 1669 – 1673.
[5] Sanal, M.,Kuloor, R.,Sagayaraj, M.J.
“Optimized FIR filters for digital pulse
compression of biphase codes with low sidelobes”,
Aerospace Conference, 2013 IEEE,ISBN: 978-1-
4673-1812-9, pp-1-9.
[6] Saurabh Singh Rajput, Dr.S.S. Bhadauria,
“Implementation of fir filter using efficient window
function and its application in filtering a speech
signal”,International Journal of Electrical,

Potrebbero piacerti anche