Main Content

mskdemod

Minimum shift keying demodulation

Syntax

z = mskdemod(y,nsamp)
z = mskdemod(y,nsamp,dataenc)
z = mskdemod(y,nsamp,dataenc,ini_phase)
z = mskdemod(y,nsamp,dataenc,ini_phase,ini_state)
[z,phaseout] = mskdemod(...)
[z,phaseout,stateout] = mskdemod(...)

Description

z = mskdemod(y,nsamp)demodulates the complex envelopeyof a signal using the differentially encoded minimum shift keying (MSK) method.nsampdenotes the number of samples per symbol and must be a positive integer. The initial phase of the demodulator is 0. Ifyis a matrix with multiple rows and columns, the function treats the columns as independent channels and processes them independently.

z = mskdemod(y,nsamp,dataenc)specifies the method of encoding data for MSK.dataenccan be either'diff'for differentially encoded MSK or'nondiff'for nondifferentially encoded MSK.

z = mskdemod(y,nsamp,dataenc,ini_phase)specifies the initial phase of the demodulator.ini_phaseis a row vector whose length is the number of channels inyand whose values are integer multiples ofpi/2. To avoid overriding the default value ofdataenc, setdataencto[].

z = mskdemod(y,nsamp,dataenc,ini_phase,ini_state)specifies the initial state of the demodulator.ini_statecontains the last half symbol of the previously received signal.ini_stateis annsamp-by-C matrix, where C is the number of channels iny.

[z,phaseout] = mskdemod(...)returns the final phase ofy, which is important for demodulating a future signal. The outputphaseouthas the same dimensions as theini_phaseinput, and assumes the values0,pi/2,pi, and3*pi/2.

[z,phaseout,stateout] = mskdemod(...)returns the finalnsampvalues ofy, which is useful for demodulating the first symbol of a future signal.stateouthas the same dimensions as theini_stateinput.

Examples

collapse all

Modulate and demodulate a noisy MSK signal. Display the number of received errors.

Define the number of samples per symbol for the MSK signal.

nsamp = 16;

Initialize the simulation parameters.

numerrs = 0; modPhase = zeros(1,2); demodPhase = zeros(1,2); demodState = complex(zeros(nsamp,2));

The main processing loop includes these steps:

  • Generate binary data.

  • MSK modulate the data.

  • Pass the signal through an AWGN channel.

  • Demodulate the MSK signal.

  • Determine the number of bit errors.

foriRuns = 1:20 txData = randi([0 1],100,2); [modSig,modPhase] = mskmod(txData,nsamp,[],modPhase); rxSig = awgn(modSig,20,'measured'); [rxData,demodPhase,demodState] = mskdemod(rxSig,nsamp,[],demodPhase,demodState); numerrs = numerrs + biterr(txData,rxData);end

Display the number of bit errors.

numerrs
numerrs = 0

References

[1]Pasupathy, S., "Minimum Shift Keying: A Spectrally Efficient Modulation".IEEE Communications Magazine, July, 1979, pp. 14–22.

更小ion History

Introduced before R2006a