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

📄 sinccy.m

📁 这是有关通信中的抽样定理的一些证明,希望能对大家有所启发.
💻 M
字号:
%用sinc函数进行低通抽样定理的证明
clc
clear
a=-5;%信号的起始时间
b=5;%信号的终止时间
fc=1/2;%sinc函数的最高频分量值
ts=1/(16*fc);%为使信号能较平滑的画出,设置的采样时间间隔
fs=1/ts;%由上面的采样时间间隔得到的采样频率
t=a:ts:b;
f=-fs/2+fs/length(t):fs/length(t):fs/2;
y=sinc(2*fc*t);
y_spect=fftshift(abs(fft(y)));
%------
fs1=fc*2;%临界采样频率
ts1=1/fs1;%临界采样的时间间隔
t1=a:ts1:b;
x1=sinc(2*fc*t1);%临界采样得到的采样值
y1=0;%由抽样点的值来重建信号
for i=1:length(x1)
    y1=y1+x1(i)*sinc((t-t1(i))/ts1);
end
y1_spect=fftshift(abs(fft(y1)));%重建信号的频谱
%-----
fs2=fc*1.2;%欠采样频率
ts2=1/fs2;%欠采样的时间间隔
t2=a:ts2:b;
x2=sinc(2*fc*t2);%欠采样得到的采样值
y2=0;%由抽样点的值来重建信号
for i=1:length(x2)
    y2=y2+x2(i)*sinc((t-t2(i))/ts2);
end
y2_spect=fftshift(abs(fft(y2)));%重建信号的频谱
%----
fs3=fc*4;%过采样频率
ts3=1/fs3;%过采样的时间间隔
t3=a:ts3:b;
x3=sinc(2*fc*t3);%过采样得到的采样值
y3=0;%由抽样点的值来重建信号
for i=1:length(x3)
    y3=y3+x3(i)*sinc((t-t3(i))/ts3);
end
y3_spect=fftshift(abs(fft(y3)));%重建信号的频谱
%----
figure(1)
subplot(2,2,1)
plot(t,y,t1,x1,'*black');title('(a)原始信号,黑点为临界采样时的抽样点');grid
subplot(2,2,2)
plot(f,y_spect);title('(b)原始信号的频谱');grid
subplot(2,2,3)
plot(t,y1);title('(c)用临界采样得到的抽样点重建的信号');grid
subplot(2,2,4)
plot(f,y1_spect);title('(d)重建信号的频谱');grid

figure(2)
subplot(2,2,1)
plot(t,y,t2,x2,'*black');title('(a)原始信号,黑点为欠采样时的抽样点');grid
subplot(2,2,2)
plot(f,y_spect);title('(b)原始信号的频谱');grid
subplot(2,2,3)
plot(t,y2);title('(c)用欠采样得到的抽样点重建的信号');grid
subplot(2,2,4)
plot(f,y2_spect);title('(d)重建信号的频谱');grid

figure(3)
subplot(2,2,1)
plot(t,y,t3,x3,'*black');title('(a)原始信号,黑点为过采样时的抽样点');grid
subplot(2,2,2)
plot(f,y_spect);title('(b)原始信号的频谱');grid
subplot(2,2,3)
plot(t,y3);title('(c)用过采样得到的抽样点重建的信号');grid
subplot(2,2,4)
plot(f,y3_spect);title('(d)重建信号的频谱');grid

⌨️ 快捷键说明

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