DSP Blockset
  Go to block:
    Search    Help Desk 
Downsample    See Also

Resample the input signal to a lower rate.

Library

Signal Operations, in General DSP

Description

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 sequence 1,2,3,... by a factor of 4, you can select from the following four phases by adjusting the Sample offset.

Input Sequence
Sample Offset
Downsampled Output Sequence
1,2,3,...
0
0,1,5,9,13,17,21,25,...
1,2,3,...
1
0,2,6,10,14,18,22,26,...
1,2,3,...
2
0,3,7,11,15,19,23,27,...
1,2,3,...
3
0,4,8,12,16,20,24,28,...

The initial zero in each output sequence above is a result of the zero Initial condition parameter setting for this example.

The Frame-based inputs parameter allows you to choose between sample-based and frame-based operation.

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:

In frame-based mode, the Initial condition can be an M-by-N matrix representing the initial input, or a scalar to be repeated across all elements of the M-by-N matrix. The first row of the matrix is added to the output buffer at t=0, the Dth row is added at t=K*Ts, the (D+K)th row at t=2K*Ts, and so on, where Ts is the sequence sample period.

Dialog Box

Downsample factor
The integer factor, K, by which to decrease the input sample rate.
Sample offset
The sample offset, D, which must be an integer in the range [0,K-1].
Initial condition
The value that the block is initialized with; a scalar or vector in sample-based mode, a scalar or matrix in frame-based mode.
Frame-based inputs
Selects frame-based operation.
Number of channels
For frame-based operation, the number of channels (columns) in the input matrix, N.
Framing
For frame-based operation, the method by which to implement the downsampling: decrease the output sample rate, or decrease the output frame size.

See Also

FIR Decimation
FIR Rate Conversion
Repeat
Upsample


[ Previous | Help Desk | Next ]