您当前的位置: 首页 > 

松下J27

暂无认证

  • 3浏览

    0关注

    114博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

数字信号处理 --- 信号的采样和奇妙的混叠(Aliasing) 贰

松下J27 发布时间:2018-05-22 15:35:35 ,浏览量:3

混叠频率的计算

     上次我们讲到如果混叠没能成功避免,那么混叠后的信号就会偷偷混入重建后的信号。那么这个经过伪装的“伪装信号”的频率是多少呢?他会出现在频谱中的哪里呢?这是可以通过精确计算得到的。

     先从奥本海姆的信号与系统中的一幅插图说起,奥本海姆老师想要通过这幅图说明混叠,所绘制的波形为下图公式所示的余弦函数。

     图中的ωo表示原始信号的频率,ωs表示采样频率。这幅图一共有四张,前两张的采样频率分别是原始频率的6倍和3倍,所以重建后的信号并没有出现混叠如下图所示。

点击图像放大

由于我很喜欢这个例子,所以我就用matlab把它仿真了一下。此处我的余弦函数的采样频率为60Hz, 所以第一个连续信号(下图中第一行)的原始频率为10Hz, 此时采样频率为原始信号频率的6倍。第二个连续信号(下图中第三行)的原始频率为20Hz, 此时采样频率为原始信号频率的3倍。(箭头没能仿真成功,嘻嘻)

点击图像放大

Matlab代码如下:

%CSDN:by J27 copyright!
%% sampling freqency 6 times continous signal  
Fs = 60;                        % Sampling Freq. 
Fo = Fs/6;                      % freq. of continous Signal  
T = 1/Fs;                       % sampling period
tmin = -pi/15.7;                % lower limit of time vector
tmax = pi/15.7;                 % upper limit of time vector
Bins = 400;                     % Number of Bins
t = linspace(tmin, tmax, Bins); % time space vector
nmin = ceil(tmin / T);          % lower limit of num vector
nmax = floor(tmax / T);         % upper limit of num vector
n = nmin:nmax;                  % discrete space vector

CosineSignal = cos(2.*pi.*Fo.*t);
SampleSignal = cos(2.*pi.*Fo.*n.*T);

subplot(4,1,1)
plot(t,CosineSignal,'k','LineWidth',2);
title('\fontsize{35}Sampling freqency 6 times continous signal. i.e. Proper sampling');
hold on
stem(n*T,SampleSignal,'r','filled','LineWidth',2)
hold off

subplot(4,1,2)
plot(t,CosineSignal,'--k','LineWidth',2);
title('\fontsize{35}Rebuild continous signal with sampled discrete signal');
hold on
stem(n*T,SampleSignal,'r','filled','LineWidth',2)
hold off

%% sampling freqency 3 times continous signal  
Fs = 60;                        % Sampling Freq. 
Fo = Fs/3;                      % freq. of continous Signal  
T = 1/Fs;                       % sampling period
tmin = -pi/15.7;                % lower limit of time vector
tmax = pi/15.7;                 % upper limit of time vector
Bins = 400;                     % Number of Bins
t = linspace(tmin, tmax, Bins); % time space vector
nmin = ceil(tmin / T);          % lower limit of num vector
nmax = floor(tmax / T);         % upper limit of num vector
n = nmin:nmax;                  % discrete space vector

CosineSignal = cos(2.*pi.*Fo.*t);
SampleSignal = cos(2.*pi.*Fo.*n.*T);

subplot(4,1,3)
plot(t,CosineSignal,'k','LineWidth',2);
title('\fontsize{35}Sampling freqency 3 times continous signal. i.e. Proper sampling');
hold on
stem(n*T,SampleSignal,'r','filled','LineWidth',2)
hold off

subplot(4,1,4)
plot(t,CosineSignal,'--k','LineWidth',2);
title('\fontsize{35}Rebuild continous signal with sampled discrete signal');
hold on
stem(n*T,SampleSignal,'r','filled','LineWidth',2)
hold off    

     在用matlab仿真时,重建信号(即图像中灰色虚线)的频率由于没有出现混叠。则在用matlab绘制图像时,重建的COS波形的频率沿用了原始信号的频率Fo。但在仿真下面图像时就必须要精确的计算出混叠后的频率Fs才能绘制出混叠信号的波形。

点击图像放大

     要想画出上图中的虚线,即伪装后变慢了的信号,必须要精确的知道信号变慢了多少。对于欠采样不太严重的情况(即,原始频率小于采样频率但大于采样频率的一半。Fs/2

关注
打赏
1660635678
查看更多评论
立即登录/注册

微信扫码登录

0.0400s