Анализ и синтез электрических фильтров — страница 5

  • Просмотров 1189
  • Скачиваний 22
  • Размер файла 294
    Кб

7.0. Листинг программы: %T=80мс w=78,5398 %график h(t) fplot(@h,[0 T]) grid on box off figure %график Fi(t) fplot(@fi,[0 T]) grid on box off figure %ост графики w=2*pi/0.08; s=1; T_=0; T=0.080; for t=0:0.0001:0.08 Uf(s)=A(1)/2; Uv(s)=Uf(s)*Kjw(0); Uout(s)=A(1)/2; T_(s)=t*1000; for i=1:20 Uf(s)=Uf(s)+A(i+1).*cos(i*w*t)+B(i).*sin(i*w*t); Uv(s)=Uv(s)+A(i+1)*abs(Kjw(i*w))*cos(i*w*t+arg(Kjw(i*w)))+... B(i)*abs(Kjw(i*w))*sin(i*w*t+arg(Kjw(i*w))); gin(i,s)=A(i+1).*cos(i*w*t)+B(i).*sin(i*w*t); gout(i,s)=A(i+1)*abs(Kjw(i*w))*cos(i*w*t+arg(Kjw(i*w)))+... B(i)*abs(Kjw(i*w))*sin(i*w*t+arg(Kjw(i*w))); end; Uout(s)=(4*Um/T*fi(t)*g(t)-4*Um/T*fi(t-T/4)*g(t-T/4)-Um*h(t-T/2)*g(t-T/2)); s=s+1; end plot(T_,Uf) grid on box off; figure plot(T_,Uv) grid on box

off; figure plot(T_,gin(1,:),'r',T_,gin(2,:),'b',T_,gin(3,:),'b',T_,gin(4,:),'g'... ,T_,gin(5,:),'b',T_,gin(6,:),'b',T_,gin(7,:),'b') grid on box off; figure plot(T_,gout(1,:),'r',T_,gout(2,:),'b',T_,gout(3,:),'b',T_,gout(4,:),'g'... ,T_,gout(5,:),'b',T_,gout(6,:),'b',T_,gout(7,:),'b') grid on box off; figure plot(T_,Uout) grid on box off; figure plot(T_,Uout,'b',T_,Uv,'r') grid on box off; hold off; %================================ function f=h(t) f=1-0.7562057.*exp(-39.2962963.*t).*sin(103.93016939.*t); %================================ function f=g(t) if (t>=0) f=1; else f=0; end; %----------------------% function f=fi(t) f=quad(@h,0,t); %----------------------% function f=arg(K) f=atand(imag(K)/real(K)); %----------------------% function f = Kjw(W) p=j*W;

ff=((p^2)*0.0811+1000)/((p^2)*0.0811+p*6.3662+1000); f=real(ff); %----------------------%