DSP Blockset    

Example 1: No Rate Conversion.   The model below plots the magnitude FFT of a signal composed of two sine waves, with frequencies of 1 Hz and 2 Hz.

To build the model, configure one Sine Wave block with Frequency = 1, and the other with Frequency = 2. In addition, both Sine Wave blocks should have the following settings:

The frame period of the resulting summed sinusoid is 12.8 seconds (i.e., 128*0.1), which is confirmed by the Probe block when the model is updated.

Select Inherit FFT length from input dimensions in the Magnitude FFT block. This setting instructs the block to use the input frame size (128) as the FFT length (which is also the output size).

Configure the Vector Scope block as follows:

The plot generated by the Vector Scope block is shown below.

The Vector Scope block uses the input frame size (128) and period (12.8) to deduce the original signal's sample period (0.1), which allows it to correctly display the peaks at 1 Hz and 2 Hz.


  Avoiding Unintended Rate Conversions Example 2: Unintended Rate Conversion