Лабораторная работа №4.
N=200;
Rp=abs(1/(20*log10(0.01)));
Rs=35;
Wp=[0.35 0.4];
Ws=[0.33 0.42];
[n,Wn]=cheb1ord(Wp,Ws,Rp,Rs);
[b,a]=cheby1(n,Rp,Wn,'stop');
[k,na]=size(a);
[k,nb]=size(b);
x=zeros(1,N);
y=zeros(1,N);
for i=1:N
x(i)=sin(i*pi*0.2)+sin(i*pi*0.4);
end
y=filter(b,a,x);
x1=zeros(1,N);
y1=zeros(1,N);
for i=N/2:N
x1(i)=1;
end
y1=filter(b,a,x1);
x2=zeros(1,N);
y2=zeros(1,N);
x2(N/2)=1;
y2=filter(b,a,x2);
[H,w]=freqz(b,a,N,2);
subplot(4,1,1),plot(x),grid
title('Входной сигнал')
subplot(4,1,3),plot(y),grid
title('Filtered Signal')
subplot(4,1,2),plot(w,abs(H)),grid
title('Filter AFC')
pause
subplot(4,1,1),plot(x1),grid
title('juytjuytujyt')
subplot(4,1,2),plot(y1),grid
title('Filtered')
subplot(4,1,3),plot(x2),grid
title('dfhdfhsdfgh')
subplot(4,1,4),plot(y2),grid
title('Filtered')
>> a
a =
Columns 1 through 7
1.0000 -5.0720 17.2441 -40.3768 75.3242 -111.9258 139.0281
Columns 8 through 14
-142.8647 124.2013 -89.3226 53.6971 -25.7088 9.8060 -2.5754
Column 15
0.4535
>> b
b =
Columns 1 through 7
0.6740 -3.6224 13.0613 -32.4097 64.0660 -100.8127 132.5758
Columns 8 through 14
-144.1567 132.5758 -100.8127 64.0660 -32.4097 13.0613 -3.6224
Column 15
0.6740
>> n
n =
7