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 50 51 52
| clear all
fid1 = fopen('1.txt', 'r');
x=fscanf(fid1,'%f', [1 Inf]);
N=256;
figure(1)
plot(x)
title('signale originale')
a=2;
for b=0:N-1
for t=1:N
w(t)=(1/sqrt(a)).*exp(-((t-b)./a).^2).*cos(5.*(t-b)/a);
end
figure(6)
plot(w)
g=w.*x;
G(1,b+1)=0;
for i=1:N
G(1,b+1)=G(1,b+1)+g(i);
end
end
figure(2)
plot(G(1,:))
a=4;
for b=0:N-1
for t=1:N
w(t)=(1/sqrt(a)).*exp(-((t-b)./a).^2).*cos(5.*(t-b)/a);
end
figure(6)
plot(w)
g=w.*G(1);
G(2,b+1)=0;
for i=1:N
G(2,b+1)=G(2,b+1)+g(i);
end
end
figure(3)
plot(G(2,:))
a=8;
for b=0:N-1
for t=1:N
w(t)=(1/sqrt(a)).*exp(-((t-b)./a).^2).*cos(5.*(t-b)/a);
end
figure(6)
plot(w)
g=w.*G(2);
G(3,b+1)=0;
for i=1:N
G(3,b+1)=G(3,b+1)+g(i);
end
end
figure(4)
plot(G(3,:)) |
Partager