Advertisement
Guest User

fg54wt45yy

a guest
Oct 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. lear all;
  2. close all;
  3.  
  4. omega = pi/40;
  5. N = 80;
  6. t = 0:N-1;
  7.  
  8. s1 = sin(omega * t);
  9. subplot(4, 1, 1), plot(t, s1);
  10.  
  11. s2 = sin(2 * omega * t);
  12. subplot(4, 1, 2), plot(t, s2);
  13.  
  14. s3 = sin(3 * omega * t);
  15. subplot(4, 1, 3), plot(t, s3);
  16.  
  17. s1s1 = 0;
  18. for i = 1 : N
  19. s1s1 = s1s1 + s1(i) * s1(i);
  20. end
  21. fprintf('<s1, s1> = %f\n', s1s1);
  22.  
  23. s1s2 = 0;
  24. for i = 1 : N
  25. s1s2 = s1s2 + s1(i) * s2(i);
  26. end
  27. fprintf('<s1, s2> = %f\n', s1s2);
  28.  
  29. s4 = 0.5*sin(omega*t) + 0.4*sin(2*omega*t)+ 0.1*sin(5*omega*t);
  30. subplot(4,1,4),plot(t,s4);
  31.  
  32. s1*s3'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement