Apply phase and frequency offsets to complex baseband signal

RF Impairments

The Phase/Frequency Offset block applies phase and frequency offsets to an incoming signal.

The block inherits its output data type from the input signal. If the input signal is
*u*(*t*), then the output signal is:

$$y(t)=u(t)\cdot \left(\mathrm{cos}\left(2\pi {\displaystyle {\int}_{0}^{t}f\left(\tau \right)d\tau +\phi (t)}\right)+j\mathrm{sin}\left(2\pi {\displaystyle {\int}_{0}^{t}f\left(\tau \right)d\tau +\phi (t)}\right)\right)$$

where

*f(t)* = Frequency offset

*φ(t)* = Phase offset

The discrete-time output is:

$$\begin{array}{l}y(0)=u(0)\left(\mathrm{cos}\left(\phi (0)\right)+j\mathrm{sin}\left(\phi (0)\right)\right)\\ y(i)=u(i)\left(\mathrm{cos}\left(2\pi {\displaystyle \sum _{n=0}^{i-1}f\left(n\right)\Delta t}+\phi (i)\right)+j\mathrm{sin}\left(2\pi {\displaystyle \sum _{n=0}^{i-1}f\left(n\right)\Delta t}+\phi (i)\right)\right)\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}i\text{\hspace{0.17em}}>\text{\hspace{0.17em}}0\end{array}$$

where

*Δt* = Sample time

This block accepts real and complex inputs of data type `double`

or
`single`

.

The block applies a phase offset to the input signal, specified by the **Phase
offset** parameter.

The block applies a frequency offset to the input signal, specified by the
**Frequency offset** parameter. Alternatively, when you select
**Frequency offset from port**, the `Frq`

input port provides
the offset to the block. The frequency offset must be a scalar value, vector with the same
number of rows or columns as the data input, or a matrix with the same size as the data input.
For more information, see Interdependent Parameter-Port Dimensions.

The effects of changing the block's parameters are illustrated by the following scatter plots of a signal modulated by 16-ary quadrature amplitude modulation (QAM). The usual 16-ary QAM constellation without the effect of the Phase/Frequency Offset block is shown in the first scatter plot:

The following figure shows a scatter plot of an output signal, modulated by 16-ary QAM,
from the Phase/Frequency Offset block with **Phase offset** set to
`20`

and **Frequency offset** set to
`0`

:

Observe that each point in the constellation is rotated by a 20 degree angle counterclockwise.

If you set **Frequency offset** to `2`

and
**Phase offset** to `0`

, the angles of points in the
constellation change linearly over time. This causes points in the scatter plot to shift
radially, as shown in the following figure:

Note that every point in the scatter plot has magnitude equal to a point in the original constellation.

See Illustrate RF Impairments That Distort a Signal for a description of the model that generates this plot.

Number of Dimensions | Data I/O Dimension | Frame Size | Number of Channels | Frequency/Phase Offset Parameter Dimension | Frequency Offset Input Port Dimension |
---|---|---|---|---|---|

Any | Scalar | 1 | 1 | Scalar | Scalar |

2 | M-by-1 | M | 1 | M-by-1, 1-by-M, 1-by-1 | M, M-by-1, 1, 1-by-1 |

2 | 1-by-N | 1 | N | N-by-1, 1-by-N, 1-by-1 | N, 1-by-N, 1, 1-by-1 |

2 | M-by-N | M | N | M-by-N, N-by-1,
1-by-N, M-by-1, 1-by-M, 1-by-1 | M-by-N, N,
1-by-N, 1, 1-by-1, M,
M-by-1 |

When you specify a scalar offset parameter the block applies the same offset to all elements of the input signal

When you specify a 2-by-1 offset parameter for a 2-by-3 input signal (one offset value per sample), the block applies the same sample offset across the three channels.

When you specify a 1-by-3 offset parameter for a 2-by-3 input signal (one offset value per channel), the same channel offset is applied across the two samples of a channel.

When you specify a 2-by-3 offset parameter for a 2-by-3 input signal (one offset value per sample for each channel), the offsets are applied element-wise to the input signal.

**Frequency offset from port**Selecting this option opens a port on the block through which you can input the frequency offset information.

**Frequency offset**Specifies the frequency offset in hertz.

This parameter is tunable in normal mode, Accelerator mode and Rapid Accelerator mode. If you use the Simulink

^{®}Coder™ rapid simulation (RSIM) target to build an RSIM executable, then you can tune the parameter without recompiling the model. For more information, see Tunable Parameters (Simulink) in the Simulink*User's Guide*.**Phase offset**Specifies the phase offset in degrees.

This parameter is tunable in normal mode, Accelerator mode and Rapid Accelerator mode. If you use the Simulink Coder rapid simulation (RSIM) target to build an RSIM executable, then you can tune the parameter without recompiling the model. For more information, see Tunable Parameters (Simulink) in the Simulink

*User's Guide*.

If **Frequency offset** and **Phase offset** are both
vectors or both matrices, their dimensions (vector lengths, or number of rows and columns) must
be the same.