Advertisement
GibMeclay

Sobaszek

Mar 19th, 2024
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | Source Code | 0 0
  1. fs=10000;
  2. t=0:1/fs:0.5;
  3. fsin1=2;
  4. fsin2=300;
  5. [L,M]=cheby2(2,20,2*pi*200,'low','s');
  6. figure
  7.  
  8. bode(L,M);
  9. sygn=sin(2*pi*t*fsin1)+sin(2*pi*t*fsin2);
  10. temp=c2d(tf(L,M),1/fs);
  11. [Lz,Mz]=tfdata(temp,'v');
  12.  
  13.  
  14. wy=zeros(1,length(t));
  15. i=1;
  16. wy(i)=sygn(i)*Lz(1);
  17. i=2;
  18. wy(i)=sygn(i)*Lz(1) + sygn(i-1)*Lz(2) - ( wy(i-1)*Mz(2) );
  19. for i=3:length(t)
  20. wy(i)=sygn(i)*Lz(1) + sygn(i-1)*Lz(2) + sygn(i-2)*Lz(3) - ( wy(i-1)*Mz(2) + wy(i-2)*Mz(3) );
  21.  
  22. end
  23.  
  24.  
  25. plot(t,wy,t,sygn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement