Académique Documents
Professionnel Documents
Culture Documents
LAB
2ATEL1
OBJECT:
ENIT 2013_2014
We will use some digital filtering commands with matlab such filter ,
impz ..
To study some signals .
Question 1 :
The order of the filter is 7.
Question 2 :
f0=500;fe=6000;
n=0:1/fe:0.02;
xn=cos(2*pi*f0.*n);
figure(1),plot(n,xn),legend('the input signal')
Question 3 :
xn=cos(2*pi*f0.*n);
b=[ 0.692, -1.762, 3.545, -3.925, 3.545, -1.762,
0.692];
a=[1, -2.238, 3.921, -3.844, 3.075, -1.367, 0.478];
y1=filter(b,a,xn);
figure(3), plot(n,y1)
The Representation :
When compared the two signal obtained on question (3) (in red)
and on question (4) ; we conclude that both methods resulted in
the same shape of the signal.
Question 5 :
the impulse response of the filter by using matlab s impz function .
The matlab code :
h=impz(b,a,120);
figure(22), plot(h), legend('the impulse response of
filter');
the representation :
CCLDE.
Question 8 :
The matlab code :
h=impz(b,a,120);
h1=impz(b,a,50);
h2=impz(b,a,32);
figure(33),
subplot(3,1,1);plot(h),legend('with 120 points');
subplot(3,1,2);plot(h1),legend('with 50 points');
subplot(3,1,3);plot(h2),legend('with 32 points');
QUESTION 9:
THE MATLAB CODE
s=conv(h1,xn);
s1=conv(h2,xn);
figure(4),plot(s),hold on,plot(s1,'r')
,legend('output of filter 1','output of filter2');
THE REPRESENTATION :
the output obtained in this question wich we use the matlab function
conv is similair to the outputs obtained in q4 and q3.
There are the same type of signal ; periodic signal, same amplitude
QUESTION 10:
THE MATLAB CODE :
n=[1:120];
T=1/fe;
fe=6000;
x=cos(2*pi*500*T*n)+cos(2*pi*1200*T*n);
y2=filter(b,a,x);
figure(6),plot (y2,'r'),hold
on,plot(y1),legend('filtred signal','original
signal');
THE REPRESENTATION
It was a periodic signal with the same characteristics of the signal with a
single sinusoid.
QUESTION 11:
THE MATLAB CODE
[H,f]=freqz(b,a,120,fe);
[H1,f]=freqz(b,a,50,fe);
[H2,f]=freqz(b,a,32,fe);
figure(7),subplot(3,1,1);stem(H);
subplot(3,1,2);stem(H1);
subplot(3,1,3);stem(H2);
THE REPRESENTATION :
QUESTION 13:
THE MATLAB CODE :
path='C:\Users\user\Desktop\'
nom='Ann_Simone.wav';
fe=6000;
[G,fe]=wavread([path nom]);
sound(G);
Gs=filter(b,a,G);
sound(Gs);
the representation :
10
11
12