Fundamentals of Linux

2 468 1
  • Loading ...
1/2 trang

Thông tin tài liệu

Ngày đăng: 18/09/2012, 10:11

Fundamentals of LinuxLEU-118Student Guide function loc_iir()% Chi tieu ky thuat cua bo loc so:wp =0.2*pi; % digital Passband freq in Hzws =0.3*pi; % digital Stopband freq in HzRp = 1; % Passband ripple in dBAs = 15; % Stopband attenuation in dB% Chi tieu ky thuat cua bo loc tuong tu: Anh xa nguocT = 1; Fs =1/T; % Dat T=1OmegaP = (2/T)*tan(wp/2);OmegaS = (2/T)*tan(ws/2);% Tinh toan bo loc tuong tu:[cs, ds] = afd_chb1(OmegaP,OmegaS,Rp,As);% Bien doi song tuyen:[b,a] = bilinear(cs,ds,Fs);%[db,mag,pha,grd,w] = freqz_m1(b,a);%plotfigure(37); clf;%subplot(2,2,1); plot(w/pi,mag);axis([0,1,0,1.2]); gridtitle('Amplitude Response');xlabel('frequency in pi units'); ylabel('|Hr(w)|');%subplot(2,2,3); plot(w/pi,db);axis([0,1,-30,10]); gridtitle('Magnitude Response');xlabel('frequency in pi units'); ylabel('Decibels');%subplot(2,2,2); plot(w/pi,pha/pi);axis([0,1,-1,1]); gridtitle('Phase Response');xlabel('frequency in pi units'); ylabel('Angle(Hr(w))');%subplot(2,2,4); plot(w/pi,grd);axis([0,1,0,15]); gridtitle('Group Delay');xlabel('frequency in pi units'); ylabel('Samples'); function [db,mag,pha,grd,w] = freqz_m1(b,a)% Phien ban sua doi cua ham freqz% -------------------------------------% db = Do lon tuong doi theo dB tren doan tu 0 den pi% mag = Do lon tuyet doi tren doan tu 0 den pi% pha = Dap ung pha tren doan tu 0 den pi% grd = Tre nhom tren doan tu 0 den pi% w = Cac mau tan so doan tu 0 den pi% b = Cac he so da thuc tu so cua H(z) (voi FIR: b=h)% a = Cac he so da thuc mau so cua H(z)(voi FIR: a=[1]) [H,w] = freqz(b,a,1000,'whole');H = (H(1:1:501))';w = (w(1:1:501))';mag = abs(H);db = 20*log10((mag+eps)/max(mag));pha = angle(H);grd = grpdelay(b,a,w);0 0.5 100.51Amplitude Responsefrequency in pi units|Hr(w)|0 0.5 1-30-20-10010Magnitude Responsefrequency in pi unitsDecibels0 0.5 1-1-0.500.51Phase Responsefrequency in pi unitsAngle(Hr(w))0 0.5 1051015Group Delayfrequency in pi unitsSamples 123doc.vn
- Xem thêm -

Xem thêm: Fundamentals of Linux, Fundamentals of Linux, Fundamentals of Linux

Gợi ý tài liệu liên quan cho bạn