M. ENG.
IN ELECTRONICS ENGINEERING
SEMESTER 1
ADVANCED DIGITAL SIGNAL PROCESSING
Filter Bank Based Short-time Spectral Analyser.
Project Team Members:
Aoife Byrne
Joel George Mathew
Philip Creevy
Supervisor
Mohamed Medjaou
REPORT-2
(Team members’ current project status and future plan.)
AIM:
To ascertain the current status of all team members, with a view to smooth
progression of the project.
MEMBERS PRESENT
October 15th 2010 (Wednesday) at 11AM in AG06
Aoife Byrne, Joel George Mathew, Philip Creevy.
Basic matlab codes for developing the application are being
investigated with a view to improving efficiency once the basic code
is complete.
Philip
Write a program to implement the short-time spectrum analyser given in figure 1 of
project specification.
To apply each speech signal at the input and plot output every 16ms.
for m=1:19
for n=1:1000,
y(m,n)= -b1(m)*y(m,n-1)-b2(m)*y(m,n-2) + a0(m)*x(m,n)- a1(m)*x(m,n-1);
if y(m,n)<0 % code written to half-wave rectify output from BPF
y(m,n)=0;
end
end
end
for m=1:19%****** The varible "m" and "n" might need to be renamed.*****%
for n=1:1000,
z(m,n)= LPF_a0*z(m,n-1)+y(m,n);
end
g(m) = cumtrapz(n,z(m)); %DB of intrgral over 16mS
g_dB(m) = 20*log(g(m,1000)); % input sample is 16ms long
plot(m,g_dB(m)) % last element has total integral
end
While Aoife is finalising the sine wave code I will be researching the
“cumtrapz” function to make sure it is correct.
The code will need to be modified to allow an audio file to be
processed
as it will only run for 16mS.
Matlab code written by Philip.
Aoife
To write and submit a report including all relevant material specified.
Final Report Plan
A final report template is shown below; it includes but is not limited
to.
Header Page
• Title
• Subject
• Team Members
• Date
• Wit crest
• Lecturer
Overview
Table of Contents
Table of figures
Introduction
• Project requirements as laid out in specification sheet.
Discussion
• Break project into parts and discuss each part individually
• Speech signal generation
• Sinusoid signal generation
• BPF bank
• Rectifier
• LPF bank
• Integrator
Method
• Discuss how the parts of the project were allocated to each
team member
• Explain how each section is implemented and then how it is
incorporated into the main project
• Include Matlab plots and code
Results
• Bode plots
• Graphs
• Debugging methods
• Code changes
• Personal statements of work by each student
Conclusion
• Difficulties encountered
• Recommendations made in hindsight on the running of the
project
• How robust the code was found to be
Reference
Appendix
Aoife
To apply a sum of six sinusoids to the input of the filter bank and plot the output.
• The sum of six sinusoids must be 1000 samples long
• All 6 sinusoids must be within the frequency range 200Hz and
4000Hz.
• The sampling frequency Fs is 8000, therefore we must have a
signal of frequency 16000 or greater.
Investigation into sinusoid generation must comply with the above
pre-requisites for the project. Sinusoid generation investigation is
continuing with a view to creating sinusoids which can be varied on
several parameters, to give a robust code, which will hopefully help
in debugging the project if the need arises.
As well as defining an answer for the sum of sinusoids, I am
investigating changing different parameters in the code shown
below. These observations, once completed, will be submitted as
part of the individual report during week 10.
The Matlab code shown here is indicative of changing parameters in
order to record changes in sinusoids created.
t = 0:12.5:1250; %time
A = 1; %amplitude
n = 600; %frequency variable
F = 16000;
Fs = 8000; %sampling frequency, time 12.5ms
x1 = A*sin(2*pi*F*t); %changing parameters in order to make observations.
%plot(t,x1);
hold on;
x2 = A*sin(t*2*n);
%plot(t,x2);
hold on;
x3 = A*sin(t*3*n);
%plot(t,x3);
hold on;
x4 = A*sin(t*4*n);
%plot(t,x4);
hold on;
x5 = A*sin(t*5*n);
%plot(t,x5);
hold on;
x6 = A*sin(t*6*n);
%plot(t,x6);
hold on;
Joel
y = x1 + x2 + x3 + x4 + x5 + x6;
%plot(t,y);
%hold on;
Write a program to calculate the digital filter coefficients of each band pass filter
given the information given in the specification sheet.
Calculate the filter coefficients of the low pass filter.
Calculating the Band Pass Filter (BPF) coefficients.
The second order analogue band pass filter transfer function is
given by,
The Matlab code for calculating the BPF coefficients s shown below:
Fs=8000;
T=1/Fs;
DELTAp = [240 360 480 600 720 840 1000 1150 1300 1450 1600 1800 2000 2200
2400 2700 3000 3300 3750];
bp=[120 120 120 120 120 150 150 150 150 150 150 200 200 200 200 200 300 300
500];
for i=1:19,
a0(i)=(2*(bp(i))*T)/((4+(2*(bp(i)*T))+(DELTAp(i)).^2*T.^2));
a1(i)=a0(i);
b1(i)=(2*(DELTAp(i)).^2*T.^2-8)/((4+(2*(bp(i)*T))+DELTAp(i).^2*T.^2));
b2(i)=((4-(2*(bp(i)*T))+(DELTAp(i)).^2*T.^2))/((4+(2*(bp(i)*T))+
Input-Output Equation
(DELTAp(i)).^2*T.^2));
end
From the above transfer function, it is clear that,
i.e,
In discrete time domain,
Therefore,
The above equation is the output from the BPF. Its Matlab code is
written as shown below,
for m=1:19
for n=1:1000
y(m,n)= -b1(m)*y(m,n-1)-b2(m)*y(m,n-2) +
a0(m)*x(m,n)- a1(m)*x(m,n-1);
if y(m,n)<0
y(m,n)=0;
end
end
end
(NOTE: - All codes in red is written by Joel)
Calculating the Low Pass Filter (LPF) coefficients.
The Matlab code for calculating the LPF coefficients s shown
below:
fc=30;%-------------------------------->Cut off frequency of the low
pass filter.
%Fs=8000 ;%-------------------------->Speech signal frequency.
%T=1/Fs ;%--------------------------->Speech signal sampling period.
DELTAc=2*pi*fc;
Wc=DELTAc*T;
LPF_a0= (2-cos (Wc))-sqrt ((2-cos (Wc)). ^2-1);
Input-Output Equation
From the above transfer function,
i.e,
In discrete time domain,
NOTE: Changed y(n), y(n-1) and x(n)to z(n), z(n-1) and y(n) respectively to avoid
confusion with the variables used in the above code.
The Matlab code for the above input-output relation is as shown below,
for m=1:19%****** The varible "m" and "n" might need to be renamed.*****%
for n=1:1000,
z(m,n)= LPF_a0*z(m,n-1)+y(m,n);
end
g(m)=trapz(n,z(m));
g_db(m) =20*log(g(m));
end
NOTE: The codes in red are written by Joel.