⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpfskmod_new.m

📁 一个仿真测试4FSK信号的matlab环境GUI程序。可以查看基带IQ波形、眼图、星座图。并可以仿真高斯白噪声、瑞利衰减对信号的影响。
💻 M
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -