Professional Documents
Culture Documents
CEP
Submitted By:
Huzaifa Yasir FA19-BEE-112
Supervisor:
“Dr. Muhammad Altaf”
Part 1 CODE:
clc; clear all; close all;
[x,Fs]= audioread('myvoice.wav');
n=length(x);
Y=fft(x,n);
FY=(-n/2:n/2-1).*(Fs/n);
Y1=fftshift(Y); AY=abs(Y1);
plot(FY,AY); xlabel('frequency
(Hz)'); ylabel('amplitude');
Part 1 OUTPUT:
IIR Filters:
As my registration number is 112 so divide by 5 I get remainder 2 and then adding 3 I
got A=5. So I will choose 5 octave bandpass butterworth IIR filters for auido signal
with different frequencies. For this we have to know the centered, upper and lower
frequencies for designing these filters.
Part 2 CODE:
n1=2;
[ya,xa]=butter(n1,[0.1,0.15],'bandpass');
fvtool(ya,xa); y1=filter(ya,xa,x);
[yb,xb]=butter(n1,[0.15,0.25],'bandpass');
fvtool(yb,xb); y2=filter(yb,xb,x);
[yc,xc]=butter(n1,[0.25,0.4],'bandpass');
fvtool(yc,xb); y3=filter(yb,xb,x);
[yd,xd]=butter(n1,[0.4,0.6],'bandpass');
fvtool(yd,xd); y4=filter(yd,xd,x);
[ye,xe]=butter(n1,[0.6,0.85],'bandpass');
fvtool(ye,xe);
y5=filter(ye,xe,x);
Part 2 OUTPUT:
Filter Visualization
1st
octave
band
pass
IIR
Butter
worth
filter
2nd
octave
band
pass
IIR
Butter
worth
filter
3rd
octave
band
pass
IIR
Butter
worth
filter
4th
octave
band
pass
IIR
Butter
worth
filter
5th
octave
band
pass
IIR
Butter
worth
filter