1. 已知3阶椭圆iir数字低通滤波器的性能指标为:通带截止频率0.
4π,通带波纹为0.6db,最小阻带衰减为32db。设计一个6阶全通滤波器对其通带的群延时进行均衡。
绘制低通滤波器和级联滤波器的群延时。
q1_solution
ellip(n,ap,ast,wp)
n---the order of the filter
ap-->ripple in the passband
ast->a stopband rs db down from the peak value in the passband
wp-->the passband width
be,ae]=ellip(3,0.6,32,0.4);
hellip=
f=0:0.001:0.4;
g=grpdelay(hellip,f,2);
g1=max(g)-g;
b,a,tau]=iirgrpdelay(6,f,[0 0.4],g1);
hallpass=
hoverall=cascade(hallpass,hellip);
hfvt=fvtool([hellip,hoverall]);
set(hfvt,'filter',[hellip,hoverall]);
legend(hfvt,'lowpass elliptic filter','compensated filter');
clear;
num1,den1]=ellip(3,0.6,32,0.4);
gdh,w]=grpdelay(num1,den1,512);
plot(w/pi,gdh); grid
xlabel('\omega/\pi');ylabel('group delay, samples');
f=0:0.001:0.4;
g=grpdelay(num1,den1,f,2); equalize the passband
gd=max(g)-g;
design the allpass delay equalizer
num2,den2]=iirgrpdelay(6,f,[0,0.4],gd);
gda,w] =grpdelay(num2,den2,512);
hold on;
plot(w/pi,gdh+gda,'r');
legend('original filter','compensated filter');
2.设计巴特沃兹模拟低通滤波器,其滤波器的阶数和3-db截止频率由键盘输入,程序能根据输入的参数,绘制滤波器的增益响应。
clear;
n=input('type in the order n =
wn=input('type in the 3-db cutoff frequency wn = 模拟频率。
num,den]=butter(n,wn,'s');
w=0:2*wn;
h=freqs(num,den,w);
plot(w,20*log(abs(h)))grid;
3.已知系统的系统函数为:
用matlab进行部分分式展开,并写出展开后的表达式。
partial-fraction expansion of rational z-transform
num = 0 0 1 -0.2 0.5];
den = 1 3.2 1.5 -0.8 1.4];
r,p,k] =residuez(num,den);
disp('residues');disp(r')
disp('poles');disp(p')
disp('constants');disp(k)
4.设计切比雪夫i型iir数字高通滤波器,其性能指标为:通带波纹,最小阻带衰减,通带和阻带边缘频率和绘制所设计的滤波器增益响应。
a4disp('prewapping is done,and t=2');
wp = tan(0.75*pi/2);
ws = tan(0.5*pi/2);
rp = 0.5;
rs = 43;
n,wn] =cheb1ord(ws,wp,rp,rs,'s');
b,a] =cheby1(n,rp,wn,'s');
bt,at]=lp2hp(b,a,wp);
num,den]=bilinear(bt,at,0.5);
h,omega] =freqz(num,den);
plot (omega/pi,20*log10(abs(h)))grid;
xlabel('\omega/\pi');ylabel('gain');
title('type i chebyshev highpass filter');
clear;(没做预畸变)
rp=0.5;
rs=43;
wp=0.75;
ws=0.35;
n,wp]=cheb1ord(wp,ws,rp,rs);
num,den]=cheby1(n,rp,wp,'high');
w=0:pi/1024:pi;
h=freqz(num,den,w);
subplot(2,1,1);
plot(w/pi,abs(h)),grid;title('amplitude in linear scale')
subplot(2,1,2);
plot(w/pi,20*log10(abs(h)))grid;
title('amplitude in log scale')
5.已知复指数序列为:,绘制30点该序列的实部和虚部。
n=0:29;
x=0.2*exp((0.4+1i*0.5)*n);
subplot(211);
stem(n,real(x));
xlabel('n');ylabel('real part');
grid on;
subplot(212);
stem(n,imag(x));
xlabel('n');ylabel('imag part');
grid on;
6.设计切比雪夫i型模拟低通滤波器,其滤波器的阶数,3-db截止频率和通带的波纹由键盘输入,程序能根据输入的参数,绘制滤波器的增益响应。
clear;
n=input(' 滤波器阶数n ='
wn=input(' 截止频率wn =
rp=input('通带波纹rp =
num,den]=cheby1(n,rp,wn,'s');
w=0:5*wn;
h=freqs(num,den,w);
plot(w,20*log10(abs(h)))grid;
xlabel('frequency, hz');ylabel('gain, db');
7.已知系统的系统函数为:
用matlab求系统z变换的有理形式,并写出有理形式的表达式。
r=[1 0.6 1.8];
p=[-3.2 2.4 2.4];
k=0.2;
num, den] =residuez(r,p,k)
8.设计巴特沃兹iir数字带通滤波器,其性能指标为:归一化通带截止频率为,归一化阻带截止频率为,通带波纹为0.6db,最小阻带衰减为35db。绘制所设计的滤波器增益响应。
design of iir butterworth bandpass filter
wp =[0.4 0.6];
ws = 0.3 0.7];
rp = 0.6;
rs = 35;
n,wn] =buttord(wp, ws, rp, rs);
b,a] =butter(n,wn);
h,omega] =freqz(b,a,256);
plot (omega/pi,abs(h));grid;
xlabel('\omega/\pi');ylabel('gain');
title('iir butterworth bandpass filter');
disp(n);
disp(wn);
9.已知指数序列为:,绘制24点该序列。
n=0:23;
x=2*0.9.^n;
stem(n,x,'.
grid on;
ylabel('amplitude');
xlabel('time index/n
10.设计椭圆模拟低通滤波器,其滤波器的阶数,3-db截止频率,通带的波纹和阻带衰减由键盘输入,程序能根据输入的参数,绘制滤波器的增益响应。
clear;
n=input('type in the order n =
wn=input('type in the 3-db cutoff frequency wn =
rp=input('type in the the passband ripple rp =
rs=input('type in the the minimum stopband attenuation rs =
num,den]=ellip(n,rp,rs,wn,'s');
w=0:5*wn;
h=freqs(num,den,w);
plot(w,20*log10(abs(h)))grid;
xlabel('frequency, hz');ylabel('gain, db');
11.已知系统的系统函数为:
用matlab的impz函数求h[n]的前30个样本值。
clc;a=[1 3.2 1.5 -0.8 1.4];
b=[1 -0.2 0.5];
h,t]=impz(b,a,30);
disp(h);
plot(t,h);
12.已知5阶椭圆iir数字低通滤波器的性能指标为:通带截止频率0.35π,通带波纹为0.
8db,最小阻带衰减为35db。设计一个10阶全通滤波器对其通带的群延时进行均衡。绘制低通滤波器和级联滤波器的群延时。
DSP答案
1.流水线?答 dsp芯片采用多组总线结构,允许cpu同时进行指令和数据的访问。因而,可在内部实行流水线操作。执行一条指令,总要经过取指 译码 取数 执行运算,需要若干个指令周期才能完成。流水线技术是将各个步骤重叠起来进行。既第一条指令取指 译码时,第二条指令取指 第一条指令取数时,第二条指令译码,...
DSP答案
设ar2 2060h,作为基地址,指向x 0 的存储单元。ar0 0008h 第2次 ar2 0b寻址 ar2 2068h,即x 8 第3次 ar2 0b寻址 ar2 2064h即x 4 第4次 ar2 0b寻址 ar2 206dh即x 12 1 coff common object file fo...
微机试题 final 附答案
微机原理与应用期中试题。学号姓名成绩。一 单项选择题 每题2分,共30分 1.字符 a的 ascii码为 41h 字符h的带奇校验的ascii码为 b a 41h b c8h c 68h d 48h 2.11000110为二进制补码,该数的十进制真值为 d a 198 b 198 c 58 d 58...