pammod
Pulse amplitude modulation (PAM)
Description
Examples
Modulate Data Symbols with PAM
Generate random data symbols and apply pulse amplitude modulation.
Set the modulation order.
M = 8;
Generate random integers and apply PAM modulation having an initial phase of /4.
data = randi([0 M-1],100,1); modData = pammod(data,M,pi/4);
Display the PAM constellation diagram.
scatterplot(modData)
PAM Symbol Mapping
Plot PAM symbol mapping for Gray-coded and binary-coded data.
Set the modulation order, and then create a data sequence containing a complete set of constellation points.
M = 8; data = 0:M-1;
Modulate and demodulate Gray and natural binary encoded data.
symgray = pammod(data,M,0,'gray'); mapgray = pamdemod(symgray,M,0,'gray'); symbin = pammod(data,M,0,'bin'); mapbin = pamdemod(symbin,M,0,'bin');
Plot the constellation points using one of the symbol sets. For each constellation point, assign a label indicating the Gray-coded and binary-coded values for each symbol.
For Gray-code symbol mapping, adjacent constellation points differ by a single bit and are not numerically sequential.
For binary-coded mapping, adjacent constellation points follow the binary encoding and are sequential.
scatterplot(symgray,1,0,'b*'); for k = 1:M text(real(symgray(k))-0.6,imag(symgray(k))+0.6,... dec2base(mapgray(k),2,4)); text(real(symgray(k))-0.2,imag(symgray(k))+1.2,... num2str(mapgray(k))); text(real(symbin(k))-0.6,imag(symbin(k))-0.6,... dec2base(mapbin(k),2,4),'Color',[1 0 0]); text(real(symbin(k))-0.2,imag(symbin(k))-1.2,... num2str(mapbin(k)),'Color',[1 0 0]); end axis([-M M -2 2])
Input Arguments
x
— Input signal
vector | matrix
Input signal, specified as a vector or matrix of integers in the range of [0,
M
– 1].
Example: randi([0 3],100,1)
Data Types: double
M
— Modulation order
positive integer power of two
Modulation order, specified as a positive integer power of two.
Example: 4
Data Types: double
initphase
— Initial phase
0
(default) | real-valued scalar | []
Initial phase of the modulated signal (in radians), specified as a real scalar.
Example: pi/4
Data Types: double
symorder
— Mapping order for modulation symbols
'bin'
(default) | 'gray'
Mapping order for the modulation symbols, specified as 'bin'
or
'gray'
. This argument specifies how the function assigns binary
vectors to corresponding integers.
If
symorder
is'bin'
, the function uses a binary-coded mapping order.If
symorder
is'gray'
, the function uses a Gray-coded mapping order.
Data Types: char
| string
Output Arguments
y
— Complex baseband representation of PAM-modulated signal
vector | matrix
Complex baseband representation of a PAM-modulated signal, returned as vector or
matrix of complex values. The modulated signal has a minimum Euclidean distance of 2.
The columns of y
represent independent channels.
Data Types: double
| single
Complex Number Support: Yes
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
See Code Generation for Complex Data with Zero-Valued Imaginary Parts (MATLAB Coder).
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)