Guest User

Untitled

a guest
Jan 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. dt = 1/1000;
  2. t = 0:1/1000:1.28-1/1000;
  3. x1 = 10000*t(1:20).^2;
  4. x2 = -10000*(t(21:40)-0.04).^2+8;
  5. x3 = 8*ones(1,20);
  6. x4 = -800*t(61:70)+56;
  7. x5 = zeros(1,10);
  8.  
  9. x = [x1 x2 x3 x4 x5] ;
  10. x = [x x x x];
  11. x = [x x x x]; % make x to be periodic
  12.  
  13. dtz = 1.5/100;
  14. tz = 0:dtz:1.28-1/1000;
  15. z = x(1: round(dtz/dt) : end);
  16. figure('Name', 'undersampled signal');
  17. plot(tz,z,'o',t,x,'-')
  18. legend('Under sampled signal', 'The original signal')
  19.  
  20. figure('Name', 'Reconstructed signal');
  21. plot(t(1:5:160),z(mod((0:31)*11,16)+1), 'o',t(1:160),x(1:160), '-');
  22. legend('Reconstructed signal', 'The original signal')
Add Comment
Please, Sign In to add comment