Main Content

comm.DBPSKDemodulator

Demodulate using DBPSK method

Description

The comm.DBPSKDemodulator System object™ demodulates a signal that was modulated using the differential binary phase shift keying (DBPSK) method. The input is the baseband representation of the modulated signal.

To demodulate a DBPSK-modulated signal:

  1. Create the comm.DBPSKDemodulator 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

dbpskdemod = comm.DBPSKDemodulator creates a DBPSK demodulator System object, dbpskdemod. This object demodulates the input signal using the DBPSK method.

dbpskdemod = comm.DBPSKDemodulator(phase) additionally sets the PhaseRotation property to phase.

dbpskdemod = comm.DBPSKDemodulator(___,Name=Value) creates a DBPSK demodulator object using any of the previous syntaxes and sets properties using one or more name-value arguments. For example, OutputDataType="double" sets the data type of output to "double".

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.

Additional phase shift in radians, specified as a scalar. This value corresponds to the phase difference between previous and current modulated bits when the input is zero.

Data Types: double

Decision method for the demodulation, specified as "Hard decision" or "Approximate log-likelihood ratio". When set to "Hard decision", the demodulator outputs a column vector of bit values. When set to "Approximate log-likelihood ratio", the object generates positive values for 0s and negative values for 1s.

Source of the noise variance, specified as "Property" or "Input port".

Dependencies

To enable this property, set the DecisionMethod property to "Approximate log-likelihood ratio".

Noise variance, specified as a nonnegative scalar.

Dependencies

To enable this property, set the VarianceSource property to "Property".

Data Types: double

Output data type, specified as "Full precision", "Smallest unsigned integer", "double", "single", "int8", "uint8", "int16", "uint16", "int32", "uint32", or "logical".

Dependencies

To enable this property, set the DecisionMethod property to "Hard decision". When you set DecisionMethod to "Approximate log-likelihood ratio", the output data type matches the input data type.

Usage

Description

Y = dbpskdemod(X) applies DBPSK demodulation to the DBPSK-modulated waveform and returns the demodulated input signal.

example

Y = dbpskdemod(X,nvar) returns the GMSK-demodulated input signal with the Variance property set to nvar. This syntax applies when you set VarianceSource to "Input port" and DecisionMethod to "Approximate log-likelihood ratio".

Input Arguments

expand all

Input data, specified as a scalar or column vector.

Data Types: single | double
Complex Number Support: Yes

Noise variance, specified as a nonnegative scalar.

Dependencies

To enable this argument, set VarianceSource to "Input port" and DecisionMethod to "Approximate log-likelihood ratio".

Data Types: single | double

Output Arguments

expand all

Output data, returned as a scalar or column vector. Y is of the same length as X. The values returned in Y depend on the DecisionMethod property setting.

  • When you set DecisionMethod to "Hard decision", Y is a column vector with element values of 0 or 1.

  • When you set DecisionMethod to 'Approximate log-likelihood ratio', Y is a column vector of approximate log-likelihood ratios with positive values representing 0s and negative values representing 1s.

To specify the output data type, use the OutputDataType property. However, When you set DecisionMethod to "Approximate log-likelihood ratio", the output data type matches the input data type.

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

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

Create a DBPSK modulator and demodulator pair.

dbpskmod = comm.DBPSKModulator(pi/4);
dbpskdemod = comm.DBPSKDemodulator(pi/4);

Create an error rate calculator. Set the ComputationDelay property to 1 to account for the one bit transient caused by the differential modulation.

errorRate = comm.ErrorRate('ComputationDelay',1);

Process the signal. The process includes these steps:

  1. Generate 50-bit frames.

  2. DBPSK-modulate the signal.

  3. Pass the modulated signal through an AWGN channel.

  4. DBPSK-demodulate the noisy signal.

  5. Collect error statistics.

for counter = 1:100
    txData = randi([0 1],50,1);
    modSig = dbpskmod(txData);
    rxSig = awgn(modSig,7);
    rxData = dbpskdemod(rxSig);
    errorStats = errorRate(txData,rxData);
end

Display the error statistics.

ber = errorStats(1)
ber = 
0.0034
numErrors = errorStats(2)
numErrors = 
17
numBits = errorStats(3)
numBits = 
4999

Create a differential binary phase shift keying (DBPSK) modulator object

DBPSKMod = comm.DBPSKModulator;

Create a DBPSK demodulator object with approximate log-likelihood ratio decision method.

DBPSKDemod = comm.DBPSKDemodulator(DecisionMethod="Approximate log-likelihood ratio");

Create an error rate calculator object with a computation delay of 1.

ber = comm.ErrorRate(ComputationDelay=1);

Loop to simulate transmission and reception of 10 frames

for counter = 1:10
% Transmit a 100-symbol frame
data = randi([0 1],100,1);                % Generate random binary data
modSignal = DBPSKMod(data);               % Modulate the data using DBPSK
noisySignal = awgn(modSignal,5);          % Pass the modulated signal through AWGN channel
receivedData = DBPSKDemod(noisySignal);   % Demodulate the received signal
errorStats = ber(data, receivedData < 0); % Calculate the error statistics
end

Display the error rate and the number of errors after all iterations.

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

Algorithms

The DBPSK demodulator compares the current symbol to the previous symbol. It maps phase differences of θ and π+θ to outputs of 0 and 1, respectively, where θ is the PhaseRotation parameter.

Extended Capabilities

Version History

Introduced in R2012a

expand all