DSP using MATLAB 示例Example3.23

离散信号重构
本文通过两个不同的采样间隔,展示了如何使用零阶保持和一阶保持方法从离散时间信号重构连续时间信号,并通过MATLAB代码及图表详细解释了整个过程。

 

代码:

% Discrete-time Signal x1(n) : Ts = 0.0002
Ts = 0.0002; n = -25:1:25; nTs = n*Ts; x1 = exp(-1000*abs(nTs));

figure('NumberTitle', 'off', 'Name', 'Example3.23 Reconstructed From x1(n)');
set(gcf,'Color','white'); 
subplot(2,1,1); stairs(nTs*1000,x1); grid on;  %axis([0,1,0,1.5]);       % Zero-Order-Hold
title('Reconstructed Signal from x1(n) using zero-order-hold');
xlabel('t in msec.'); ylabel('xa(t)'); hold on; 
stem(n*Ts*1000,x1); hold off;

subplot(2,1,2); plot(nTs*1000,x1); grid on;  %axis([0,1,0,1.5]);       % first-Order-Hold
title('Reconstructed Signal from x1(n) using first-Order-Hold');
xlabel('t in msec.'); ylabel('xa(t)'); hold on; 
stem(n*Ts*1000,x1); hold off;

% Discrete-time signal x2(n) : Ts=0.001
Ts = 0.001; n = -5:1:5; nTs = n*Ts; x2 = exp(-1000*abs(nTs));

% Plot
figure('NumberTitle', 'off', 'Name', 'Example3.23 Reconstructed From x2(n)');
set(gcf,'Color','white'); 
subplot(2,1,1); stairs(nTs*1000, x2); grid on; % axis([-1,1,-1,1]);       % Zero-Order-Hold
title('Reconstructed Signal from x2(n) using zero-order-hold '); 
xlabel('t in msec.'); ylabel('xa(t)'); hold on;
stem(n*Ts*1000,x2); hold off;

subplot(2,1,2); plot(nTs*1000, x2); grid on; % axis([-1,1,-1,1]);       % First-Order-Hold
title('Reconstructed Signal from x2(n) using first-order-hold '); 
xlabel('t in msec.'); ylabel('xa(t)'); hold on;
stem(n*Ts*1000,x2); hold off;

  运行结果:

 

转载于:https://www.cnblogs.com/ky027wh-sx/p/6092308.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值