Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. clear all;
  2. N = 900;
  3. alfa = (N - 1) / 2;
  4. wg = 2 * pi * ( 80 / 44100 );
  5.  
  6. for n = 0:N-1
  7. w(n+1) = 0.5 - 0.5 * cos( (2*pi*n) / (N-1) );
  8. h(n+1) = ( sin(wg * (n - alfa) ) ) / ( pi * (n - alfa) );
  9. x(n+1) = n;
  10. end
  11.  
  12. suma = 0;
  13. index = 1;
  14. for o = 0:0.01:pi
  15. for n = 0:N-1
  16. suma = suma + (w(n+1) * h(n+1) * exp(-1j * o * n));
  17. end
  18. hx(index) = o;
  19. hy(index) = suma;
  20. suma = 0;
  21. index = index + 1;
  22. end
  23. %stem(x,w)
  24. %figure;
  25. %stem(x,h);
  26. figure;
  27. plot(hx,abs(hy));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement