When we enable the “diff” option in the built-in function “mskmod”, MATLAB performs differential encoding internally on the input binary data before applying the MSK modulation. Differential encoding encodes the difference between successive symbols, rather than the symbols themselves. Please find a simplified explanation of the process using an example below-
- Input Data: Suppose your input is a binary vector: data = [1 0 1 1 0]
- Initial Reference Bit: MATLAB starts with an initial reference bit, usually assumed to be 0.
- Differential Encoding Rule: Each output bit is computed as:
where:
di is the differentially encoded bit,
di−1 is the previous encoded bit,
bi is the current input bit,
⊕ denotes XOR.
- Result: The encoded sequence is then passed to the MSK modulator.
I have also attached a reference code snippet below for a better understanding-
y = mskmod(x, nsamp, 'diff')
If the original bits were:
Differential encoding might interpret this as:
diff_encoded = [1 1 0 1 1]
The above data is what “mskmod” function sees as the actual data for modulation. For a more detailed explanation on this function, please refer to the documentation link below-
I hope the above explanation answers your query.