Demodulate DPSK data in a communication channel in which a phase shift is introduced.
Generate a 4-ary data vector and modulate it using DPSK.
M = 4; % Alphabet size
dataIn = randi([0 M-1],1000,1); % Random message
txSig = dpskmod(dataIn,M); % Modulate
Apply the random phase shift resulting from the transmission process.
rxSig = txSig*exp(2i*pi*rand());
Demodulate the received signal.
dataOut = dpskdemod(rxSig,M);
The modulator and demodulator have the same initial condition. However, only the received signal experiences a phase shift. As a result, the first demodulated symbol is likely to be in error. Therefore, you should always discard the first symbol when using DPSK.
Find the number of symbol errors.
errs = symerr(dataIn,dataOut)
errs =
1
One symbol is in error. Repeat the error calculation after discarding the first symbol.
Input signal, specified as a vector or matrix of positive integers.
The elements of x must have values in the range
of [0, M – 1].
Data Types: double
Modulation order, specified as an integer power of two.
Example: 2 | 4 | 16
Data Types: double
Phase rotation of the DPSK modulation, specified in radians
as a real scalar. The total phase shift per symbol is the sum of phaserot and
the phase generated by the differential modulation.
If you specify phaserot as empty, then dpskmod uses
a phase rotation of 0 degrees.
Example: pi/4
Data Types: double
Symbol order, specified as 'bin' or 'gray'.
This argument specifies how the function assigns binary vectors to
corresponding integers.
If symorder is 'bin',
the function uses binary-coded ordering.
If symorder is 'gray',
the function uses a Gray-coded ordering.
Complex baseband representation of a DPSK-modulated output signal,
returned as vector or matrix of complex values. The columns represent
independent channels.
Note
An initial phase rotation of 0 is used in determining the first
element of the output y (or the first row of
y if it is a matrix with multiple rows),
because two successive elements are required for a differential
algorithm.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.