增量调制原理matlab仿真,增量调制(DM  △M)

a4c26d1e5885305701be709a3d33442f.png

% To generate DM signals with different step sizes, we apply

the

% same signal g(t) as used in the PCM example.

% The MATLAB program ExDM.m applies three step sizes:

% △1=0.2, △2=2△1, and △3=4△1.

% ( file name: ExDM.m )

% Example of sampling, quantization, and zero-order hold

clear; clf;

td=0.002; % original sampling

rate 500 Hz

t=[0:td:1.]; % time interval of 1 second

xsig=sin(2*pi*t)-sin(6*pi*t); %

1Hz+3Hz sinusoids

Lsig=length(xsig);

ts=0.02;

Nfact=ts/td;

% send the signal through a

16-level uniform quantizer

Delta=0.2; % First select a small Delta=0.2 in

DM

s_DMout1=deltamod(xsig,Delta,td,ts);

% obtained the DM signal

% plot the original signal and

the DM signal in time domain

figure(1);

subplot(311); sfig1=plot(t,xsig,'r',t,s_DMout1(1:Lsig),'b');

set(sfig1,'Linewidth',2);

title(' Signal {\it g}({\it t}) and DM signal ')

xlabel('time (sec.)'); axis([0 1 -2.2 2.2]);

ylabel('△1=0.2');

%

% Apply DM again by doubling

the Delta

Delta2=2*Delta;

s_DMout2=deltamod(xsig,Delta2,td,ts);

% obtained the DM signal

% plot the original signal and

the DM signal in time domain

subplot(312); sfig2=plot(t,xsig,'r',t,s_DMout2(1:Lsig),'b');

set(sfig2,'Linewidth',2);

title(' Signal {\it g}({\it t}) and DM signal with doubled

stepsize')

xlabel('time (sec.)'); axis([0 1 -2.2 2.2]);

ylabel('△2=2△1');

%

Delta3=2*Delta2; % Double the DM Delta again

s_DMout3=deltamod(xsig,Delta3,td,ts);

% obtained the DM signal

% plot the original signal and

the DM signal in time domain

subplot(313); sfig3=plot(t,xsig,'r',t,s_DMout3(1:Lsig),'b');

set(sfig3,'Linewidth',2);

title(' Signal {\it g}({\it t}) and DM signal with quadrupled

stepsize')

xlabel('time (sec.)'); axis([0 1 -2.2 2.2]); ylabel('△3=4△1');

%

-------------------------------------------------------------

% 程序调用函数

%

-------------------------------------------------------------

% Delta Modulation

% We illustrate the practical effect of stepsize selection △

% in the design of DM encoder. The basic function to

% implement DM is given deltamod.m.

% ( file name: deltamod.m )

function s_DMout= deltamod(sig_in,Delta,td,ts)

% Usage

% s_DMout = deltamod(xsig,Delta,td,ts)

% Delta - DM stepsize

% sig_in - input signal

vector

% td - original signal sampling

period of sig_in

% ts - new sampling

period

% NOTE: td*fs must be a positive integer;

% Function outputs:

% s_DNout - DM sampled output

if (rem(ts/td,1)==0)

nfac=round(ts/td);

p_zoh=ones(1,nfac);

s_down=downsample(sig_in,nfac);

Num_it=length(s_down);

s_DMout(1)=-Delta/2;

for

k=2:Num_it

xvar=s_DMout(k-1);

s_DMout(k)=xvar+Delta*sign(s_down(k-1)-xvar);

end

s_DMout=kron(s_DMout,p_zoh);

else

warning('error! ts/td is not an integer!');

s_DMout=[];

end

end

%

-------------------------------------------------------------------------------------

% 参考文献

% B.P.拉兹,丁峙. 现代数字与模拟通信系统[M]. 第4版. 北京:电子工业出版社,2011:368-371

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值