马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
- <font face="Times New Roman">%% 仿真实现基带M-DPSK调制与解调
- %% 利用Matlab modem object
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % h = modem.dpskmod(property1, value1, ...)
- % h = modem.dpskmod(DPSKdemod_object)
- % h = modem.dpskmod(DPSKdemod_object, property1,value1, ...)
- % h = modem.dpskmod
- % if you have creat an object h for DPSK modulate, then the method
- % 'modulate' can be used to modulate your signal x such as:
- % y = modulate(h, x)
- % and demodulation method need to creat an object
- % h = modem.dpskdemod(property1, value1, ...)
- % h = modem.dpskdemod(DPSKmod_object)
- % h = modem.dpskdemod(DPSKmod_object, property1,value1, ...)
- % h = modem.dpskdemod
- % if you have creat an object h for DPSK demodulate, then the method
- % 'demodulate' can be used such as
- % y = demodulate(h, x)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- clc
- clear all
- close all hidden
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- M = 4; % The order for modulate of DPSK
- nPacket = 5000; % The signal length
- x = randint(nPacket,1,M); % Signal for modulate
- h = modem.dpskmod('M',M); % Creat an object of DPSK modulation
- y = modulate(h,x); % modulate x get y
- scatterplot(y);
- yn = awgn(y,15,'measured'); % Pass the gauss channel with SNR=15dB
- scatterplot(yn);
- reset(h);
- h = modem.dpskdemod('M',M);
- z = demodulate(h,yn);
- [num,rt]= symerr(x,z)
- %% Process rectanglar pulse shaping
- Nsamp = 4; % Oversampling rate
- ypulse = rectpulse(y,Nsamp);
- ynoisy = awgn(ypulse,15,'measured');
- ydownsamp = intdump(ynoisy,Nsamp);
- scatterplot(ydownsamp);
- reset(h);
- h = modem.dpskdemod('M',M);
- z = demodulate(h,ydownsamp);
- [num,rt]= symerr(x,z)</font>
复制代码 转自:http://blog.sina.com.cn/s/blog_5def5a660100j3b9.html
|