| DSP Blockset | Search  Help Desk |
| Downsample | See Also |
Resample the input signal to a lower rate.
Library
Signal Operations, in General DSPDescription
The Downsample block resamples the discrete input at a rate K times slower than the input sample rate by applying a zero-order hold throughout the new sample interval. K is an integer value specified by the Downsample factor parameter. The Sample offset parameter delays the output samples by an integer number of sample periods D (D<K), so that any of the K possible output phases can be selected. For example, when you downsample the sequence1,2,3,... by a factor of 4, you can select from the following four phases by adjusting the Sample offset.Sample-Based Operation
When the check box is not selected (default), the block assumes that the input is a 1-by-N sample vector or M-by-N sample matrix. Each of the N vector elements (or M*N matrix elements) is treated as an independent channel, and the block downsamples each channel over time. The output sample period is K times longer than the input sample rate, and the input and output sizes are identical. In sample-based mode, the Initial condition can be a vector containing one value for each channel, or a scalar to be applied to all signal channels. The value specified for the Initial condition parameter is output at t=0.Frame-Based Operation
When the Frame-based inputs check box is selected, the block assumes that the input is an M-by-N frame matrix. Each of the N frames in the matrix contains M sequential time samples from an independent signal. The illustration below shows a 6-by-4 frame matrix input:
The Number of channels parameter specifies the number of independent channels (columns), N, in the matrix. Frame-based operation provides substantial increases in throughput rates, at the expense of greater model latency.
In frame-based operation, the block independently downsamples each channel in the input matrix by skipping K rows after each row that it passes through to the output. The downsample factor must be less than the frame size, K<M. The Framing parameter determines how the block adjusts the rate at the output. There are two available options:The block generates the output at the slower (downsampled) rate by using a proportionally longer frame period at the output port than at the input port. For downsampling by a factor of K, the output frame period is K times longer than the input frame period, but the input and output frame sizes are equal.
The example below shows a single-channel input with a frame period of 1 second (Sample time = 1/64 and Samples per frame = 64 in the Signal From Workspace block) being downsampled by a factor of 4 to a frame period of 4 seconds. The input and output frame sizes are identical.

The block generates the output at the slower (downsampled) rate by using a proportionally smaller frame size than the input. For downsampling by a factor of K, the output frame size is K times smaller than the input frame size, but the input and output frame rates are equal.
The example below shows a single-channel input of frame size 64 being downsampled by a factor of 4 to a frame size of 16. The input and output frame rates are identical.

Dialog Box

See Also
FIR Decimation