Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fs=10000;
- t=0:1/fs:0.5;
- fsin1=2;
- fsin2=300;
- [L,M]=cheby2(2,20,2*pi*200,'low','s');
- figure
- bode(L,M);
- sygn=sin(2*pi*t*fsin1)+sin(2*pi*t*fsin2);
- temp=c2d(tf(L,M),1/fs);
- [Lz,Mz]=tfdata(temp,'v');
- wy=zeros(1,length(t));
- i=1;
- wy(i)=sygn(i)*Lz(1);
- i=2;
- wy(i)=sygn(i)*Lz(1) + sygn(i-1)*Lz(2) - ( wy(i-1)*Mz(2) );
- for i=3:length(t)
- 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) );
- end
- plot(t,wy,t,sygn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement