DSP Blockset    

Example 2: Unintended Rate Conversion.   Now alter the previous example by setting the Magnitude FFT block parameters as follows:

This setting instructs the block to zero-pad the length-128 input frame to a length of 256 before performing the FFT. The signal dimension display on the new version of the model shows that the output of the Magnitude FFT block is now a length-256 frame.

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

In this case, based on the input frame size (256) and period (12.8), the Vector Scope block calculates the original signal's sample period to be 0.05 second (12.8/256), which is wrong. As a result, the spectral peaks appear at the incorrect frequencies, 2 Hz and 4 Hz rather than 1 Hz and 2 Hz.

The problem is that the zero-pad operation performed by the Magnitude FFT block halves the sample period of the sequence by appending 128 zeros to each frame. The Vector Scope block, however, needs to know the sample period of the original signal. The problem is easily solved by changing the Sample time of original time series setting in the Axis properties panel of the Vector Scope block to the actual sample period of 0.1. The plot generated with this setting is identical to the first Vector Scope plot above.

In general, be aware that when you do zero-padding or overlapping buffering you are changing the sample period of the signal. As long as you keep this in mind, you should be able to anticipate and correct problems like the one above.


  Example 1: No Rate Conversion Changing Frame Status