Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.91 KB | None | 0 0
  1. //Завдання 10
  2. t = t0 : dt : t0 + T-dt;
  3.  
  4. newC = c(N : -1 : 1);
  5.  
  6. for n = 1 : 1 : N
  7.     s = 0;
  8.     for k = N : -1 : 1
  9.         A = (%pi * %i * (k - 1)) / 5;
  10.         s = s + (newC(k) * exp(A * t(n)));
  11.     end;
  12.     x(n) = real(s);// відтворена послідовність
  13. end;
  14.  
  15. k = 1 : 1 : N
  16. figure(5, 'BackgroundColor', [1,1,1]);
  17. subplot(2,1,1),   plot2d(k, real(newC)),          title('real(newC)','position',[N/2,max(real(newC))/2]);
  18. subplot(2,1,2),   plot2d(k, imag(newC)),          title('imag(newC)','position',[N/2,max(imag(newC))/2]);
  19.  
  20. T = 10;
  21. t0 = 0;
  22. dt = T/N;
  23.  
  24. qw = N * ifft(newC);//OШПФ
  25.  
  26. //Завдання 11
  27. k = 1 : 1 : N
  28. figure(6, 'BackgroundColor', [1,1,1]);
  29. subplot(2,1,1),   plot2d(t,(xx)),          title('Input data - x(n)','position',[N/2,max(real(newC))/2]);
  30. subplot(2,1,2),   plot2d(k, (qw),),          title('Reprodused data - x(n)','position',[T/2,max(real(qw))/2]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement