Advertisement
Guest User

Untitled

a guest
Dec 19th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.67 KB | None | 0 0
  1. n = [0:127];
  2. x = (3*sin((n*pi)/8)+3).*(heaviside(n) - heaviside(n - 63));
  3. z = (7*cos((n*pi)/16).*cos(n*pi)).*(heaviside(n) - heaviside(n - 63));
  4. w = z + x;
  5. h = 0.5*sinc(0.5*(n-31)).*(heaviside(n) - heaviside(n - 63));
  6. y = conv(w, h, 'same');
  7. xk = fft(x);
  8. zk = fft(z);
  9. wk = fft(w, 128);
  10. hk = fft(h, 128);
  11. yk = wk.*hk;
  12. ynn = ifft(yk);
  13. p = (0:length(wk)-1)*128/length(wk);
  14. q = (0:length(zk)-1)*128/length(zk);
  15. r = (0:length(hk)-1)*128/length(hk);
  16. f = (0:length(xk)-1)*128/length(xk);
  17. s = (0:length(yk)-1)*128/length(yk);
  18. figure 1
  19. plot(n, ynn)
  20. %figure 1
  21. %plot(r, abs(hk));
  22. %title('magnitude');
  23. %figure 2
  24. %plot(r, angle(hk));
  25. %title('phase');
  26. %figure 3
  27. %plot(r, hk);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement