cpfskmod_new.m
来自「一个仿真测试4FSK信号的matlab环境GUI程序。可以查看基带IQ波形、眼图」· M 代码 · 共 49 行
M
49 行
function y = cpfskmod_new(x,M,h,nSamp,Fd)
% Continous phase FSK modulation program.
% y : the the modulation baseband complex signal
% M : M-array;
% h : modulation index;
% nSamp : samples per symbol;
% Fd : symbol rate
% written by zhengliangde, hyt CO.,LTD.
% contact me : harlemon@126.com
% date: 2006.3.20
% ------------------------------
%M = 4;
%h = 0.27;
%Num = 4800;
%Fd = 4800;
%nSamp = 8;
%rndInt = randsrc(Num,1,[1:M],12345);
%x = 2*rndInt-(M+1);
% -------------------------------
x = x(:);
xIn = (x + (M+1))/2 - 1;
samptime = 1/(Fd*nSamp);
phaseIncr = [0:nSamp-1]'*[-(M-1):2:(M-1)]*pi*(h*Fd)*samptime;
phIncrSamp = phaseIncr(2,:); % recall that phaseIncr(1:0) = 0
prevPhase = 0;
[nRow,nChan] = size(xIn);
if nChan~=1
error('This program does not surpport multiple channel');
return
end
Phase = zeros(nSamp*nRow,1);
for i = 1:nRow
Phase(nSamp*(i-1)+1:nSamp*i) = ...
prevPhase*ones(nSamp,1) + phaseIncr(:,xIn(i)+1);
prevPhase = Phase(nSamp*i) + phIncrSamp(xIn(i)+1);
end
y = exp(j*Phase);
%assignin('base','y',y);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?