耄怎么读-电容式接近开关
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=2(be,ae);
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=2(b,a);级联
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(wpi,GdH); grid
xlabel('omegapi');
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(wpi,GdH+GdA,'r');
legend('Original Filter','Compensated
filter');
2.
设计巴特沃兹模拟低通滤波器,其滤波器的阶数和3-d
B截止频率
由键盘输入,程序能根据输入的参数,绘制滤波器的增益响应。
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.已知系统的系统函数为:
1?0.2z
?1
?0.5z
?2
H(z)?
1
?3.2z
?1
?1.5z
?2
?0.8z
?3
?1.4z
?4
用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型I
IR数字高通滤波器,其性能指标为:通带波
纹
?
p
?0.5dB
,
最小阻带衰减
?
s
?43dB
,通带和阻带边缘频率
?
p<
br>?0.75
?
rad
和
?
s
?0.35
?
rad
绘制所设计的滤波器增益响应。
%a4
disp('prewapping
is done,and T=2');
Wp = tan(0.75*pi2);
Ws = tan(0.5*pi2);
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
(omegapi,20*log10(abs(h)));grid;
xlabel('omegapi'); 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:pi1024:pi;
h=freqz(num,den,w);
subplot(2,1,1);
plot(wpi,abs(h)),grid;title('Amplitude in
linear scale')
subplot(2,1,2);
plot(wpi,20*log10(abs(h))),grid;
title('Amplitude in log scale')
5.已知复指数序列为:
x[n]?0.2e
和虚部。
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;
(0.4?j0.5)n
,绘制30点该序列的实部
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.已知系统的系统函数为:
10.61.8
H(z)?0.2???
?1?1
1?3.2z1
?2.4z(1?2.4z
?1
)
2
用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数字带通滤波器,其性能指标为:
归一化通带
截止频率为
?
p1
?0.4
?
,
?p2
?0.6
?
,归一化阻带截止频率为
?
s1
?0.
3
?
,
?
s2
?0.7
?
,通带波纹为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 (omegapi,abs(h));grid;
xlabel('omegapi'); ylabel('Gain');
title('IIR Butterworth Bandpass Filter');
disp(N);
disp(Wn);
9.已知指数序列为:
x[n]?2(0.9)
n
,绘制24点该序列。
n=0:23;
x=2*0.9.^n;
stem(n,x,'.');
grid on;
ylabel('Amplitude');
xlabel('Time index');
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.已知系统的系统函数为:
1?0.2z
?1
?0.5z
?2
H(z)?
1?3.2z
?1
?1.5z
?2
?0.8z
?3
?1.4z
?4
用MAT
LAB的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);
stem(T,H);
12.已知5阶椭圆IIR数字低通滤
波器的性能指标为:通带截止频率
0.35π,通带波纹为0.8dB,最小阻带衰减为35dB。设计
一个10
阶全通滤波器对其通带的群延时进行均衡。绘制低通滤波器和级
联滤波器的群延时。
%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(5,0.8,35,0.35);
hellip=2(be,ae);
f=0:0.001:0.4;
g=grpdelay(hellip,f,2);
g1=max(g)-g;
[b,a,tau]=iirgrpdelay(10,f,[0 0.4],g1);
%the first parameter above is the order of the
allpass
hallpass=2(b,a);
hoverall=cascade(hallpass,hellip);
hFVT=fvtool([hellip,hoverall]);
set(hFVT,'Filter',[hellip,hoverall]);
legend(hFVT,'Lowpass Elliptic
filter','Compensated filter');
clear;
[num1,den1]=ellip(5,0.8,35,0.35);
[GdH,w]=grpdelay(num1,den1,512);
plot(wpi,GdH); grid
xlabel('omegapi'); 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(10,F,[0,0.4],Gd);
[GdA,w] = grpdelay(num2,den2,512);
hold
on;
plot(wpi,GdH+GdA,'r');
legend('Original Filter','Compensated
filter');
13.编写4点滑动平均滤波器程序。原始未受干扰的序列
为:
s[n]=3[n(0.8)
n
]
,
加性噪声信号d[n]为随机序列,幅度0.6,受干扰
的序列为:x[n]= s[n]+ d[n]
,分别绘制长度为40的原始未受干扰
的序列,噪声序列和受干扰序列,以及滑动平均滤波器的输出。
% Program 2_4
% Signal Smoothing by a
Moving-Average Filter
R = 40;
d =
65*(rand(1,R)-0.5);
m = 0:1:R-1;
s
=3.*m.*0.8.^m;
x = s + d;
subplot(211);
plot(m,d,'r-',m,s,'b:',m,x,'m--')
title('The sequence with noise');
ylabel('Amplitude')
legend('d[n]','s[n]','x[n]');
b =
ones(4,1)4;
y = fftfilt(b,x);
subplot(212);
plot(m,s,'r-',m,y,'b--')
title('The original sequence & the output
sequence');
legend('s[n]','y[n]');
ylabel('Amplitude')
14.绘制长度为10点的矩形序列的
16点离散傅立叶变换样本的幅度
和相位。
xn=ones(10,1);
Xk=fft(xn,16);Xkf=abs(Xk);Xkp=angle(Xk);
subplot(211);
stem(0:15,Xkf,'filled');
xlabel('Time indexn');ylabel('Magnitude');
subplot(212);
stem(0:15,Xkp,'filled');
xlabel('Time indexn');ylabel('Phase')
15.已知系统的系统函数为:
1?0.2z
?1
?0.5z
?2
H(z)?
1
?3.2z
?1
?1.5z
?2
?0.8z
?3
?1.4z
?4
用MATLAB的filter函数求h[n]的前20个样本值。
num=[1,-0.2,0.5];
den=[1,3.2,1.5,-0.8,1.4];
x=[1
zeros(1,20-1)];
y=filter(num, den, x);
disp('Coefficients of the power series
expansion');
disp(y)
stem(y)
16.利用Hermann公式估计FIR低通滤波器的阶数。该滤波器的性
能指标
为:通带截止频率为1500Hz,阻带截止频率为1800Hz,
通带波纹为
?
p<
br>?
0.015,阻带波纹为
?
s
?
0.021,抽样频率为<
br>5000Hz。
% Program 10_1
% Estimation of
FIR Filter Order Using remezord
%
clear;
fedge = [1500 1800] % input('Type in the
bandedges = ');
mval = [1 0];%input('Desired
magnitude values in each band = ');
dev =
[0.015 0.021];%input('Allowable deviation in each
band = ');
FT = 5000;%input('Type in the
sampling frequency = ');
[N, fpts, mag,
wt] = remezord(fedge, mval, dev, FT);
d =
s('n,fp,fst',N,0.6,0.72);
design(d);
fprintf('Filter order is %d n',N);
17
.编写长度为5的中值滤波器程序。原始未受干扰的序列为:
s[n]=3[n(0.8)
n<
br>]
,
加性噪声信号d[n]为随机序列,幅度0.6,分别绘
制长度为40的
受干扰序列,以及中值滤波器的输出。
% Program 2_5
%
Illustration of Median Filtering
%
N = 5;
R = 40;
b = 65*(rand(1,R)-0.5); %
Generate impulse noise
m = 0:R-1;
s =
3*m.*(0.8.^m); % Generate signal
x = s + b; %
Impulse noise corrupted signal
y =
medfilt1(x,N); % Median filtering
subplot(2,1,1)
stem(m,x);axis([0 50 -1
8]);grid on;
xlabel('n');ylabel('Amplitude');
title('Impulse Noise Corrupted Signal');
subplot(2,1,2)
stem(m,y);grid on;
xlabel('n');ylabel('Amplitude');
title('Output of Median Filter');
18.已知16点序列x[n]的DFT为:
?
k160?k?15
X[k]?
?
0otherwise
?
绘制序列x[n]的实部和虚部。
Xk=(0:15)16;xn=ifft(Xk);
xnre=real(xn);
xnim=imag(xn);
subplot(2,1,1);
stem(0:15,xnre,'.');grid on;
title('The real part of the sequence');
subplot(2,1,2);
stem(0:15,xnim,'.');grid
on;
title('The imaginary part of the
sequence');
19.已知系统的系统函数为:
1?0.2z
?1
?0.5z
?2
H(z)?
1
?3.2z
?1
?1.5z
?2
?0.8z
?3
?1.4z
?4
用MATLAB测试该系统的稳定性。
num=[1 -0.2 0.5];
den=[1 3.2 1.5 0.8 1.4];
zplane(num,den);
grid on;
20. 利用Remez算法设计一个等波纹线性相位FIR低
通滤波器。该滤
波器的性能指标为:通带截止频率为1500Hz,阻带截止频率为
1800H
z,通带波纹为
?
p
?
0.015,阻带波纹为
?
s
?
0.021,抽样频
率为5000Hz。
% Program 10_2
% Design of Equiripple Linear-Phase FIR
Filters
%
format long
fedge = [1500
1800];
FT = 5000;
mval = [1 0];
dev
=[0.015 0.021];
[N,fpts,mag,wt] =
remezord(fedge,mval,dev,FT);
b =
remez(N,fpts,mag,wt);
disp('FIR Filter
Coefficients'); disp(b)
[h,w] =
freqz(b,1,256);
subplot(2,1,1);
plot(wpi,20*log10(abs(h)));grid;
xlabel('omegapi'); ylabel('Gain, dB');
subplot(2,1,2);
plot(wpi,20*log10(abs(h)));grid;
axis([0 0.4 -0.7 0.7]);
xlabel('omegapi');
ylabel('Gain, dB');
title('detail in
passband')
21. 21.已知序列
x
1
[n]?{
2.2,3,?1.5,4.2,?1.8},x
2
[n]?{0.8,?1,1.6,0.8
}
,
计算两个序列的卷积
x[n]?x
1
[n]?x
2[n]
,并绘制序列
x[n]
。
clc;
clear;
x1=[2.2 3 -1.5 4.2 -1.8];
x2=[0.8 -1
1.6 0.8];
x=conv(x1,x2) %结果在主界面输出
stem(x,'filled');
grid on;
xlabel('Time indexn');ylabel('Amplitude');
title('The output convolution');
22.
已知序列x[n]为
x[n]?cos(
?
n2),
0?n?15
,绘制序列x[n]
的DFT和DTFT的幅度。
n=0:15;x=cos(pi*n*0.5);
X=fft(x);
subplot(2,1,1);
stem(n,X,'.');
title('Magnitude of DFT')
xlabel('n');
ylabel('Magnitude')
%circulating DTFT
k=0:499;
w = pi500*k;
X1=x*(exp(-1i*pi500)).^(n'*k);
magX=abs(X1);
subplot(2,1,2);
plot(wpi,magX);title('幅度响应');grid;
ylabel('幅度');xlabel('以pi为单位的频率');
23. 已知FIR滤波器的系统函数为:
H(z)?2.4?3.2z
?1
?1.5z
?2
?0.8z
?3
?1.4z
?4
?3.6
z
?5
?5.2z
?6
用MATLAB将系统函数分解为二次多项
式之积,并写出各二次
多项式的表达式。
clear
P=[2.4,3.2,1.5,0.8,1.4,3.6,5.2];
r=roots(P);%调用函数计算
syms z
s1=simple((z-r(1))*(z-r(2)));
d1=simple(s1.z^2)
s2=simple((z-r(3))*(z-r(4)));
d2=simple(s2.z^2)
s3=simple((z-r(5))*(z-r(6)));
d3=simple(s3.z^2)
Q=2.4*d1*d2*d3
24.
已知FIR数字低通滤波器的性能指标为:通带截止频率0.35π,阻
带截止
频率0.45π,通带和阻带波纹? = 0.01。设计满足该滤波器
的Kaiser’s窗函数,绘
制出Kaiser’s窗函数的增益响应。
clear;
fpts=[0.35,0.45];
mag=[1,0];
dev=[0.01,0.01];
[N,Wn,beta,ftype]=kaiserord(fpts,mag,dev);
kw=kaiser(N+1,beta);
b=fir1(N,Wn, kw);
[h,omega]=freqz(b,1,512);
plot(omegapi,20*log10(abs(h)));grid;
xlabel('omegapi'); ylabel('Gain, dB');
25.已知系统的频h响特性为:
?j?
?2j
?
?3j
?
?4j
?
1?0.2e?
0.5e?2e?0.6e
H(e
j
?
)?
1?3.2
e
?j
?
?1.5e
?2j
?
?0.8e
?3j<
br>?
?1.4e
?4j
?
绘制该系统的幅频特性和相频特性。
clear
k=500; % number
of frequency samples is 500
num=[1 -.2 .5 2
-.6]; %Numerator coefficients
den=[1
3.2 1.5 -.8 1.4]; %Denominator
coefficients
w=0:pi(k-1):pi;
h=freqz(num,den,w); %Compute the
frequency response
subplot(1,2,1)
plot(wpi,abs(h))
title('Magnitude
Spectrum')
xlabel('omegapi');ylabel('Magnitude')
subplot(1,2,2)
plot(wpi,unwrap(angle(h)))
%unwrapped phase function
title('Phase
Spectrum')
xlabel('omegapi');ylabel('Phase,radians')
[sos,g]=tf2sos(num,den)
26. 已知
序列
x
1
[n]?{2.2,3,?1.5,4.2,?1.8},x
2[n]?{0.8,?1,1.6,0.8}
,基
于DFT计算两个序列的卷积
x
[n]?x
1
[n]?x
2
[n]
,并绘制基于DFT
计算
得到的
x[n]
。
clc;
clear;
x1=[2.2 3
-1.5 4.2 -1.8];
x2=[0.8 -1 1.6 0.8];
n=size(x1,2);
m=size(x2,2);
X1=fft(x1,n+m-1);
X2=fft(x2,n+m-1);
X=X1.*X2;
x=ifft(X)
stem(x,'.');
27.已知IIR滤波器的系统函数为:
2?5z
?1
?z
?2<
br>?3z
?3
?4z
?4
?6z
?5
H(z)?
1?3z
?1
?5z
?2
?2z
?3
?4z<
br>?4
?3z
?5
用MATLAB将系统函数表示为级联型结构形式,并写出各级
联
子系统的表达式。(不确定)
format short;
num =
[2,5,1,-3,4,6];
den = [1,3,-5,2,-4,3];
[z,p,k]=tf2zp(num,den);
sos=zp2sos(z,p,k)
28.用Kaiser’s窗函数
设计FIR数字高通滤波器,其滤波器的性能指
标为:通带截止频率0.55π,阻带截止频率0.45
π,通带和阻带波
纹? =0.04。绘制出该滤波器的增益响应。
% Program
10_5
% Lowpass Filter Design Using the Kaiser
Window
clc
%delta_s=50; %阻带衰减
delta_p=0.04; %通带衰减
%alpha_s=10^(-delta_s20);
alpha_p=1-10^(-delta_p20);
fpts = [0.45
0.55]; %截止频率1,截止频率2
mag = [0 1];
%截止频率1对应的幅度 截止频率2对应的幅度
dev = [alpha_p
alpha_p]; %通带衰减 阻带衰减(线性)
[N,Wn,beta,ftype]=kaiserord(fpts,mag,dev);
b = fir1(N,Wn,'high',kaiser(N+1,beta));
[h,omega] = freqz(b,1,512);
plot(omegapi,20*log10(abs(h)));grid;
xlabel('omegapi'); ylabel('Gain, dB');
29.绘制6点滑动平均滤波器的幅频特性和相频特性。
h =
ones(1,6)6;
[H,w] = freqz(h, 1, 256);
subplot(211)
plot(wpi, abs(H));
ylabel('Magnitude'); xlabel('omegapi');
subplot(212)
ph = angle(H)*180pi;
plot(wpi,angle(H)*180pi);
ylabel('Phase,
degrees');xlabel('omegapi');
30.原始序列为:s[n]=3[n(0.8)
n
]
,
加性噪声d[n]为随机序列,幅度0.6,
受干扰的序列为:x[n]= s[n]+ d[n],使
用重叠相加法实现5点滑动平
均滤波器对x[n]的处理。绘制未受干扰的序列s[n]和滤波器输出的
有
噪序列(利用fftfilt函数)。
% Program 2_4
%
Signal Smoothing by a Moving-Average Filter
R
= 40;
d = 65*(rand(1,R)-0.5);
m = 0:1:R-1;
s =3.*m.*0.8.^m;
x = s + d;
subplot(211);
plot(m,d,'r-',m,s,'b:',m,x,'m--')
title('The sequence with noise');
ylabel('Amplitude')
legend('d[n]','s[n]','x[n]');
b =
ones(5,1)5;
y = fftfilt(b,x);
subplot(212);
plot(m,s,'r-',m,y,'b--')
title('The original sequence & the output
sequence');
legend('s[n]','y[n]');
ylabel('Amplitude')
31.已知IIR滤波器的系统函数为:
2?5z
?1
?z
?2
?3z
?3
?4z
?4
?6z
?5
H
(z)?
1?3z
?1
?5z
?2
?2z
?3<
br>?4z
?4
?3z
?5
用MATLAB对系统进行并联结构I型和并联
结构II型分解。
32. 用海明窗设计多频带FIR滤波器,该滤波器满足
如下条件。在频
率范围0到0.32?内幅度为0.6,在频率范围0.35?到0.65?内幅度为0.2,在频率范围0.68?到?内幅度为0.8。绘制出该滤波器的幅
频特性。
fpts = [0 0.32 0.35 0.65 0.68 1];
mval = [0.6 0.6 0.2 0.2 0.8 0.8];
b
= fir2(100,fpts,mval);
[h,omega] =
freqz(b,1,512);
plot(omegapi,abs(h));grid;
xlabel('omegapi'); ylabel('Magnitude');
34. 已知系统的系统函数为:
1?0.2z
?
1
?0.5z
?2
?2z
?3
?0.6z
?4
H(
z)?
1?3.2z
?1
?1.5z
?2
?0.8z<
br>?3
?1.4z
?4
绘制该系统的零极点分布图。
方法一:num=[1 -0.2 0.5 2 -0.6];
den=[1 3.2 1.5
-0.8 1.4];
zplane(num,den)
35.
已知全通系统的系统函数为:
3?4z
?1
?2z
?2
?5z?3
?3z
?4
?z
?5
H(z)?
1?3
z
?1
?5z
?2
?2z
?3
?4z
?4
?3z
?5
用MATLAB求全通系统进行级联格型结构的乘法器系数。(不确定)
num=[1 0.4 0.18 -0.2];
>> k=poly2rc(num)
36.已知有限长序列为:
N=64;
x[n]?sin(25
?
n64),0?n?63
,求该序列的64点
离散傅立叶变换X[k],绘制出X[k
]的幅度。
n=0:1:63;
x=sin(25*pi*nN);
%k=512;
%w =
0:pi(k-1):pi;
%h = freqz(x, 1, w);
%subplot(211);
%plot(wpi,abs(h));grid
%title('Magnitude Spectrum')
%xlabel('omegapi'); ylabel('Magnitude')
X=fft(x,64);
%subplot(212)
stem(n,X,'.');grid;
设计4阶巴特沃兹模拟低通滤波器,其3-dB截止频率为1,绘制滤波器的增益响应。
N
= 4;
Wn = 1;
[num,den] = butter(N,Wn,'s');
[h,w] = freqs(num,den);
plot
(w,20*log10(abs(h)));
xlabel('Frequency, Hz');
ylabel('Gain, dB');
title('The 4th-order IIR
Butterworth Lowpass Filter ')
grid on
38. 已知系统的零极点分别如下:
z
1
?2.2,z
2??1?j,z
3
??1?j,z
4
?1.4
p
1?3.7?j2,p
2
?3.7?j2,p
3
??2.1?j,p
4
??2.1?j
求系统的系统函数H(z)。
format
long
zr =[2.2 -1+i -1-i 1.4];
pr
=[3.7+2*i 3.7-2*i -2.1-i -2.1+i ];
%
Transpose zero and pole row vectors
z =
zr'; p = pr';
k = 1;
[num, den] =
zp2tf(z, p, k);
disp('Numerator polynomial
coefficients'); disp(num);
disp('Denominator polynomial coefficients');
disp(den);
39.设计椭圆IIR数字低通滤波器,其性能指标为:通
带截止频率为1000Hz,阻带截止频率
为1250Hz,通带波纹为0.4dB,最小阻带衰减为4
5dB,抽样频率为5000Hz。绘制所设计的
滤波器增益响应。
Fp =
1000%input('passband edge in Khz = ');
Fs =
1250%input('stopband edge in Khz = ');
Ft = 5000%input('Sampling rate in Khz =
');
Rp =0.4% input('Passband ripple in dB =
');
Rs =45% input('Minimum stopband
attenuation in dB = ');
Wp=2*FpFt;
Ws=2*FsFt;
[N,Wn] = ellipord(Wp,Ws,Rp,Rs);
[b,a] = ellip(N,Rp,Rs,Wn);
[h,omega] =
freqz(b,a,256);
plot
(omegapi,20*log10(abs(h)));grid;
xlabel('omegapi'); ylabel('Gain, dB');
title('IIR Elliptic Lowpass Filter');
%figure(2);
%subplot(2,1,1);
%plot(omegapi,20*log10(abs(h))); grid;
%axis([0 1 -60 5]);
%subplot(2,1,2);
%plot(omegapi,20*log10(abs(h))); grid;
%axis([0 0.4 -0.6 0.2]);
40.编写总体均值滤波器程序。原始
未受干扰的序列为:s[n]=3[n(0.8)
n
],
加性噪声信号d[n]
为随机序列,幅度0.6,受干扰的序列为:x[n]= s[n]+
d[n],绘制噪声序列和60次检测结果
的总体平均的序列。
% Program 2_4
% Signal Smoothing by a Moving-Average Filter
R = 60;
d = 65*(rand(1,R)-0.5);
m =
0:1:R-1;
s =3.*m.*0.8.^m;
x = s + d;
subplot(211);
plot(m,d,'r-',m,s,'b:',m,x,'m--')
title('The sequence with noise');
ylabel('Amplitude')
legend('d[n]','s[n]','x[n]');
b =
ones(R,1)R;
y = fftfilt(b,x);
subplot(212);
plot(m,s,'r-',m,y,'b--')
title('The original sequence & the output
sequence');
衣褶的读音-急公好义
patient的反义词-寝的意思
郭华粹-适合英文
staycation-伥
英语26字母-随心所欲什么意思
rms是什么意思-分钟英语
体育的英语-柱面镜
要点英文-arabian
-
上一篇:【CP】CP是什么意思-CP的意思
下一篇:十五个关于on的用法总结