Shape input signal using ideal rectangular pulses
Comm Filters
The Ideal Rectangular Pulse Filter block upsamples and shapes the input signal using rectangular pulses. The block replicates each input sample N times, where N is the Pulse length parameter. After replicating input samples, the block can also normalize the output signal and/or apply a linear amplitude gain.
If the Pulse delay parameter is nonzero, then the block outputs that number of zeros at the beginning of the simulation, before starting to replicate any of the input values.
This block accepts a scalar, column vector, or matrix input signal. For information about the data types each block port supports, see the Supported Data Type table on this page.
The vector size, the pulse length, and the pulse delay are mutually independent. They do not need to satisfy any conditions with respect to each other.
When you set the Rate options parameter
to Enforce singlerate processing
, the
input and output of the block have the same sample rate. To generate
the output while maintaining the input sample rate, the block resamples
the data in each column of the input such that the frame size of the
output (M_{o}) is L times
larger than that of the input (M_{o} = M_{i}*L),
where L is the Pulse length (number of
samples) parameter value.
When you set the Rate options parameter
to Allow multirate processing
, the input
and output of the block are the same size. However, the sample rate
of the output is L times faster than that of the
input (i.e. the output sample time is 1/N times the input sample time).
When the block is in multirate processing mode, you must also specify
a value for the Input processing parameter:
When you set the Input processing parameter
to Elements as channels (sample based)
,
the block treats an MbyN matrix
input as M*N independent channels,
and processes each channel over time. The output sample period (T_{so})
is L times shorter than the input sample period
(T_{so} = T_{si}/L),
while the input and output sizes remain identical.
When you set the Input processing parameter
to Columns as channels (frame based)
, the
block treats an M_{i}byN matrix
input as N independent channels. The block processes
each column of the input over time by keeping the frame size constant
(M_{i}=M_{o}),
while making the output frame period (T_{fo}) L times
shorter than the input frame period (T_{fo} = T_{fi}/L).
You determine the block's normalization behavior using the Normalize output signal and Linear amplitude gain parameters.
If you clear Normalize output signal, then the block multiplies the set of replicated values by the Linear amplitude gain parameter. This parameter must be a scalar.
If you select Normalize output signal, then the Normalization method parameter appears. The block scales the set of replicated values so that one of these conditions is true:
The sum of the samples in each pulse equals the original input value that the block replicated.
The energy in each pulse equals the energy of the original input value that the block replicated. That is, the sum of the squared samples in each pulse equals the square of the input value.
After the block applies the scaling specified in the Normalization method parameter, it multiplies the scaled signal by the constant scalar value specified in the Linear amplitude gain parameter.
The output is scaled by $$\sqrt{N}$$. If the output of this block feeds the input to the AWGN Channel block, specify the AWGN signal power parameter to be 1/N.
The number of samples in each output pulse; that is, the number of times the block replicates each input value when creating the output signal.
The number of zeros that appear in the output at the beginning of the simulation, before the block replicates any input values.
Specify how the block processes the input signal. You can set this parameter to one of the following options:
Columns as channels (frame based)
—
When you select this option, the block treats each column of the input
as a separate channel.
Elements as channels (sample based)
—
When you select this option, the block treats each element of the
input as a separate channel.
Note:
The 
Specify the method by which the block should upsample and shape the input signal. You can select one of the following options:
Enforce singlerate processing
—
When you select this option, the block maintains the input sample
rate, and processes the signal by increasing the output frame size
by a factor of L. To select this option, you must
set the Input processing parameter to Columns
as channels (frame based)
.
Allow multirate processing
—
When you select this option, the block processes the signal such that
the output sample rate is L times faster than the
input sample rate.
If you select this, then the block scales the set of replicated values before applying the linear amplitude gain.
The quantity that the block considers when scaling the set of
replicated values. Choices are Sum of samples
and Energy
per pulse
. This field appears only if you select Normalize
method.
A positive scalar used to scale the output signal.
Use this parameter to specify the rounding method to be used
when the result of a fixedpoint calculation does not map exactly
to a number representable by the data type and scaling storing the
result. The filter coefficients do not obey this parameter; they always
round to Nearest
.
For more information, see Rounding Modes in the DSP System Toolbox™ documentation or Rounding Mode: Simplest in the FixedPoint Designer™ documentation.
Select the overflow mode for fixedpoint operations. The filter coefficients do not obey this parameter; they are always saturated.
Choose how you specify the word length and the fraction length of the filter coefficients (numerator and/or denominator). See Filter Structure Diagrams in DSP System Toolbox Reference Guide for illustrations depicting the use of the coefficient data types in this block:
When you select Same word length as input
,
the word length of the filter coefficients match that of the input
to the block. In this mode, the fraction length of the coefficients
is automatically set to the binarypoint only scaling that provides
you with the best precision possible given the value and word length
of the coefficients.
When you select Specify word length
,
you are able to enter the word length of the coefficients, in bits.
In this mode, the fraction length of the coefficients is automatically
set to the binarypoint only scaling that provides you with the best
precision possible given the value and word length of the coefficients.
When you select Binary point scaling
,
you are able to enter the word length and the fraction length of the
coefficients, in bits. If applicable, you are able to enter separate
fraction lengths for the numerator and denominator coefficients.
When you select Slope and bias scaling
,
you are able to enter the word length, in bits, and the slope of the
coefficients. If applicable, you are able to enter separate slopes
for the numerator and denominator coefficients. This block requires
poweroftwo slope and a bias of zero.
The filter coefficients do not obey the Rounding
mode and the Overflow mode parameters;
they are always saturated and rounded to Nearest
.
Use this parameter to specify how you would like to designate the product output word and fraction lengths. See Filter Structure Diagrams and Multiplication Data Types in DSP System Toolbox Reference Guide for illustrations depicting the use of the product output data type in this block:
When you select Same as input
,
these characteristics match those of the input to the block.
When you select Binary point scaling
,
you are able to enter the word length and the fraction length of the
product output, in bits.
When you select Slope and bias scaling
,
you are able to enter the word length, in bits, and the slope of the
product output. This block requires poweroftwo slope and a bias
of zero.
Use this parameter to specify how you would like to designate the accumulator word and fraction lengths. See Filter Structure Diagrams and Multiplication Data Types for illustrations depicting the use of the accumulator data type in this block:
When you select Same as input
,
these characteristics match those of the input to the block.
When you select Same as product output
,
these characteristics match those of the product output.
When you select Binary point scaling
,
you are able to enter the word length and the fraction length of the
accumulator, in bits.
When you select Slope and bias scaling
,
you are able to enter the word length, in bits, and the slope of the
accumulator. This block requires poweroftwo slope and a bias of
zero.
Choose how you specify the output word length and fraction length:
When you select Same as input
,
these characteristics match those of the input to the block.
When you select Same as accumulator
,
these characteristics match those of the accumulator.
When you select Binary point scaling
,
you are able to enter the word length and the fraction length of the
output, in bits.
When you select Slope and bias scaling
,
you are able to enter the word length, in bits, and the slope of the
output. This block requires poweroftwo slope and a bias of zero.
Select this check box to prevent any fixedpoint scaling you specify in the block mask from being overridden by the autoscaling tool in the FixedPoint Tool.
Port  Supported Data Types 

