This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

comm.BPSKDemodulator System object

Package: comm

Demodulate using BPSK method


The BPSKDemodulator object demodulates a signal that was modulated using the binary phase shift keying method. The input is a baseband representation of the modulated signal.

To demodulate a binary phase shift signal:

  1. Define and set up your BPSK demodulator object. See Construction.

  2. Call step to demodulate a signal according to the properties of comm.BPSKDemodulator. 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.


H = comm.BPSKDemodulator creates a demodulator System object, H, that demodulates the input signal using the binary phase shift keying (BPSK) method.

H = comm.BPSKDemodulator(Name,Value) creates a BPSK demodulator 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.BPSKDemodulator(PHASE,Name,Value) creates a BPSK demodulator object, H, with the PhaseOffset property set to PHASE, and the other specified properties set to the specified values.



Phase of zeroth point of constellation

Specify the phase offset of the zeroth point of the constellation, in radians, as a finite, real scalar. The default is 0.


Demodulation decision method

Specify the decision method the object uses as one of Hard decision | Log-likelihood ratio | Approximate log-likelihood ratio. The default is Hard decision.


Source of noise variance

Specify the source of the noise variance as one of Property | Input port. The default is Property. This property applies when you set the DecisionMethod property to Log-likelihood ratio or Approximate log-likelihood ratio.


Noise variance

Specify the variance of the noise as a nonzero, real scalar. The default is 1. If this value is very small (i.e., SNR is very high), log-likelihood ratio (LLR) computations can yield Inf or -Inf. This variance occurs because the LLR algorithm computes the exponential of very large or very small numbers using finite precision arithmetic. As a best practice in such cases, use approximate LLR because this option's algorithm does not compute exponentials. This property applies when you set the VarianceSource property to Property. This property is tunable.


Data type of output

Specify the output data type as one of Full precision | Smallest unsigned integer | double | single | int8 | uint8 | int16 | uint16 | int32 | uint32 | logical. The default is Full precision. This property applies only when you set the DecisionMethod property to Hard decision. Thus, when you set the OutputDataType property to Full precision, and the input data type is single or double precision, the output data has the same data type as the input. If the input data is of a fixed-point type, then the output data type behaves as if you had set the OutputDataType property to Smallest unsigned integer. If you set the DecisionMethod property to Log-likelihood ratio or Approximate log-likelihood ratio, the output data type is the same as that of the input. In this case, that data type can only be single or double precision.

When the input signal is an integer data type, you must have a Fixed-Point Designer™ user license to use this property in Smallest unsigned integer or Full precision mode.

 Fixed-Point Properties


cloneCreate BPSK demodulator object with same property values
constellationCalculate or plot ideal signal constellation
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
stepDemodulate using BPSK method


expand 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

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


This object implements the algorithm, inputs, and outputs described on the BPSK Demodulator Baseband block reference page. The object properties correspond to the block parameters.

Introduced in R2012a

Was this topic helpful?