DSP 题库详解 1 已知 3 阶椭圆 IIR 数字低通滤波器的性能指标为: 通带截止频率 π, 通带波纹为 , 最小阻带衰减为 32dB 。设计一个 6 阶全通滤波器对其通带的群延时进行均衡。绘制低通滤波器和级联滤波器的群延时。%Progranm 1% Group-delay equalization of an IIR filter. % [n,d] = ellip(3,,32,); [GdH,w] = grpdelay(n,d,512); plot(w/pi,GdH); grid xlabel('\omega/\pi'); ylabel('Group delay, samples'); title('Original Filter'); F= 0::; g= grpdelay(n,d,F,2); % Equalize the passband Gd = max(g)-g; % Design the allpass delay equalizer [num,den, tau ]= iirgrpdelay(6, F, [0 0. 4], Gd); % 设计六阶的全通滤波器[b,a]=iirgrpdelay(6,F,[0 ],Gd); He1=(b,a); He=(n,d); He_all=(He,He1); grpdelay(He_all) %DFILT:Digital Filter Implementation. [GdA,w] = grpdelay (num,den,512); figure(2); plot(w/pi,GdH+GdA); grid xlabel('\omega/\pi');ylabel('Group delay, samples'); title('Group Delay Equalized Filter'); 2 设计巴特沃兹模拟低通滤波器, 其滤波器的阶数和 3-dB 截止频率由键盘输入,程序能根据输入的参数,绘制滤波器的增益响应。% Program 2% Program to Design Butterworth Analog Lowpass Filter %% Type in the filter order and passband edge frequency 设计边缘频率 N= input('Type in filter order = '); Wn = input('3-dB cutoff angular frequency = '); % Determine the transfer function [num,den] = butter(N,Wn,'s'); % 计算滤波器的分子和分母% Compute and plot the frequency response [h,w]=freqz(num,den); plot (w/pi,20*log10(abs(h))); xlabel( '\omega/\pi'); ylabel('Magnitude, dB'); title('The magnitude respponse of the system') axis([0 3 -80 5]) 3 %%%%%%%%%% % To use the residue % num=[1,-,,0,0]; den=[1,,,-,]; [r,p,k]=residuez(num,den) 4% Program 4% Cheby1 analog highpass filter design % Wp=;Ws=;Rs=43;Rp=; [N,Wn]=cheb1ord(Wp,Ws,Rp,Rs,'s'); % Determine the coefficients of the transfer function [num,den]=cheby1(N,Rp,Wn,'high','s'); % Compute and plot the frequency response omega=[0:1:30*pi]; %w=0::pi; h=freqs(num,den,omega); %plot(w/pi,20*log10(abs(h))) plot(omega/(2*pi),20*log10(abs(h))); xlabel('\omega/\pi');ylabel('Magnitude,dB'); title('IIR Chebyshev1 Highpass Filter/digital') 5.% Program to 绘制 30 点序列
dsp各种程序 来自淘豆网www.taodocs.com转载请标明出处.