Modulate using Mary phase shift keying
Communications Toolbox / Modulation / Digital Baseband Modulation / PM
The MPSK Modulator Baseband block modulates an input signal using Mary phase shift keying (PSK) and returns a complex baseband output. The modulation order, M, which is equivalent to the number of points in the signal constellation, is determined by the Mary number parameter. The block accepts scalar or column vector input signals.
Data Types 

Multidimensional Signals 

VariableSize Signals 

^{[a]} ufix(1) at the input if ''input type'' is set to ''bit''. ufix(ceil(log2(M))) at input if ''input type'' is set to ''integer'' for Mary modulation. ^{[b]} Fixedpoint outputs must be signed. 
The MPSK Modulator Baseband block provides the capability to visualize a signal constellation from the block mask. Clicking the View Constellation button allows you to visualize a signal constellation for the specified block parameters.
The block outputs a baseband signal by mapping input bits or integers to complex symbols according to the following:
$${s}_{n}(t)=\mathrm{exp}\left(j\pi \left(\frac{2n+1}{M}\right)\right);\text{\hspace{1em}}n\in \{0,1,\dots ,M1\}.$$
This applies when a natural binary ordering is used. Another common mapping is Gray coding, which has the advantage that only one bit changes between adjacent constellation points. This results in better bit error rate performance. For 8PSK modulation with Gray coding, the mapping between the input and output symbols is shown.
Input  Output 

0  0 (000) 
1  1 (001) 
2  3 (011) 
3  2 (010) 
4  6 (110) 
5  7 (111) 
6  5 (101) 
7  4 (100) 
The corresponding constellation diagram follows.
When the input signal is composed of bits, the block accepts binaryvalued inputs that represent integers. The block collects binaryvalued signals into groups of log_{2}(M) bits.