In 

Out 

If Pulse length is 4
and Pulse
delay is the scalar 3
, then the table
below shows how the block treats the beginning of a ramp (1
, 2
, 3
,...)
in several situations. (The values shown in the table do not reflect
vector sizes but merely indicate numerical values.)
Normalization Method, If Any  Linear Amplitude Gain  First Several Output Values 

None (Normalize output signal cleared)  1  0 , 0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 ,... 
None (Normalize output signal cleared)  10  0 , 0 , 0 , 10 , 10 , 10 , 10 , 20 , 20 , 20 , 20 , 30 , 30 , 30 , 30 ,... 
Sum of samples  1  0 , 0 , 0 , 0.25 , 0.25 , 0.25 , 0.25 , 0.5 , 0.5 , 0.5 , 0.5 , 0.75 , 0.75 , 0.75 , 0.75 ,...,
where 0.25*4=1 
Sum of samples  10  0 , 0 , 0 , 2.5 , 2.5 , 2.5 , 2.5 , 5 , 5 , 5 , 5 , 7.5 , 7.5 , 7.5 , 7.5 ,
... 
Energy per pulse  1  0 , 0 , 0 , 0.5 , 0.5 , 0.5 , 0.5 , 1.0 , 1.0 , 1.0 , 1.0 , 1.5 , 1.5 , 1.5 , 1.5 ,...,
where (0.5)^2*4=1^2 
Energy per pulse  10  0 , 0 , 0 , 5 , 5 , 5 , 5 , 10 , 10 , 10 , 10 , 15 , 15 , 15 , 15 ,... 