셈툴 다운로드

셈툴 튜토리얼

신호처리 | FIR 저역통과 필터 설계 1 |

페이지 정보

작성자 cemtool 작성일14-04-23 18:45 조회11,511회 댓글0건

본문

사양이 다음과 같은 디지털 FIR 저역통과 필터를 설계하라.

표 7.1로 부터 적당한 창함수를 선택해보자. 임펄스 응답을 구하고, 설계한 필터의 주파수 응답을 그려보자.

ex7_8.cem
/*   Chapter 7: Example 7.8   Lowpass filter design - Hamming window
*/
 
 wp = 0.2*pi; ws = 0.3*pi;
 tr_width = ws - wp;
 M = ceil(6.6*pi/tr_width) + 1 
 
 n=[0:M-1:1];
 wc = (ws+wp)/2;               /* Ideal LPF cutoff frequency */
 hd = ideallp(wc,M);
 w_ham = (hamming(M))';
 h = hd .* w_ham;
 [db,mag,pha,grd,w] = mfreq_z(h,[1]);
 delta_w = 2*pi/1000;
 Rp = -(min(db(1:wp/delta_w+1))) /* Actual Passband Ripple */
 
 
 As = -round(max(db(ws/delta_w+1:501))) /* Min Stopband attenuation */
 
 
 /* plots */
 subplot(1,1,1)
 
subplot(2,2,1); 
stem(n,hd); title("Ideal Impulse Response") 
xtitle("n"); ytitle("hd(n)") 
subplot(2,2,2); 
stem(n,w_ham);title("Hamming Window") 
xtitle("n"); ytitle("w(n)") 
subplot(2,2,3); 
stem(n,h);title("Actual Impulse Response") 
xtitle("n"); ytitle("h(n)") 
subplot(2,2,4); 
plot(w/pi,db);title("Magnitude Response in dB");
 xtitle("frequency in pi units"); ytitle("Decibels")


댓글목록

등록된 댓글이 없습니다.