⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dtchy.m

📁 北邮《通信原理基于Matlab的计算机仿真》书的源码 m文件 好不容易弄来的
💻 M
字号:
%低通抽样定理
clear all; close all;

dt = 0.01;
t = 0:dt:10-dt;
xt = 0.1*cos(0.15*pi*t)+1.5*sin(2.5*pi*t)+0.5*cos(4*pi*t);
[f,xf] = T2F(t,xt);

%抽样信号,抽样速率为4Hz
fs = 4;
sdt = 1/fs;
t1  = 0:sdt:10-dt;
st = 0.1*cos(0.15*pi*t1)+1.5*sin(2.5*pi*t1)+0.5*cos(4*pi*t1);
[f1,sf] = T2F(t1,st);

%恢复原始信号
t2 = -50:dt:50;
gt = sinc(fs*t2);
stt = sigexpand(st,sdt/dt);
xt_t = conv(stt,gt);

figure(1)
subplot(311);
plot(t,xt); title('原始信号');
subplot(312);
stem(t1,st);title('抽样信号');
subplot(313);
t3 = -50:dt:60+sdt-dt;
plot(t3,xt_t);title('抽样信号恢复');
axis([0 10 -4 4])

figure(2)
subplot(211)
plot(f,abs(xf));
subplot(212)
plot(f1,abs(sf));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -