BÀI TẬP MÔN Thiết kế lọc số và mã hóa băng con

7 234 0
BÀI TẬP MÔN Thiết kế lọc số và mã hóa băng con

Đang tải... (xem toàn văn)

Thông tin tài liệu

ĐẠI HỌC ĐÀ NẴNG TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN TỬ VIỄN THÔNG -o0o BÀI TẬP MÔN Thiết kế lọc số hóa băng Người hướng dẫn: Học viên thực hiện: TS Ngô Văn Sỹ Bạch Ngọc Vinh Lớp: K25.KĐT.ĐN Đà Nẵng, 12/2012 Problem 6.9 A linear time-invariant system is given by the system function -k Determine and draw the block diagrams of following structures a) Direct form b) Cascade form Solution: a) Bộ lọc FIR được mô tả bởi hàm hệ thống: -k Script MATLAB: Clear; close all; %% Direct form %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Disp(‘*** Direct Form Coefficients ***’) *** Direct Form Coefficients *** K = 0:10; b = (0.5).^k, a = 1; B = Columns through 1.0000 0.5000 0.2500 0.1250 0.0625 0.0625 0.0312 0.0156 Columns through 11 0.0078 0.0039 0.0020 0.0010 b) Script MATLAB %% Cascade Form: %%%%%%%%%%%%%%%%%%%%%%%%%% disp (‘*** Cascade Form Coefficients ***’) [b0, B, A] = dir2cas (b,a) B0 = B= 1.0000 0.9595 0.2500 1.0000 0.6549 0.2500 1.0000 0.1423 0.2500 1.0000 - 0.4154 0.2500 1.0000 - 0.8413 0.2500 A= 0 0 0 0 0 Problem 7.20: Using the Parks-McClellan algorithm, design a 25-tap FIR differentiator with slope equal to sample/cycle a) Choose the frequency band of interest between 0,1π and 0,9π Plot the impulse response and the amplitude response b) Generate 100 samples of the sinusoid x(n) = 3sin(0,25πn), n = 0, … , 100 and process through the above FIR diffentiator Compare the result with the theoretical “derivative” of x (n) Note: don’t forget to take the 12-sample delay of the FIR filter into account Solution: a) clear; close all; % Specifications M = 25; w1 = 0.1*pi; w2 = 0.9*pi; % slope = sam/cycle % % (a) Design f = [w1/pi w2/pi]; m = [w1/(2*pi) w2/(2*pi)]; [db, mag, pha, grd, w] = freqz_m(h,1); Hf_1 = figure('Units','normalized','position',[0.1,0.1,0.8,0.8],'color', [0,0,0]); set(Hf_1,'NumberTitle','off','Name','P7.20.a'); subplot(2,1,1);stem([0:1:M-1],h);title('Impulse Reponse'); axis([-1,25,0.2,.2]); xlabel('n','fontsize',10); ylabel('h(n)','fontsize',10); set(gca,'XTickMode','manual','XTick',[0;12;24],'fontsize',10); subplot(2,1,2);plot(w/(2*pi),mag);title('Magnitude Response');grid; axis([0,0.5,0,0.5]); xlabel('Normalized frequency in cycles/sam','fontsize',10) set(gca,'XTickMode','manual','XTick',[0;w1/(2*pi);w2/ (2*pi);0.5],'fontsize',10); set(gca,'XTickMode','manual','YTick',[0;0.5;0.45;0.5],'fontsize',10); b) % (b) Differentiator verification Hf_2 = figure('Units','normalized','position',[0.1,0.1,0.8,0.8],'color', [0,0,0]); set(Hf_2,NumberTitle','off','Name','P7.20b'); [Hr,w,P,L] = ampl_res(h); subplot; plot(w/(2*pi), Hr); *** Type-3 Linear-Phase Filter *** title('Amplitude Response'); grid; axis([0,0.5,-0.5,0]); set(gca,'XTickMode','manual','XTick',[0;w1/(2*pi);w2/ (2*pi);0.5],'fontsize',10); set(gca,'YTickMode','manual','YTick',[-0.5;-0.45;-0.05;0],'fontsize',10); Đáp ứng biên độ được biểu diễn hình Dấu của h(n) là âm, đó chúng ta sẽ chập x(n) với –h(n) và sẽ so sánh đầu vào với đầu ở trạng thái tăng dần (ví dụ n > 25) với đầu được dịch 12 mẫu về bên trái là pha trễ của của bộ vi phân Hf_3 = figure('Units','normalized','position',[0.1,0.1,0.8,0.8],'color', [0,0,0]); set(Hf_3,'NumberTitle','off','Name','P7.20c'); n=[0:1:100]; x = 3*sin(0.25*pi*n); y = conv(x,-h); m = [41:1:81]; plot(m,x(41:1:81),m,y(41+12:1:81+12));grid % add 12 sample delay to y xlabel('n'); title('Input-Output Sequences'); axis([40,82,-4,4]); set(gca,'XTickMode','manual','XTick',[41;81],'fontsize',10); set(gca,'YTickMode','manual','YTick',[-3;0;3],'fontsize',10); Đồ thị đầu và đầu vào được biểu diễn ở hình Vì độ dốc là π/2 sam/rad, độ lợi tại ω = 0,25π bằng 0,125 Vì vậy, đầu (khi dịch) là: y(n) = 3.(0,125)cos(0,25πn) = 0,375cos(0,25πn) ... [0,0,0]); set(Hf_3,'NumberTitle','off','Name','P7.20c'); n=[0:1:100]; x = 3*sin(0.25*pi*n); y = conv(x,-h); m = [41:1:81]; plot(m,x(41:1:81),m,y(41+12:1:81+12));grid % add 12 sample delay to y

Ngày đăng: 21/06/2017, 16:16

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan