Лабораторная работа №3.


N=200;

Rp=abs(1/(20*log10(0.01)));

Rs=35;

Ws=[0.05 0.35];

Wp=[0.1 0.3];

[n,Wn]=cheb1ord(Wp,Ws,Rp,Rs);

[b,a]=cheby1(n,Rp,Wn);

[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)+sin(i*pi*0.02);

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 =

1.0e+003 *

Columns 1 through 7

0.0010 -0.0135 0.0884 -0.3728 1.1342 -2.6417 4.8798

Columns 8 through 14

-7.3076 8.9918 -9.1580 7.7384 -5.4124 3.1107 -1.4496

Columns 15 through 19

0.5359 -0.1517 0.0310 -0.0041 0.0003

 

>> b

b =

1.0e-003 *

Columns 1 through 7

0.0008 0 -0.0076 0 0.0304 0 -0.0709

Columns 8 through 14

0 0.1063 0 -0.1063 0 0.0709 0

Columns 15 through 19

-0.0304 0 0.0076 0 -0.0008

 

>> n

n =

9