Generate discrete impulse
D is a length-N vector,
the block generates an M-by-N matrix
output representing N distinct channels, where
frame size M is specified by the Samples
per frame parameter. The impulse for the
channel appears at sample
The Sample time parameter value, Ts, specifies the output signal sample period. The resulting frame period is M*Ts.
Construct the model below.
Configure the Discrete Impulse block to generate a three-channel
output of type
double, with impulses at samples
1, 4, and 6 of channels 1, 2, and 3, respectively. Use a sample period
of 0.25 and a frame size of 4. The corresponding settings should be
[0 3 5]
Sample time =
Samples per frame =
Output data type =
Run the model and look at the output,
The first few samples of each channel are shown below.
dsp_examples_yout(1:10,:) ans = 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
The block generates an impulse at sample 1 of channel 1 (first column), at sample 4 of channel 2 (second column), and at sample 6 of channel 3 (third column).
The Main pane of the Discrete Impulse block dialog appears as follows.
The number of zero-valued output samples,
preceding the impulse. A length-N vector specifies
an N-channel output.
The sample period, Ts, of the output signal. The output frame period is M*Ts.
The number of samples, M, in each output frame.
The Data Types pane of the Discrete Impulse block dialog appears as follows.
Specify the output data type for this block. You can select one of the following:
A rule that inherits a data type, for example,
Inherit via back propagation. When you select this option,
the output data type and scaling matches that of the next downstream
A built in data type, such as
An expression that evaluates to a valid data type,
Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Output data type parameter.
See Control Signal Data Types for more information.
Double-precision floating point
Single-precision floating point
8-, 16-, and 32-bit signed integers
8-, 16-, and 32-bit unsigned integers