Main Content

getLatency

Latency of biquad filter

Since R2022a

Description

Y = getLatency(hdliir) 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 Structure property of the object.

example

Y = getLatency(hdliir,V) returns the latency, Y, for an input vector of V elements. Use this syntax when the Structure property is 'Pipelined feedback form'. Other filter structures do not support vector input.

example

Examples

collapse all

The latency of the dsphdl.BiquadFilter object varies with the filter structure and 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, assuming that the input is contiguous.

Create a new dsphdl.BiquadFilter object and request the latency. The default filter structure is direct form II.

filtdf2=dsphdl.BiquadFilter
filtdf2 = 
  dsphdl.BiquadFilter with properties:

      Structure: 'Direct form II'
      Numerator: [1 2 1]
    Denominator: [1 0.1000 0.2000]
    ScaleValues: 1

  Use get to show all properties

getLatency(filtdf2)
ans = 
12

Create an object with a different filter structure and compare the latency.

filtpff = dsphdl.BiquadFilter(Structure='Pipelined feedback form');
getLatency(filtpff)
ans = 
23

Request hypothetical latency information about a similar object with vector input data. You can only use vector input data with the 'Pipelined feedback form' filter structure.

getLatency(filtpff,8)
ans = 
55

Create an object with a serial filter structure and compare the latency.

filts = dsphdl.BiquadFilter(Structure='Direct form I fully serial');
getLatency(filts)
ans = 
16

Input Arguments

collapse all

HDL-optimized filter System object that you created and configured. See dsphdl.BiquadFilter.

Vector size, specified as a power of 2 from 1 to 64. Use this argument to request the latency of a similar object, but with V-sample vector input. When you do not specify this argument, the function assumes scalar input.

Vector input is supported only when the Structure property is 'Pipelined feedback form'.

Output Arguments

collapse all

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.

Version History

Introduced in R2022a

See Also

Objects