# comm.BPSKModulator

Modulate using BPSK method

## Description

The `comm.BPSKModulator` object modulates using the binary phase shift keying method. The output is a baseband representation of the modulated signal. The input signal must be a discrete-time binary-valued signal. If the input bit is 0 or 1, then the modulated symbol is exp(jθ) or -exp(jθ), respectively. The `PhaseOffset` property specifies the value of θ in radians.

To modulate a signal using BPSK method:

1. Create the `comm.BPSKModulator` object and set its properties.

2. Call the object with arguments, as if it were a function.

## Creation

### Syntax

``bpskmodulator = comm.BPSKModulator``
``bpskmodulator = comm.BPSKModulator(Name,Value)``
``bpskmodulator = comm.BPSKModulator(phase,Name,Value)``

### Description

example

````bpskmodulator = comm.BPSKModulator` creates a modulator System object™ to modulate input signals using the binary phase shift keying (BPSK) method.```
````bpskmodulator = comm.BPSKModulator(Name,Value)` creates a BPSK modulator object 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`).```
````bpskmodulator = comm.BPSKModulator(phase,Name,Value)` creates a BPSK modulator object with the `PhaseOffset` property set to `phase`, and the other specified properties set to the specified values.```

## Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the `release` function unlocks them.

If a property is tunable, you can change its value at any time.

Phase of zeroth point of the constellation in radians, specified as a scalar.

Data Types: `double`

Output datatype, specified as `'double'`, `'single'` or `'Custom'`.

Data Types: `char`

Fixed-Point Properties

Fixed-point data type of the output, specified as a `numerictype` (Fixed-Point Designer) object with a signedness of Auto.

#### Dependencies

This property applies when you set the `OutputDataType` property to `'Custom'`.

## Usage

### Syntax

``waveform = bpskmodulator(data)``

### Description

example

````waveform = bpskmodulator(data)` applies BPSK modulation to the input data and returns the modulated BPSK baseband signal.```

### Input Arguments

expand all

Input signal data, specified as a column vector or matrix.

Data Types: `double`

### Output Arguments

expand all

BPSK modulated baseband signal, returned as a column vector or matrix of the same size as the input signal. For more information about the output datatype, see the `OutputDataType` property.

Data Types: `double` | `single` | `fi`
Complex Number Support: Yes

## Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named `obj`, use this syntax:

`release(obj)`

expand all

 `constellation` Calculate or plot ideal signal constellation
 `step` Run System object algorithm `release` Release resources and allow changes to System object property values and input characteristics `reset` Reset internal states of System object

## Examples

collapse all

This example creates binary data, modulates it, and then displays the data using a scatter plot.

Create binary data symbols

`data = randi([0 1],100,1);`

Create a BPSK modulator System object

`bpskModulator = comm.BPSKModulator;`

Change the phase offset to pi/16

`bpskModulator.PhaseOffset = pi/16;`

Modulate and plot the data

```modData = bpskModulator(data); scatterplot(modData)```

## Algorithms

Phase modulation is a linear baseband modulation technique in which the message modulates the phase of a constant amplitude signal. Binary Phase Shift Keying (BPSK) is a two phase modulation scheme, where the 0’s and 1’s in a binary message are represented by two different phase states in the carrier signal

`${s}_{n}\left(t\right)=\sqrt{\frac{2{E}_{b}}{{T}_{b}}}\mathrm{cos}\left(2\pi {f}_{c}t+{\varphi }_{n}\right),$`

for where:

• ϕn = πm, m∈{0,1}.

• Eb is the energy per bit.

• Tb is the bit duration.

• fc is the carrier frequency.

In MATLAB®, the baseband representation of a BPSK signal is

`${s}_{n}\left(t\right)={e}^{-i{\varphi }_{n}}=\mathrm{cos}\left(\pi n\right).$`

The BPSK signal has two phases: 0 and π. The probability of a bit error in an AWGN channel is

`${P}_{b}=Q\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right),$`

where N0 is the noise power spectral density.

## Extended Capabilities

### Blocks

Introduced in R2012a