Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. % clear;
  2. % close all
  3. % f0 = 1800;
  4. % U = 1200;
  5. % T = 1/U;
  6. % T1 = 1/f0;
  7. % q = 4;
  8. % shag = 5;
  9. % f = -11000:shag:11000;
  10. % spec_sig = zeros(q, length(f));
  11. % i0 = [0, 0, 1, 1];
  12. % i1 = [0, 1, 0, 1];
  13. % Am = 1;
  14. % %Амплитудные спектры
  15. %
  16. % for i = 1:q
  17. % s_i1 = Am*(1-(2*i0(i)/(sqrt(q)-1)));
  18. % s_i2 = Am*(1-(2*i1(i)/(sqrt(q)-1)));
  19. % spec_sig(i,:) = s_i1*sqrt(T1/2)*(sinc((f-f0)*T1) + sinc((f+f0)*T1)).*exp(1j*pi*f*T1) + s_i2/1j*sqrt(T1/2)*(sinc((f-f0)*T1) - sinc((f+f0)*T1)).*exp(1j*pi*f*T1);
  20. % subplot(2,2, i), plot(f(length(f)/2:length(f)), abs(spec_sig(i, length(f)/2:length(f)))), xlabel('f'), ylabel('spec-sig_i(f)');
  21. % grid on;
  22. % %disp(i);
  23. % %disp(abs(S(i)));
  24. % end
  25.  
  26. clear;
  27. close all
  28. l = 45;
  29. T0 = 2;
  30. f0 = l/T0;
  31. t = 0:1/1000*T0:T0;
  32. f1 = (2/T0)^(1/2)*cos(2*pi*f0*t);
  33. f2 = (2/T0)^(1/2)*sin(2*pi*f0*t);
  34.  
  35. F1 = 1800;
  36. T = 2/F1;
  37. TIME = 0:T/1000:T;
  38.  
  39. sig1 = (2/T)^(1/2)*cos(2*pi*F1*TIME)+(2/T)^(1/2)*sin(2*pi*F1*TIME);
  40. plot(t, f1, t, f2);
  41. figure(2);
  42. plot(TIME,sig1);
  43. % доказательство пункт 2
  44. f11 = sqrt(sum(f1.*f1));
  45. f22 = sqrt(sum(f2.*f2));
  46. f1 = f1./f11;
  47. f2 = f2./f22;
  48. scal1 = (sum(f1.*f1));
  49. disp(scal1);
  50. scal2 = (sum(f1.*f2));
  51. disp(scal2);
  52. scal3 = (sum(f2.*f2));
  53. disp(scal3);
  54. %часть 2
  55. q = 4;
  56. i0 = [0, 0, 1, 1];
  57. i1 = [0, 1, 0, 1];
  58. Am = 1;
  59. s_x = zeros(0,q);
  60. s_y = zeros(0,q);
  61. for i = 1:q
  62. s_x(i) = Am*(1-(2*i0(i)/(sqrt(q)-1)));
  63. s_y(i) = Am*(1-(2*i1(i)/(sqrt(q)-1)));
  64. end
  65. figure(3);
  66. for i=1:q
  67. plot(s_x(i), s_y(i),'o','Color', 'k');
  68. hold on;
  69. end
  70. axis([-2 2,-2,2]);
  71. grid on;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement