1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
n1=50000;
[y,fs]=wavread('Bureau/z.wav',n1);
t=(1:fs)/fs;
rs=y(1,:);
set("current_figure",1)
plot2d(rs)
Ny =1323;// length(rs);
tf2=fft(rs,-1);
w2=(0:Ny-1)/Ny*fs;
set("current_figure",2)
plot(w2,abs(tf2(1:Ny)));
plot([0 2500 2500 40000 40000 45000],[200 200 400 400 200 200],'color','r')
xgrid()
function s=seuil1(n,N)
plage=[200 0;400 2500;200 40000];
if n>=plage(1,2)
s=plage(1,1);
end
if n>=plage(2,2)
s=plage(2,1);
end
if n>=plage(3,2);
s=plage(3,1);
end
endfunction
function v=heavi(x)
if x<=0
v=0;
else
v=1;
end
endfunction
Nz=45000;
for i=1:Nz;
g(i)=tf2(i)*heavi(abs(tf2(i))-seuil1(i,Nz));
end
set("current_figure",3)
i=1:Nz;
plot(i,g(i));
xgrid()
//Calcul des signaux par transformé inverse
s=ifft(g);
set("current_figure",4)
plot(t,s); |
Partager