Latency of FIR decimation filter
returns the latency,
Y = getLatency(hdlfird,
Y, between the first valid input sample
and the first valid output sample, assuming contiguous input samples. The latency
depends on filter structure and filter coefficients. The final two arguments may be
optional, depending on the object configuration.
inputType when you set
CoefficientsDataType property to
word length as input'. Otherwise, set it to
when your input data is complex. The latency changes when you have
complex data and complex coefficients, because of the extra adder
The latency of the
dsp.HDLFIRDecimation System object™ varies with filter architecture and input vector size. Use the
getLatency function to find the latency of a particular configuration. The latency is the number of cycles between the first valid input and the first valid output.
dsp.HDLFIRDecimation System object™ and request the latency. The default filter is a direct-form systolic architecture. The default data type for the coefficients is
'Same word length as input'. Therefore, when you call the
getLatency object function, you must specify an input data type. The default filter has 36 coefficients. This example assumes the data input to your filter is complex-valued. The default coefficients are real-valued. Complexity affects filter latency only when you have complex-valued data and complex-valued coefficients.
inputType = numerictype(1,16,15); % object uses only the word length for coefficient type cast complexInput = true; downBy4 = dsp.HDLFIRDecimation('DecimationFactor',4); L_by4scalar = getLatency(downBy4,inputType,complexInput)
L_by4scalar = 44
Check the latency for the same filter with vector input.
vectorSize = 2; L_by4Vec2 = getLatency(downBy4,inputType,complexInput,vectorSize)
L_by4Vec2 = 28
Check the latency of a transposed architecture.
downBy4.FilterStructure = 'Direct form transposed'; L_by4trans = getLatency(downBy4,inputType,complexInput)
L_by4trans = 11
Check the latency for the transposed filter with vector input.
vectorSize = 4; L_by4transVec4 = getLatency(downBy4,inputType,complexInput,vectorSize)
L_by4transVec4 = 9
hdlfird— HDL-optimized FIR filter System object™
HDL-optimized FIR decimation filter System object that you created and configured. See
inputType— Input data type
Input data type, specified as a
numerictype (Fixed-Point Designer) object. Call
s is 1
for signed and 0 for unsigned,
w is the word length in
f is the number of fractional bits.
If you specify
 for this argument, the object uses
double data type to calculate the latency. The result
is equivalent to the fixed-point latency as long as the coefficient data
type is large enough to represent the coefficient values exactly.
This argument applies when the
length as input'.
isInputComplex— Complexity of input data
Set this argument to
true if your input data is
complex. You can omit this argument if your input data is real. When your
filter has complex input data and complex coefficients there is an
additional adder at the output of the filter that adds pipeline latency.
inputVecSize— Vector size
Vector size, specified as an integer from 1 to 64. When you do not specify this argument, the function assumes scalar input.
Y— Cycles of latency
Cycles of latency that the filter object takes between the first valid input and the first valid output. Each call to the object simulates one cycle. This latency assumes valid input data on every cycle.