# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# comm.PAMModulator System object

Package: comm

Modulate using M-ary PAM method

## Description

The `PAMModulator` object modulates using M-ary pulse amplitude modulation. The output is a baseband representation of the modulated signal. The M-ary number parameter, M, represents the number of points in the signal constellation and requires an even integer.

To modulate a signal using M-ary pulse amplitude modulation:

1. Define and set up your PAM modulator object. See Construction.

2. Call `step` to modulate the signal according to the properties of `comm.PAMModulator`. The behavior of `step` is specific to each object in the toolbox.

 Note:   Starting in R2016b, instead of using the `step` method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, ```y = step(obj,x)``` and `y = obj(x)` perform equivalent operations.

## Construction

`H = comm.PAMModulator` creates a modulator System object, `H`. This object modulates the input signal using the M-ary pulse amplitude modulation (M-PAM) method.

`H = comm.PAMModulator(Name,Value)` creates an M-PAM modulator object, `H`, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (`Name1`,`Value1`,...,`NameN`,`ValueN`).

`H = comm.PAMModulator(M,Name,Value)` creates an M-PAM modulator object, `H`. This object has the `ModulationOrder` property set to `M` and the other specified properties set to the specified values.

## Properties

 `ModulationOrder` Number of points in signal constellation Specify the number of points in the signal constellation as a positive, integer scalar value. The default is `4`. When you set the `BitInput` property to `false`, ModulationOrder must be even. When you set the `BitInput` property to `true`, ModulationOrder must be an integer power of two. `BitInput` Assume bit inputs Specify whether the input is in bits or integers. The default is `false`. When you set this property to `true`, the `step` method input requires a column vector of bit values whose length is an integer multiple of log2(`ModulationOrder`). This vector contains bit representations of integers between `0` and `ModulationOrder`–1. When you set this property to `false`, the `step` method input must be a column vector of integer symbol values between `0` and `ModulationOrder`–1. `SymbolMapping` Constellation encoding Specify how the object maps an integer or group of log2(`ModulationOrder`) input bits to the corresponding symbol as one of `Binary` | `Gray`. The default is `Gray`. When you set this property to `Gray`, the object uses a Gray-encoded signal constellation. When you set this property to `Binary`, the input integer m, between $0\le m\le$`ModulationOrder`-1) maps to the complex value 2m– `ModulationOrder` + 1. `NormalizationMethod` Constellation normalization method Specify the method used to normalize the signal constellation as one of `Minimum distance between symbols` | ```Average power``` | `Peak power`. The default is ```Minimum distance between symbols```. `MinimumDistance` Minimum distance between symbols Specify the distance between two nearest constellation points as a positive, real, numeric scalar value. The default is `2`. This property applies when you set the `NormalizationMethod` property to `Minimum distance between symbols`. `AveragePower` Average power of constellation Specify the average power of the symbols in the constellation as a positive, real, numeric scalar value. The default is `1`. This property applies when you set the `NormalizationMethod` property to `Average power`. `PeakPower` Peak power of constellation Specify the maximum power of the symbols in the constellation as a positive, real, numeric scalar value. The default is `1`. This property applies when you set the `NormalizationMethod` property to `Peak power`. `OutputDataType` Data type of output Specify the output data type as one of `double` | `single` | `Custom`. The default is `double`.

## Methods

 clone Create PAM modulator object with same property values constellation Calculate or plot ideal signal constellation getNumInputs Number of expected inputs to step method getNumOutputs Number of outputs from step method isLocked Locked status for input attributes and nontunable properties release Allow property value and input characteristics changes step Modulate using M-ary PAM method

## Examples

Modulate data using 16-PAM modulation, and visualize the data in a scatter plot.

``` % Create binary data for 100, 4-bit symbols data = randi([0 1],400,1); % Create a 16-PAM modulator System object with bits as inputs and % Gray-coded signal constellation hModulator = comm.PAMModulator(16,'BitInput',true); % Modulate and plot the data modData = step(hModulator, data); constellation(hModulator)```

## Algorithms

This object implements the algorithm, inputs, and outputs described on the M-PAM Modulator Baseband block reference page. The object properties correspond to the block parameters.