DSP Blockset
  Go to block:
    Search    Help Desk 

Example: Using Buffer and Unbuffer

The model below demonstrates how to use the Buffer block to create a frame vector that the FFT block can operate on. At the end of the processing flow, the Partial Unbuffer block converts the frame vectors back to scalar samples for output on a Scope.

Construct the model using:

To try the model:

   1.
Set the input signal parameters in the Signal Generator block:
  1. Wave form = square
  2. Amplitude = 2
  3. Frequency = 3.5
  4. Units = rad/sec
   2.
Set the Sample time in the Zero-Order Hold block to 0.001.
   3.
Set the Buffer block parameters:
  1. Buffer size = 256
  2. Buffer overlap = 192
   4.
Set the Partial Unbuffer block parameters:
  1. Buffer size = 256
  2. First output index = 193
  3. Last output index = 256
   5.
Set the Frequency Frame Scope block parameters:
  1. Frequency units = rads/sec
  2. Sample time of vector elements0.001
   6.
Set the Stop time in the Parameters dialog box to inf, and start the simulation by selecting Start from the Simulation menu.
The Time Frame Scope window displays the buffered input, and the Frequency Frame Scope window displays its FFT. Stop the simulation at any time by selecting Stop from the Simulation menu.



[ Previous | Help Desk | Next ]