当采样频率ws=2wm时,称为临界采样。据此可知:下列程序实现对信号Sa(t)的临界采样及由采样信号恢复Sa(t):
程序如下:
wm=1wc=wm
Ts=pi/wmws=2*pi/Ts
n=-170:170nTs=n*Ts f=sinc(nTs/pi)
Dt=0.005t=-45:Dt:45
fa=f*Ts*wc/pi*sinc((wc/pi)*(ones(length(nTs),1)*t-nTs'*ones(1,length(t))))
t1=-25:0.5:25
f1=sinc(t1/pi)subplot(211)stem(t1,f1)xlabel('kTs')
ylabel('f(kTs)')
title('sa(t)=sinc(t/pi)的临界采样信号')
subplot(212)plot(t,fa) xlabel('t')ylabel('fa(t)')
title('由sa(t)=sinc(t/pi)的临界采样信号重构sa(t)')grid
过采样及其重构 ,当ws>2wm时则称采样为过采样,所以令wm=1,wc=1.1*wm,Ts=0.8*pi/wm,ws=2*pi/Ts则下列程序实现对信号Sa(t)的临界采样及由采样信号恢复Sa(t):
wm=1wc=1.1*wm
Ts=0.8*pi/wmws=2*pi/Ts
n=-170:170nTs=n*Ts f=sinc(nTs/pi)
Dt=0.005t=-45:Dt:45
fa=f*Ts*wc/pi*sinc((wc/pi)*(ones(length(nTs),1)*t-nTs'*ones(1,length(t))))
error=abs(fa-sinc(t/pi))
t1=-25:0.5:25
f1=sinc(t1/pi)subplot(311)stem(t1,f1)xlabel('kTs')
ylabel('f(kTs)')
title('sa(t)=sinc(t/pi)的采样信号')
subplot(312)plot(t,fa) xlabel('t')ylabel('fa(t)')
title('由sa(t)=sinc(t/pi)的过采样信号重构sa(t)')
grid subplot(313)plot(t,error)xlabel('t')ylabel('error(t)')
title('过采样信号与原信号的误差error(t)')
3、欠采样及其重构 令wm=1,wc=wm,ws=1.3*pi/wm,这种采样信号被称为欠采样信号,这种信号的重构被称为欠采样信号的重构,具体程序如下:
wm=1wc=wm
Ts=1.3 *pi/wmws=2*pi/Ts
n=-170:170nTs=n*Ts f=sinc(nTs/pi)
Dt=0.005t=-45:Dt:45
fa=f*Ts*wc/pi*sinc((wc/pi)*(ones(length(nTs),1)*t-nTs'*ones(1,length(t))))
error=abs(fa-sinc(t/pi))
t1=-25:0.5:25
f1=sinc(t1/pi)subplot(311)
stem(t1,f1)
xlabel('kTs')ylabel('f(kTs)')
title('sa(t)=sinc(t/pi)的采样信号')subplot(312)plot(t,fa) xlabel('t')ylabel('fa(t)')
title('由sa(t)=sinc(t/pi)的欠采样信号重构sa(t)')gridsubplot(313)plot(t,error)xlabel('t')ylabel('error(t)')
title('欠采样信号与原信号的误差error(t)')
m=0:50*3-1 %解释:m是从0~149的150个数,即,0,1,2....149x=sin(2*pi*0.042*m)
y=x([1:3:length(x)]) %x是一个数据数组,y每隔3个,采样x里的数据。也就是,如果x=1 2 3 4
那么y=1 4
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)