Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wp = 0.2*pi;
- ws = 0.3*pi;
- tr_width = ws - wp;
- M = ceil(6.6*pi/tr_width) + 1 ;
- n = [0:M-1];
- wc = (ws + wp)/2; hd = ideal_lp (wc, M);
- w_ham = (hamming(M))';
- h = hd.*w_ham;
- [db, mag, pha, w] = freqz_m(h, [1]);
- delta_w = 2*pi/1000;
- Rp = -(min(db(1:wp/delta_w+1)))
- s = -round(max(db(ws/delta_w+1:501)))
- ubplot(1, 1, 1)
- ubplot (2, 2, 1); stem(n, hd); title('Resposta ao Impulso Ideal');
- axis([0 M-1 -0.1 0.3]);xlabel('ns');ylabel('hd[n]');
- subplot (2, 2, 2); stem(n, w_ham); title('Janela de Hamming');
- axis([0 M-1 0 1.1]);xlabel('n');ylabel('w[n]');
- subplot (2, 2, 3); stem(n, h); title('Resposta ao Impulso Atual');
- axis([0 M-1 -0.1 0.3]);xlabel('n');ylabel('h[n]');
- subplot (2, 2, 4); plot(w/pi, db); title('Magnitude em dB');grid
- axis([0 1 -100 10]);xlabel('frequencia em pi unidades');ylabel('Decibeis');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement