bl4desofglory

Untitled

Nov 12th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. % 13.11.2019
  2. % 165678 Tomasz Kisielewski
  3. % Zadanie 4 Generowanie ciagow pseudoprzypadkowych
  4.  
  5. N = 15;
  6. M = 3;
  7. O = [2, 3, 4];
  8. % input = randi([0 1], 1, N);
  9.  
  10. output(1, 2:N) = input(1, 1:N-1);
  11. for i=1:1:M
  12. output(1, 1) = bitxor(output(1, 1), output(1, O(i)));
  13. end
  14.  
  15. autocorr = xcorr(2*output-1);
  16. figure;
  17. stairs(output);
  18. ylim([-0.5 1.5]);
  19. figure;
  20. plot(autocorr);
Advertisement
Add Comment
Please, Sign In to add comment