%2017/8/20日 %工程北629 %功能:数字信号的扩展和压缩 %思想:使用公式 y(t) = x(at) %说明: clear all; clc %输入信号 n = -100:100; %序号序列 dt = 0.1; %时间间隔0.1s t = n*dt; %时间序列t= -10、-9、...0...9、10,这个t其实也是代表弧度 %信号处理 y = sin(t); %原始信号,t以弧度(rad) 计算 y1 = sin(2*t); %压缩 y2 = sin(0.5*t); %扩展 %输出信号 subplot(3,1,1); plot(n, y); %注意:此处的t可以换成n,n和t对应的图形形状是一样的。 title('原始信号sin(t)/采样周期0.1s'); grid on subplot(3,1,2); stem(t, y1); title('压缩信号sin(2t)'); grid on subplot(3,1,3); stem(t, y2); title('扩展信号sin(0.5t)'); grid on xlabel('时间t/s') %总结:1、n和t在作图时,得到的图形形状是一样的(无论是plot还是stem)。 % 2、n和t在作图时,主要是刻度不同,当为t时,是真实的函数sin(t),t的单位是弧度 % 3、当为n时,只要将 n*采样间隔dt 就得到对应的真实的sin(t)
例2-20 将-100~100的序号序列给出的正弦信号压缩、扩展2倍并与元信号进行比较,时间间隔是0.3s
最新推荐文章于 2020-09-04 16:55:42 发布