实验三 z 变换及离散 LTI 系统的 z 域分析

发布于:2022-11-01 ⋅ 阅读:(389) ⋅ 点赞:(0)
一、 实验目的
1 )学会运用 Matlab 求离散时间信号的有理函数 z 变换的部分分式展开;
2 )学会运用 Matlab 分析离散时间系统的系统函数的零极点;
3 )学会运用 Matlab 分析系统函数的零极点分布与其时域特性的关系;
4 )学会运用 Matlab 进行离散时间系统的频率特性分析。
二、实验原理及实例分析
click it
需要用到一些函数 pdf也有介绍

最重要的是B,A矩阵的次方系数要对应
三、 实验内容

%1.实验一 部分分式和
B=[2 16 44 56 32];
A=[3 3 -15 18 -12];
[R,P,K]=residuez(B,A)

R =

  -0.0177 + 0.0000i
   9.4914 + 0.0000i
  -3.0702 + 2.3398i
  -3.0702 - 2.3398i


P =

  -3.2361 + 0.0000i
   1.2361 + 0.0000i
   0.5000 + 0.8660i
   0.5000 - 0.8660i


K =

   -2.6667

%2.零极点图
B=[0 2 -1.6 -0.9];
A=[1 -2.5 1.96 -0.48];
subplot(4,1,1)
zplane(B,A);
title('第一个系统不稳定')
legend('零点','极点')

B1=[0 0 0 1 -1];
A1=[1 -0.9 -0.65 0.873 0];
subplot(4,1,2)
zplane(B1,A1);
title('第二个系统不稳定')
legend('零点','极点')

%3.频率响应曲线
B2=[1 0 0];
A2=[1 -0.75 0.125];
[H2,W2]=freqz(B2,A2,'whole');
h1=abs(H2);
h2=angle(H2);
subplot(4,1,3);

plot(W2/pi,h1)
title('幅频特性曲线');
subplot(4,1,4);
plot(W2/pi,h2);
title('相频特性曲线')

极点全部在单位圆内或者有单极点在单位圆上系统才稳定 

%4. 
clear;
clc;
B=[1 0 0 0 0 0 0 0 -1];
A=[1 0 0 0 0 0 0 0 -0.9];
subplot(3,1,1)
zplane(B,A);
legend('零点','极点')
title('不稳定');
[H,W]=freqz(B,A,'whole');
h1=abs(H);
h2=angle(H);
subplot(3,1,2);
axis([0,7,-100,100]);
plot(W/pi,h1);
xlabel('n*pi')
subplot(3,1,3);
axis([0,7,-100,100])
plot(W/pi,h2);
xlabel('n*pi')
 

 

很明显为梳状滤波器 

 重要思想

 这里不采用卷积算,而是逆向思维使用filter函数


%5思考题1
[x,fs]=audioread('motherland.wav');
% sound(y,Fs);

b = [1,0];
a1 = [1,0.8];
a2 = [1,-1];
a3 = [1,1.2];

figure(1);
N = length(x);
t = (0:N-1)/fs;
figure(1);
subplot(2,2,1);
plot(t,x);
title('滤波前时域波形图');
axis([0,2,-0.5,0.5]);
grid on;

x1 = filter(b,a1,x);   %filter计算离散系统的零状态响应 由Hz恢复为差分方程再求响应
subplot(2,2,2);
plot(t,x1)
axis([0,2,-0.5,0.5]);
title('经H1系统滤波后时域波形图');
grid on;

x2 = filter(b,a2,x);
subplot(2,2,3)
impz(b,a1,30);
axis([0,2,-0.5,0.5]);
title('经H2系统滤波后时域波形图');
grid on;

x3 = filter(b,a3,x);
subplot(2,2,4);
plot(t,x3)
axis([0,2,-0.5,0.5]);
title('经H3系统滤波后时域波形图');
grid on;
 

本文含有隐藏内容,请 开通VIP 后查看

网站公告

今日签到

点亮在社区的每一天
去签到