# M-FSK Modulator Baseband

Modulate using M-ary frequency shift keying method

## Library

FM, in Digital Baseband sublibrary of Modulation

## Description

The M-FSK Modulator Baseband block modulates using the M-ary frequency shift keying method. The output is a baseband representation of the modulated signal. For information about the data types each block port supports, see Supported Data Types.

To prevent aliasing from occurring in the output signal, set the sampling frequency greater than the product of M and the Frequency separation parameter. Sampling frequency is Samples per symbol divided by the input symbol period (in seconds).

### Integer-Valued Signals and Binary-Valued Signals

The input and output signals for this block are discrete-time signals.

When you set the Input type parameter to Integer, the block accepts integer values between 0 and M-1. M represents the M-ary number block parameter.

When you set the Input type parameter to Bit, the block accepts binary-valued inputs that represent integers. The block collects binary-valued signals into groups of K = log2(M) bits

where

K represents the number of bits per symbol.

The input vector length must be an integer multiple of K. In this configuration, the block accepts a group of K bits and maps that group onto a symbol at the block output. The block outputs one modulated symbol, oversampled by the Samples per symbol parameter value, for each group of K bits.

The Symbol set ordering parameter indicates how the block maps a group of K input bits to a corresponding symbol. When you set the parameter to Binary, the block maps [u(1) u(2) ... u(K)] to the integer

$\sum _{i=1}^{K}u\left(i\right){2}^{K-i}$

and assumes that this integer is the input value. u(1) is the most significant bit.

If you set M = 8, Symbol set ordering to Binary, and the binary input word is [1 1 0], the block converts [1 1 0] to the integer 6. The block produces the same output when the input is 6 and the Input type parameter is Integer.

When you set Symbol set ordering to Gray, the block uses a Gray-coded arrangement and assigns binary inputs to points of a predefined Gray-coded signal constellation. The predefined M-ary Gray-coded signal constellation assigns the binary representation

M = 8; P = [0:M-1]';
de2bi(bitxor(P,floor(P/2)), log2(M),'left-msb')

to the Pth integer.

The following tables show the typical Binary to Gray mapping for M = 8.

Binary to Gray Mapping for Bits

Binary CodeGray Code
000000
001001
010011
011010
100110
101111
110101
111100

Binary to Gray Mapping for Integers

Binary CodeGray Code
00
11
23
32
46
57
65
74

### Single-Rate Processing

In single-rate processing mode, the input and output signals have the same port sample time. The block implicitly implements the rate change by making a size change at the output when compared to the input. In this mode, the input to the block can be multiple symbols.

• When you set Input type to Integer, the input can be a column vector, the length of which is the number of input symbols.

• When you set Input type to Bit, the input width must be an integer multiple of K, the number of bits per symbol.

The output width equals the product of the number of input symbols and the Samples per symbol parameter value.

### Multirate Processing

In multirate processing mode, the input and output signals have different port sample times. In this mode, the input to the block must be one symbol.

• When you set Input type to Integer, the input must be a scalar.

• When you set Input type to Bit, the input width must equal the number of bits per symbol.

The output sample time equals the symbol period divided by the Samples per symbol parameter value.

To run the M-FSK Modulator block in multirate mode, clear the Treat each discrete rate as a separate task checkbox (in Simulation > Configuration Parameters > Solver).

## Parameters

M-ary number

The number of frequencies in the modulated signal.

Input type

Indicates whether the input consists of integers or groups of bits. If you set this parameter to Bit, then the M-ary number parameter must be 2K for some positive integer K.

Symbol set ordering

Determines how the block maps each group of input bits to a corresponding integer.

Frequency separation (Hz)

The distance between successive frequencies in the modulated signal.

Phase continuity

Determines whether the modulated signal changes phases in a continuous or discontinuous way.

If you set the Phase continuity parameter to Continuous, then the modulated signal maintains its phase even when it changes its frequency. If you set the Phase continuity parameter to Discontinuous, then the modulated signal comprises portions of M sinusoids of different frequencies. Thus, a change in the input value sometimes causes a change in the phase of the modulated signal.

Samples per symbol

The number of output samples that the block produces for each integer or binary word in the input.

Rate options

Select the rate processing option for the block.

• Enforce single-rate processing — When you select this option, the input and output signals have the same port sample time. The block implements the rate change by making a size change at the output when compared to the input. The output width equals the product of the number of symbols and the Samples per symbol parameter value.

• Allow multirate processing — When you select this option, the input and output signals have different port sample times. The output sample time equals the symbol period divided by the Samples per symbol parameter value.

Output data type

You can specify the output type of the block as either a double or a single. By default, the block sets this value to double.

## Supported Data Types

PortSupported Data Types

Input

• Double-precision floating point

• Boolean (bit input mode only)

• 8-, 16-, and 32-bit signed integers (integer input mode only)

• 8-, 16-, and 32-bit unsigned integers (integer input mode only)

Output

• Double-precision floating point

• Single-precision floating point

## Pair Block

M-FSK Demodulator Baseband

## References

[1] Sklar, Bernard. Digital Communications: Fundamentals and Applications. Upper Saddle River, NJ: Prentice-Hall, 2001.