Main Content

getLatency

Latency of CIC decimation filter

Description

example

Y = getLatency(hdlcic) returns the latency, Y, between the first valid input sample and the first valid output sample, assuming contiguous input samples. The latency depends on the NumSections property and whether GainCorrection is enabled.

example

Y = getLatency(hdlcic,V) returns the latency, Y, between the first valid input sample and the first valid output sample, assuming contiguous input samples and vector input of size V. The latency depends on the NumSections property, vector input size, and whether GainCorrection is enabled.

Examples

collapse all

The latency of the dsp.HDLCICDecimation System object™ varies depending on how many integrator and comb sections your filter has, input vector size, and whether you enable gain correction. Use the getLatency function to find the latency of a particular filter configuration. The latency is the number of cycles between the first valid input and the first valid output, assuming the input is continuously valid.

Create a dsp.HDLCICDecimation System object™ and request the latency. The default filter has two sections, and gain correction is disabled.

hdlcic = dsp.HDLCICDecimation
hdlcic = 
  dsp.HDLCICDecimation with properties:

    VariableDownsample: false
      DecimationFactor: 2
     DifferentialDelay: 1
           NumSections: 2
        OutputDataType: 'Full precision'
        GainCorrection: false
               ResetIn: false

L_def = getLatency(hdlcic)
L_def = 5

Modify the filter object to have three integrator and comb sections. Check the resulting change in latency.

hdlcic.NumSections = 3;
L_3sec = getLatency(hdlcic)
L_3sec = 6

Enable the gain correction on the filter object with vector input size 2. Check the resulting change in latency.

hdlcic.GainCorrection = true;
vecSize = 2;
L_wgain = getLatency(hdlcic,vecSize)
L_wgain = 25

Input Arguments

collapse all

HDL-optimized CIC decimation filter System object that you created and configured. See dsp.HDLCICDecimation.

Vector size, specified in the range from 1 to 64. DecimationFactor property must be an integer multiple of the input frame size. Use this argument to request the latency of an object similar to hdlcic, but with V sample vector input. When you do not specify this argument, the function assumes scalar input.

Output Arguments

collapse all

Cycles of latency that the CIC decimation 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.

See Also

Objects

Introduced in R2019b