Sunteți pe pagina 1din 5

ECC313 T42

SIGNALS, SPECTRA AND SIGNAL PROCESSING LABORATORY

Tuesday, 10:00am - 12:50pm

Digital Signal Processing Application

Submitted by: Submitted to:

Alzaga, Mark Eullysis D. Ronald M. Pascual, Ph. D.

Custodio, Bryan C.

Deximo, Melvin Lance L.

Date Submitted:

October 6, 2015

Equalizer using 7 Bandpass Filters


Abstract:

Equalization is the adjustment of signal strength for a certain portion of

audio frequencies whether to increase it or decrease it. The audio or the

sound made by voices or instruments is composed of energy at different

frequencies. Equalization is commonly used in in the application of

electronics and telecommunications. It is the process of altering the

frequency response of an audio system using linear filters. With the aid of an

equalizer, we can easily adjust the bass, treble, boost, cut, clarity of voice,

reduce unwanted noise, or adjust the sound of instruments. For this project,

the group will create an equalizer comprising of 7 bandpass filters. The main

purpose of the equalizer is to acquire the desired change of tone value of a

certain sound. The filter to be used is a bandpass filter since the downloaded

sound may be composed of combination of high and low frequencies. This

filter will allow the band of frequencies between the low and high cutoff

points to pass. The frequencies to be used are: 60-200 Hz (Bass), 200-800 Hz

(Upper base to lower midrange), 800-2000 Hz (Midrange), 2-4 kHz

(Uppermids), 4-7 kHz (Presence or Sibilance register), 7-12 kHz (Brilliance or

Sparkle register), and 12-16 kHz (Open air). The frequencies chosen have

different effects in the audio.

Methods:

1) Specification of filter requirements

- The equalizer requires at least 7 bandpass filters. The frequencies of

each filter ranges from 60-200 Hz 200-800 Hz, 800-2000 Hz, 2-4
kHz, 4-7 kHz, 7-12 kHz, and 12-16 kHz. The digital filter used is

Finite Impulse Response (FIR) because it is easier to implement and

the filter does not require sharp cut-offs.

2) Calculation of filter coefficients

- To satisfy the given requirements, a window function that gradually

decays to zero is multiplied to the ideal impulse response. The

window function that is used is the Hamming window because it is

the default window function when fir1 is used. After the

identification of the window function, the number of coefficients is

calculated next. It is given by the formula shown below:

6.6
L=
w

Where L is the number of coefficients and w is the transition

band.

After computing the number of coefficients, the order of the filter is

to be calculated afterwards. It is acquired by just subtracting 1 to

the number of coefficients. Since the order of the filter and the

bandwidth is already known, the filter coefficients can now be

calculated using the built-in functionfir1.

3) Software Implementation

- The software implementation is done through the aid of

MATLAB2015a having the input as an 30 seconds audio where the

codes are given below:


function[]=filtmodel(g1,g2,g3,g4,g5,g6,g7)
[y,Fs]=audioread('Eully.wav'); %input signal
f=[130,500,1400,3000,5500,9500,14000]; %center frequencies of each
filter
bw=[140,600,1200,2000,3000,5000,4000]; %bandwidth of each filter
for a=1:7
L(a)=round(3.3*Fs/(bw(a)/3)); %computation of number of
coefficients of each filter
if mod(L(a),2)==0 %checking if number of
coefficients is even
L(a)=L(a)+1; %change the number of
coefficients to odd number
end
M(a)=L(a)-1; %computation of order of each
filter
end

%calculating the filter coefficients of each filter


h1=fir1(M(1),[(f(1)-bw(1)/2),(f(1)+bw(1)/2)]/Fs*2);
h2=fir1(M(2),[(f(2)-bw(2)/2),(f(2)+bw(2)/2)]/Fs*2);
h3=fir1(M(3),[(f(3)-bw(3)/2),(f(3)+bw(3)/2)]/Fs*2);
h4=fir1(M(4),[(f(4)-bw(4)/2),(f(4)+bw(4)/2)]/Fs*2);
h5=fir1(M(5),[(f(5)-bw(5)/2),(f(5)+bw(5)/2)]/Fs*2);
h6=fir1(M(6),[(f(6)-bw(6)/2),(f(6)+bw(6)/2)]/Fs*2);
h7=fir1(M(7),[(f(7)-bw(7)/2),(f(7)+bw(7)/2)]/Fs*2);

%acquiring the length of the longest vector


n1=length(h1);
n2=length(h2);
n3=length(h3);
n4=length(h4);
n5=length(h5);
n6=length(h6);
n7=length(h7);
n=[n1,n2,n3,n4,n5,n6,n7];
p=max(n);

%zero padding to make the filter coefficients equal in length


h1=[zeros(1,floor((p-n1)/2)),h1,zeros(1,ceil((p-n1)/2))];
h2=[zeros(1,floor((p-n2)/2)),h2,zeros(1,ceil((p-n2)/2))];
h3=[zeros(1,floor((p-n3)/2)),h3,zeros(1,ceil((p-n3)/2))];
h4=[zeros(1,floor((p-n4)/2)),h4,zeros(1,ceil((p-n4)/2))];
h5=[zeros(1,floor((p-n5)/2)),h5,zeros(1,ceil((p-n5)/2))];
h6=[zeros(1,floor((p-n6)/2)),h6,zeros(1,ceil((p-n6)/2))];
h7=[zeros(1,floor((p-n7)/2)),h7,zeros(1,ceil((p-n7)/2))];
h=(g1*h1)+(g2*h2)+(g3*h3)+(g4*h4)+(g5*h5)+(g6*h6)+(g7*h7);
Y=((y(:,1)+y(:,2))/2)'; %conversion of stereo to mono
newy=conv(h,Y); %filtering the input audio
sound(newy,Fs); %playing the filtered audio
end

Conclusion:
After performing the methods above, the group concluded that an
application of Digital Signal Processing specifically an equalizer can be
implemented with the aid of MATLAB R2015a.

S-ar putea să vă placă și