[转载]用matlab对象进行数字基带调制解调(MPSK)_akala啦_新浪博客

%% 仿真实现基带M-PSK调制与解调
%% 利用Matlab modem object
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   h = modem.pskmod(M)
%   h = modem.pskmod(M, phaseoffset)
%   h = modem.pskmod(property1, value1, ...)
%   h = modem.pskmod(PSKdemod_object)
%   h = modem.pskmod(PSKdemod_object, property1,value1, ...)
%   h = modem.pskmod
%   if you have creat an object h for PSK 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.pskdemod(M)
%   h = modem.pskdemod(M, phaseoffset)
%   h = modem.pskdemod(property1, value1, ...)
%   h = modem.pskdemod
%   h = modem.pskdemod(pskmod_object)
%   h = modem.pskdemod(pskmod_object, property1,value1, ...)
%   if you have creat an object h for PSK demodulate, then the method
%   'demodulate' can be used such as
%   y = demodulate(h, x)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
clear all
close all hidden
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

M = 16;                   % The order for modulate of PSK
nPacket = 5000;           % The signal length
x = randint(nPacket,1,M); % Signal for modulate

h = modem.pskmod(M);      % Creat an object of PSK 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.pskdemod(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.pskdemod(M);
z = demodulate(h,ydownsamp);
[num,rt]= symerr(x,z)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值