南理工数字信号处理matlab题库

时间:2025-07-09

南理工 数字信号处理 DSP Matlab题库

DSP题库详解

1已知3阶椭圆IIR数字低通滤波器的性能指标为:通带截止频率0.4π,通带波纹为0.6dB,最小阻带衰减为32dB。设计一个6阶全通滤波器对其通带的群延时进行均衡。绘制低通滤波器和级联滤波器的群延时。

%Progranm 1

% Group-delay equalization of an IIR filter.

%

[n,d] = ellip(3,0.6,32,0.4);

[GdH,w] = grpdelay(n,d,512);

plot(w/pi,GdH); grid

xlabel('\omega/\pi'); ylabel('Group delay, samples');

title('Original Filter');

F = 0:0.001:0.4;

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 0.4],Gd);

He1=dfilt.df2(b,a);

He=dfilt.df2(n,d);

He_all=dfilt.cascade(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');

南理工 数字信号处理 DSP Matlab题库

%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.2,0.5,0,0];

den=[1,3.2,1.5,-0.8,1.4];

[r,p,k]=residue(num,den)

4% Program 4

% Cheby1 analog highpass filter design

%

Wp=0.75;Ws=0.35;Rs=43;Rp=0.5;

南理工 数字信号处理 DSP Matlab题库

[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:0.01: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点序列的实部与虚部

%

n=0:29;

x=0.2*exp((0.4+0.5*j).*n);

subplot(1,2,1)

stem(n,real(x))

title('The real part ');

xlabel('n');ylabel('magnitude')

subplot(1,2,2)

stem(n,imag(x))

title('The imagine part')

xlabel('n');ylabel('magnitude')

6.

% Program to Design Type 1 Chebyshev analog Lowpass Filter

%

% Read in the filter order, passband edge frequency

南理工 数字信号处理 DSP Matlab题库

% and passband ripple in dB

N = input('Order = ');

Wc = input('type in the 3 dB cutoff frequency=');

Rp = input(' Type in the peak ripple value in passband: ');

% Determine the coefficients of the transfer function

[num,den] = cheby1(N,Rp,Wc,'s');

% Compute and plot the frequency response

[h,w]=freqs(num,den);

plot (w/pi,20*log10(abs(h)));

xlabel('Frequency, Hz'); ylabel('magnitude, dB');

title('IIR Chebyshev1 Lowpass Filter/analog')

grid on

7.

% Determination of the Factored Form

% of a Rational z-Transform

%熟悉命令[num,den]=residuez(r,p,k);[r,p,k]=residuez(num,den)

clear all

r = [1 0.6 1.8];

p =[-3.2 2.4 2.4];

k =0.2;

[num, den] = residuez(r,p,k);

disp('Numerator polynomial coefficients'); disp(num)

disp('Denominator polynomial coefficients'); disp(den)

8, 设计IIR数字带通滤波器

% Program to Design iir digital bandpass Filter

clear all

南理工 数字信号处理 DSP Matlab题库

Wp = [0.4 0.6]; %Wp and Ws 都是向量组,带通的性质

Ws = [0.3 0.7];

Rp = 0.6;

Rs = 35;

[N,Wn] = buttord(Wp, Ws, Rp, Rs);

[b,a] = butter(N,Wn); %巴特卧兹滤波器的分子和分母

[h,w] = freqz(b,a,256); %求出在频域的画图点,256,即要花的点数

gain = 20*log10(abs(h));

plot (w/pi,gain);grid on

xlabel('\omega/\pi'); ylabel('magnitude, dB');

title('IIR Butterworth Bandpass Filter');

9%draw the requested sequence

clear

n=0:23;

x=2*0.9.^n;

stem(n,x)

title('x[n]')

xlabel('n');ylabel('magnitude')

grid on

10%

% Program to Design Elliptic analog Lowpass Filter %椭圆模拟低通滤波器设计

% Read in the filter order, passband edge frequency,

% passband ripple in dB and minimum stopband

% attenuation in dB

南理工 数字信号处理 DSP Matlab题库

N = input('Order = ');

Wn = input('type in the 3 dB cutoff frequency= ');

Rp = input('type in the peak ripple value of passband in dB = ');

Rs = input('type in the Minimum stopband attenuation in dB = ');

[num,den] …… 此处隐藏:9167字,全部文档内容请下载后查看。喜欢就下载吧 ……

南理工数字信号处理matlab题库.doc 将本文的Word文档下载到电脑

    精彩图片

    热门精选

    大家正在看

    × 游客快捷下载通道(下载后可以自由复制和排版)

    限时特价:7 元/份 原价:20元

    支付方式:

    开通VIP包月会员 特价:29元/月

    注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
    微信:fanwen365 QQ:370150219