| Signal Processing Blockset™ | ![]() |
Signal Processing Sources
dspsrcs4
The Discrete Impulse block generates an impulse (the value 1) at output sample D+1, where D is specified by the Delay parameter (D ≥0). All output samples preceding and following sample D+1 are zero.
When 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 ith channel appears at sample D(i)+1. For M=1, the output is sample based; otherwise, the output is frame based.
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 frame-based 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 as follows:
Delay = [0 3 5]
Sample time = 0.25
Samples per frame = 4
Output data type = double
Run the model and look at the output, yout. The first few samples of each channel are shown below.
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, D, 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. When the value of this parameter is 1, the block outputs a sample-based signal.
The Data Types pane of the Discrete Impulse block dialog appears as follows.

Specify the output data type in one of the following ways:
Choose one of the built-in data types from the list.
Choose Fixed-point to specify the output data type and scaling in the Signed, Word length, Set fraction length in output to, and Fraction length parameters.
Choose User-defined to specify the output data type and scaling in the User-defined data type, Set fraction length in output to, and Fraction length parameters.
Choose Inherit via back propagation to set the output data type and scaling to match the next block downstream.
Select to output a signed fixed-point signal. Otherwise, the signal is unsigned. This parameter is only visible when you select Fixed-point for the Output data type parameter.
Specify the word length, in bits, of the fixed-point output data type. This parameter is only visible when you select Fixed-point for the Output data type parameter.
Specify any built-in or fixed-point data type. You can specify fixed-point data types using the following Simulink Fixed Point functions: sfix, ufix, sint, uint, sfrac, and ufrac. This parameter is only visible when you select User-defined for the Output data type parameter.
Specify the scaling of the fixed-point output by either of the following two methods:
Choose Best precision to have the output scaling automatically set such that the output signal has the best possible precision.
Choose User-defined to specify the output scaling in the Fraction length parameter.
This parameter is only visible when you select Fixed-point for the Output data type parameter, or when you select User-defined and the specified output data type is a fixed-point data type.
For fixed-point output data types, specify the number of fractional bits, or bits to the right of the binary point. This parameter is only visible when you select Fixed-point or User-defined for the Output data type parameter and User-defined for the Set fraction length in output to parameter.
Double-precision floating point
Single-precision floating point
Fixed point
Boolean
8-, 16-, and 32-bit signed integers
8-, 16-, and 32-bit unsigned integers
| Data Type Conversion | Simulink |
| Constant | Simulink |
| Multiphase Clock | Signal Processing Blockset |
| N-Sample Enable | Signal Processing Blockset |
| Signal From Workspace | Signal Processing Blockset |
| impz | Signal Processing Toolbox |
![]() | Direct-Form II Transpose Filter (Obsolete) | Display | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |