Advertisement
Guest User

lab__ss__cap4

a guest
Nov 20th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. %CAP4
  2. N=2000;
  3. omega = 0.01;
  4. t=1:N;
  5. x = sin(omega*t) + 0.5*sin(2*omega*t+10) + 0.25*sin(3*omega*t+30); % 3*omega max
  6. figure;
  7. plot(t,x);
  8.  
  9. Te = floor( 2*pi / (6*omega) ); %floor aprox
  10. t_es = 1:Te:N;
  11. x_es = x( t_es );
  12. hold on;
  13. stem( t_es, x_es );
  14.  
  15. for i = 1:N
  16. s = 0;
  17. for k = 1:length( t_es )
  18.  
  19. s = s + x_es(k) * sinc((3*omega*(i-t_es(k)))/pi);
  20. end;
  21. x_rec(i) = s;
  22. end;
  23. plot( t, x_rec, "r-" );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement