Advertisement
worms005

PPS sume 2 sygnalow sinusoidalnych

Nov 24th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.90 KB | None | 0 0
  1. %Program reazlizuje sume 2 sygnalow sinusoidalnych
  2. t = 0:0.001:1-0.001; % wektor czasu
  3. A1 = 1; A2 = 0.5; % amplitudy sinusoid
  4. f1 = 2; f2 = 20; % czestotliwosci sinusoid
  5. x1 = A1 * sin(2*pi*f1*t); % pierwsza sinusoida
  6. x2 = A2 * sin(2*pi*f2*t); % druga sinusoida
  7. xs = x1 + x2; % suma sinusoid
  8. %subplot (3,1,1); % podzielenie obaszru na 3 czesci
  9. %plot (t, x1); % kreslenie wykresu pierwszej sinusoidy w pierwszym obszarze
  10. %xlabel ('czas t [s]'); % opis osi x (poziomej)
  11. %ylabel ('sygnal 1'); % opis osi y
  12. %subplot (3,1,2);
  13. %plot (t, x2);
  14. %xlabel ('czas t [s]'); % opis osi x (poziomej)
  15. %ylabel ('sygnal 2'); % opis osi y
  16. %subplot (3,1,3);
  17. %plot (t, xs);
  18. %xlabel ('czas t [s]'); % opis osi x (poziomej)
  19. %ylabel ('suma sygnalow'); % opis osi y
  20. subplot (1,1,1);
  21. plot(t, x1, 'r'); grid on
  22. hold on
  23. plot(t, x2, 'g')
  24. hold on
  25. plot(t, xs, 'o')
  26. hold on
  27. title ('2 sygnaly sinus i ich suma')
  28. xlabel ('czas t [s]')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement