mpsk_pulses.m
来自「时变通信系统的仿真」· M 代码 · 共 17 行
M
17 行
function [x] =mpsk_pulses(M,nsymbols,nsamples)
% Software given here is to accompany the textbook: W.H. Tranter,
% K.S. Shanmugan, T.S. Rappaport, and K.S. Kosbar, Principles of
% Communication Systems Simulation with Wireless Applications,
% Prentice Hall PTR, 2004.
%
% This function genrates a random MPSK complex NRZ waveform of
% length nsymbols; Each symbol is sampled at a rate of nsamples/bit
u = rand(1,nsymbols);rinteger= round ((M*u)+0.5);
phase = pi/M+((rinteger-1)*(2*pi/M));
for m=1:nsymbols
for n=1: nsamples
index = (m-1)*nsamples + n;
x(1,index) = exp(i*phase(m));
end
end
% End of function file.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?