当前位置:
文档之家› 实验一:离散信号采样、傅里叶变换、Z变换
实验一:离散信号采样、傅里叶变换、Z变换
要求:a、画出原始波形; b、画出其采样信号;
实验信号(2)
x(n) cos(0.48n) cos(0.52n),(0 n 100)
• 要求:a、画出原始波形; • b、画出傅里叶变换的幅频特性图以 及相频特性图;
1 1 n 实验信号(3) x ( n) [( ) ( ) n ]u ( n) 2 3
ylabel('幅值','FontName','Times New Roman','FontSize',10);
• • • • • • • • • • • • • • • • • • • • •
实验三程序 clear all; clc; syms n % N=50; % n=0:N-1; f=(1/2).^n+(1/3).^n; %定义离散信号 stem(n,f); F=ztrans(f); %z变换 pretty(F); B=[2 -5/6];A=[1 -5/6 1/6]; subplot(2,2,1); stem(n,f); subplot(2,2,2); zplane(B,A); [H,w]=freqz(B,A); subplot(2,2,3); plot(w/pi,abs(H)); xlabel('\omega/\pi');ylabel('|H(e^j^\omega)|'); axis([0,1 0,2.5]); subplot(2,2,4);plot(w/pi,angle(H)); xlabel('\omega/\pi');ylabel('\phi(\omega)');
z z X(Z)= z 1/ 2 z 1/ 3
5 1 2 z 6 5 1 1 2 1 z z 6 6
• 1、求出该序列的Z变换; • 2、画出Z变换的零极点图; • 3、画出Z变换的幅频特性和相频特性图。
实验一信号 程序
• • • • • • • • • • • • • • • • • • • • %% 模拟信号采样、 Z 变换、傅里叶变换 clc; clear all; %清楚所有变量 f=0.2;phi=pi/3; % 赋值,这一步可省略 t=0:0.1:20; % 时间长度及取值 x=cos(2*pi*f*t+phi); % 表达式 % 画图 %% 采样 Ts=1/5; % 采样周期 n=0:Ts:20; % n1=0:2*Ts:20; n2=0:3*Ts:20; X=cos(2*pi*f*n+phi); X1=cos(2*pi*f*n1+phi); X2=cos(2*pi*f*n2+phi); subplot(221) plot(t,x), grid on, title('原始信号') xlabel('时域时间值','FontName','Times New Roman','FontSize',10); ylabel('幅值','FontName','Times New Roman','FontSize',10);
title('原始信号') xlabel('时域时间值 ','FontName','Times New Roman','FontSize',10); ylabel('幅值','FontName','Times New Roman','FontSize',10); subplot(2,2,2) k=0:length(magxk)-1; stem(k,magxk); title('傅里叶变换') xlabel('时域离散值 Ts=1/5','FontName','Times New Roman','FontSize',10);
subplot(222) stem(n,X,'.'); grid on; title('采样信号') xlabel('时域离散值Ts=1/5','FontName','Times New Roman','FontSize',10); ylabel('幅值','FontName','Times New Roman','FontSize',10); subplot(223); stem(n1,X1,'r.'); grid on; title('采样信号') xlabel('时域离散值Ts=2/5','FontName','Times New Roman','FontSize',10); ylabel('幅值','FontName','Times New Roman','FontSize',10); subplot(224); stem(n2,X2,'g.'); grid on; title('采样信号') xlabel('时域离散值Ts=3/5','FontName','Times New Roman','FontSize',10);
实验一: 信号采样、Z变换及离散傅里叶变换
一、实验目的
1、从采样实验中理解连续信号到离散信号的过程。
2、利用matlab验证计算序列的傅里叶变换、Z变换。
3、利用傅立叶反变换、逆Z变换进行相关运算。
实验信号 ( 1)
xa (t ) cos(2 ft ), f 0.2Hz , / 2,Ts 1/ 5
ylabel('幅值','FontName','Times New Roman','FontSize',10);
实验二对应程序 clc; clear all; N=50; n=0:N-1; xn=cos(0.48*pi*n)+cos(0.52*pi*n); % xn=cos(0.48*pi*n); xk=fft(xn,N); magxk=abs(xk); subplot(2,2,1) stem(n,xn);