신호처리 | IIR 필터의 주파수 응답 |
페이지 정보
작성자 cemtool 작성일14-04-23 16:01 조회13,043회 댓글0건본문
10개의 극점이 각 주위에
씩 떨어져 반지름 r=0.9 주위에 모여 있는 IIR필터를 고려할 때, 크기 응답을 계산하고, 그려보자.
- ex6_27.cem
r = 0.9; theta = (pi/180)*[-55:-35:5, 35:55:5]'; p = r*exp(j*theta); a = poly(p); b = 1; w = [0:500]*pi/500; H = freqz(b*1e-4,a,w); magH = abs(H); magHdb = 20*log10(magH); % Direct form: quantized coefficients N = 15; [ahat, L, B] = Qcoeff(a,N); TITLE = sprintf("%i-bit (1+%i+%i) Precision (DF)", N+1, L, B); Hhat = freqz(b*1e-4, ahat, w); magHhat = abs(Hhat); % Cascade form: quantized coefficients: Same N [b0, B0, A0] = drt2cas(b,a); [BAhat1,L1,B1] = QCoeff([B0,A0], N); TITLE1 = sprintf("%i-bit (1+%i+%i) Precision (CF)", N+1, L1, B1); Bhat1 = BAhat1(:,1:3); Ahat1 = BAhat1(:, 4:6); [bhat1,ahat1] = cas2dir(b0,Bhat1,Ahat1); Hhat1 = freqz(b*1e-4,ahat1,w); magHhat1 = abs(Hhat1); % Cascade form: quantized coefficients: Same B (N = L1 + B) N1 = L1+B; [BAhat2,L2,B2] = QCoeff([B0,A0], N1); TITLE2 = sprintf("%i-bit (1+%i+%i) Precision (CF)", N1+1, L2, B2); Bhat2 = BAhat2(:,1:3); Ahat2 = BAhat2(:, 4:6); [bhat2,ahat2] = cas2dir(b0,Bhat2,Ahat2); Hhat2 = freqz(b*1e-4,ahat2,w); magHhat2 = abs(Hhat2); %Comparison of Magnitude Plots Hf_1 = figure("paperunits", "inches", "paperposition", [0,0,6,4]); subplot(2,2,1); plot(w/pi, magH, "g"); axis([0,1,0,0.7]); xlabel("Digital Frequency in \pi units"); ylabel("Magnitude Response"); subplot(2,2,2); plot(w/pi, magHhat, "r"); axis([0,1,0,0.7]); xlabel("Digital Frequency in \pi units"); ylabel("Magnitude Response"); subplot(2,2,3); plot(w/pi, magHhat1, "r"); axis([0,1,0,0.7]); xlabel("Digital Frequency in \pi units"); ylabel("Magnitude Response"); subplot(2,2,4); plot(w/pi, magHhat2, "g"); axis([0,1,0,0.7]); xlabel("Digital Frequency in \pi units"); ylabel("Magnitude Response");
댓글목록
등록된 댓글이 없습니다.