셈툴 다운로드

셈툴 튜토리얼

신호처리 | 저역통과 필터를 고역통과 필터로 변환 |

페이지 정보

작성자 cemtool 작성일14-04-23 19:11 조회9,914회 댓글0건

본문

zmapping함수를 사용하여 다음 사양의 저역통과 필터를 고역통과 필터로 변환해보자.

ex8_26.cem
/*   Chapter 8: Example 8.26*/
 
 /* Digital Lowpass Filter Specifications: */
 wplp = 0.2*pi;                          /* digital Passband freq in Hz */
 wslp = 0.3*pi;                          /* digital Stopband freq in Hz */
  Rp = 1;                              /* Passband ripple in dB */
  As = 15;                             /* Stopband attenuation in dB */
 
 /* Analog Prototype Specifications: Inverse mapping for frequencies*/
 T = 1; Fs = 1/T;                      /* Set T=1 */
 OmegaP = (2/T)*tan(wplp/2);           /* Prewarp Prototype Passband freq */
 OmegaS = (2/T)*tan(wslp/2);           /* Prewarp Prototype Stopband freq */
 /* Analog Chebyshev Prototype Filter Calculation:*/
 [cs,ds] = chb1lpf(OmegaP,OmegaS,Rp,As);
 
 /* Bilinear transformation: */
 [blp,alp] = bilinear(cs,ds,T);
 
 /* Digital Highpass Filter Cutoff frequency: */
 wphp = 0.6*pi;                    /* Passband edge frequency */
 
 /* LP-to-HP frequency-band transformation: */
 alpha = -(cos((wplp+wphp)/2))/(cos((wplp-wphp)/2)) 
 Nz = -[alpha,1]; Dz = [1,alpha];
 [bhp,ahp] = mappingz(blp,alp,Nz,Dz);
 [C,B,A] = drt2cas(bhp,ahp) 
 
 
% Plotting
figure;
 
 subplot(1,1,1)[dbl,magl,phal,grdl,w] = mfreq_z(blp,alp);
subplot(2,2,1); plot(w/pi,magl); title("Lowpass Filter Magnitude Response")xtitle("frequency in pi units"); ytitle("|H|");
 
subplot(2,2,2); plot(w/pi,dbl); title("Lowpass Filter Magnitude in dB");
xtitle("frequency in pi units"); ytitle("decibels");
 
[dbh,magh,phah,grdh,w] = mfreq_z(bhp,ahp);
subplot(2,2,3); plot(w/pi,magh); title("Highpass Filter Magnitude Response")xtitle("frequency in pi units"); ytitle("|H|");
 
subplot(2,2,4); plot(w/pi,dbh); title("Highpass Filter Magnitude in dB");
xtitle("frequency in pi units"); ytitle("decibels");


댓글목록

등록된 댓글이 없습니다.