| DSP Blockset | ![]() |
Library
Description
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.
Examples
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:
Run the model and look at the output, yout. The first few samples of each channel are shown below.
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).
Dialog Box
D, preceding the impulse. A length-N vector specifies an N-channel output. This parameter is not tunable.
Fixed-point, fixed-point data types for this block may be set by DSP Fixed-Point Attributes blocks in your model. If this parameter is unselected, the data types are always set by the parameters in the block mask.
Specify the output data type in one of the following ways:
Fixed-point to specify the output data type and scaling in the Word length, Set fraction length in output to, and Fraction length parameters.
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.
Inherit via back propagation to set the output data type and scaling to match the next block downstream.
Fixed-point is selected for the Output data type parameter.
ufix, sint, uint, sfrac, and ufrac functions from the Fixed-Point Blockset. This parameter is only visible if User-defined is selected for the Output data type parameter.
Best precision to have the output scaling automatically set such that the output signal has the best possible precision.
User-defined to specify the output scaling in the Fraction length parameter.
Fixed-point or User-defined is selected for the Output data type parameter, and if the specified output data type is a fixed-point data type.
Fixed-point or User-defined is selected for the Output data type parameter, and if User-defined is selected for the Set fraction length in output to parameter.
Supported Data Types
To learn how to convert your data types to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.
See Also
| Data Type Conversion |
Simulink |
| DSP Constant |
DSP Blockset |
| Multiphase Clock |
DSP Blockset |
| N-Sample Enable |
DSP Blockset |
| Signal From Workspace |
DSP Blockset |
impz |
Signal Processing Toolbox |
Also see Creating Signals Using Signal Generator Blocks for how to use this and other blocks to generate signals.
| Digital Filter Design | Downsample | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2010 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |