Advertisement
domdealm

djavan1

Nov 22nd, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. wp = 0.2*pi;
  2. ws = 0.3*pi;
  3. tr_width = ws - wp;
  4. M = ceil(6.6*pi/tr_width) + 1 ;
  5. n = [0:M-1];
  6. wc = (ws + wp)/2; hd = ideal_lp (wc, M);
  7. w_ham = (hamming(M))';
  8. h = hd.*w_ham;
  9. [db, mag, pha, w] = freqz_m(h, [1]);
  10. delta_w = 2*pi/1000;
  11. Rp = -(min(db(1:wp/delta_w+1)))
  12. s = -round(max(db(ws/delta_w+1:501)))
  13. ubplot(1, 1, 1)
  14. ubplot (2, 2, 1); stem(n, hd); title('Resposta ao Impulso Ideal');
  15. axis([0 M-1 -0.1 0.3]);xlabel('ns');ylabel('hd[n]');
  16. subplot (2, 2, 2); stem(n, w_ham); title('Janela de Hamming');
  17. axis([0 M-1 0 1.1]);xlabel('n');ylabel('w[n]');
  18. subplot (2, 2, 3); stem(n, h); title('Resposta ao Impulso Atual');
  19. axis([0 M-1 -0.1 0.3]);xlabel('n');ylabel('h[n]');
  20. subplot (2, 2, 4); plot(w/pi, db); title('Magnitude em dB');grid
  21. axis([0 1 -100 10]);xlabel('frequencia em pi unidades');ylabel('Decibeis');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement