Matt23

Untitled

Nov 21st, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. title('S\{x1[n] + x2[n]\}');
  2. xlabel('Numer próbki');
  3. ylabel('Amplituda');
  4. axis([0 32 0 4]);
  5.  
  6. % b)
  7. figure;
  8. subplot(2,2,1);
  9. plot(x1);
  10. title('x1[n]');
  11. xlabel('Numer próbki');
  12. ylabel('Amplituda');
  13. axis([0 33 -1 4]);
  14. subplot(2,2,2);
  15. plot(x2);
  16. title('x2[n]');
  17. xlabel('Numer próbki');
  18. ylabel('Amplituda');
  19. axis([0 33 -1 4]);
  20.  
  21. bSx1=x1+1;
  22. bSx2=x2+1;
  23. S3=bSx1+bSx2; %S{x1[n]} +S{x2[n]} suma odpowiedzi sygnalow
  24. subplot(2,2,3);
  25. plot(S3);
  26. title('S\{x1[n]\} +S\{x2[n]\}');
  27. xlabel('Numer próbki');
  28. ylabel('Amplituda');
  29. axis([0 32 -1 4]);
  30.  
  31.  
  32. S4=(x1+x2)+1; % S{x1[n] + x2[n]} odpowiedz sumy sygnalow
  33. subplot(2,2,4);
  34. plot(S4);
  35. title('S\{x1[n] + x2[n]\}');
  36. xlabel('Numer próbki');
  37. ylabel('Amplituda');
  38. axis([0 32 0 4]);
  39.  
  40. % c)
  41. figure;
  42. subplot(2,2,1);
  43. plot(x1);
  44. title('x1[n]');
  45. xlabel('Numer próbki');
  46. ylabel('Amplituda');
  47. axis([0 33 -1 4]);
  48. subplot(2,2,2);
  49. plot(x2);
  50. title('x2[n]');
  51. xlabel('Numer próbki');
  52. ylabel('Amplituda');
  53. axis([0 33 -1 4]);
  54. cSx1=zeros(1,33);
  55. cSx2=zeros(1,33);
  56. S5=zeros(1,33);
  57.  
  58. for i=1:31
  59. cSx1(i)=x1(i+1)-x1(i);
  60. cSx2(i)=x2(i+1)-x2(i);
  61. S5(i) = cSx1(i)+cSx2(i);
  62. end
  63. %S5(32)=0.2;
  64. %S{x1[n]} +S{x2[n]} suma odpowiedzi sygnalow
  65. subplot(2,2,3);
  66. plot(S5);
  67. title('S\{x1[n]\} +S\{x2[n]\}');
  68. xlabel('Numer próbki');
  69. ylabel('Amplituda');
  70. axis([0 30 -0.3 0.3]);
  71. sygnal=zeros(1,32);
  72. for i=1:31
  73. sygnal(i)=(x1(i+1)+x2(i+1))-(x1(i)+x2(i));
  74. end
  75. S6=(x1+1)-x1+(x2+1)-x2; % S{x1[n] + x2[n]} odpowiedz sumy sygnalow
  76. subplot(2,2,4);
  77. plot(sygnal);
  78. title('S\{x1[n] + x2[n]\}');
  79. xlabel('Numer próbki');
  80. ylabel('Amplituda');
  81. axis([0 30 -0.3 0.3]);
Advertisement
Add Comment
Please, Sign In to add comment