Advertisement
worms005

Lab3 PPS zad 1

Nov 24th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.31 KB | None | 0 0
  1. clear all;
  2. close all;
  3.  
  4. C=100000;
  5. t=(0:1/100000:1);
  6. xt=sin(2*pi*50*t);
  7.  
  8. Decim=100;
  9. fs=C/Decim;
  10. str=sprintf('fs=%.2f', fs), disp(fs);
  11.  
  12. n=t(1:Decim:end);
  13. ind=fix(n*C+1)
  14. xn=xt(ind);
  15.  
  16. plot(t,xt,n,xn,'o')
  17. grid on;
  18. %n=(-1:0000000.1:1); yn=n; x=(ceil((1-eps)*yn)-.5; qe=yn-x; plot(n,yn,n,x,'r.'); grid on;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement