Main Content

comm.BPSKModulator

(To be removed) Modulate using BPSK method

comm.BPSKModulator will be removed in a future release. Use pskmod instead. For information on updating your code, see Version History.

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.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

bpskmodulator = comm.BPSKModulator creates a modulator System object™ to modulate input signals using the binary phase shift keying (BPSK) method.

example

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.

For more information on changing property values, see System Design in MATLAB Using System Objects.

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

Description

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

example

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

constellationCalculate or plot ideal signal constellation
stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Generate a BPSK signal, pass it through an AWGN channel, demodulate the signal, and compute the error statistics.

Create BPSK modulator and demodulator System objects.

bpskModulator = comm.BPSKModulator;
bpskDemodulator = comm.BPSKDemodulator;

Create an error rate calculator System object.

errorRate = comm.ErrorRate;

Generate 50-bit random data frames, apply BPSK modulation, pass the signal through an AWGN channel, demodulate the received data, and compile the error statistics.

for counter = 1:100
    % Transmit a 50-symbol frame
    txData = randi([0 1],50,1);            % Generate data
    modSig = bpskModulator(txData);        % Modulate
    rxSig = awgn(modSig,5);                % Pass through AWGN
    rxData = bpskDemodulator(rxSig);       % Demodulate
    errorStats = errorRate(txData,rxData); % Collect error stats
end

Display the cumulative error statistics.

fprintf('Error rate = %f\nNumber of errors = %d\n', ...
    errorStats(1), errorStats(2))
Error rate = 0.005600
Number of errors = 28

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

sn(t)=2EbTbcos(2πfct+ϕn),

for (n1)TbtnTb, n=1,2, 3, where:

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

  • ϕ is the initial phase offset.

  • 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

sn(t)=eiϕn=cos(πn).

The BPSK signal has two phases: 0 and π.

BPSK constellation for zero phase offset

The probability of a bit error in an AWGN channel is

Pb=Q(2EbN0),

where N0 is the noise power spectral density.

Extended Capabilities

Version History

Introduced in R2012a

collapse all

R2023a: To be removed

comm.BPSKModulator will be removed in a future release. Use the pskmod function with the modulation order set to 2 to BPSK modulate the input signal.

See Also

Functions

Blocks