Main Content

getLatency

Latency of LMS Filter

Since R2023a

Description

Y = getLatency(lmsfilter) returns the latency, Y, that the object takes to give LMS outputs. The latency depends on the input vector size and the input complexity. The LMS filter length does not affect the latency.

example

Y = getLatency(lmsfilter,inputData,V) returns the latency, Y, that the object takes to give LMS outputs if it had input type inputType which value indicates input real or complex and vector size of input V. This function does not change the properties of the lmsfilter.

Examples

collapse all

The latency of the dsphdl.LMSFilter System object™ varies with the input size and filter length. Use the getLatency function to find the latency of an LMS Filter for a particular configuration. The latency is measured as the number of cycles between the first valid input and the first valid output, assuming that the input is contiguous.

Create dsphdl.LMSFilter System object and calculate latency.

lmsfilter = dsphdl.LMSFilter
lmsfilter = 
  dsphdl.LMSFilter with properties:

         FilterLength: 32
       StepSizeSource: 'Property'
             StepSize: 0.0100
    InitialConditions: 0
       AdaptInputPort: false
    WeightsOutputPort: true
      ErrorOutputPort: false

  Use get to show all properties

Calculate latency for the object with a filter length 64.

lmsfilter = dsphdl.LMSFilter(FilterLength=64);
latencyDT = getLatency(lmsfilter)
latencyDT = 
13

Calculate latency for the object with a filter length 75. The latency does not change.

lmsfilter = dsphdl.LMSFilter(FilterLength=75);
latencyDT = getLatency(lmsfilter)
latencyDT = 
13

Calculate latency when the input is complex.

latencyDT = getLatency(lmsfilter,complex(0))
latencyDT = 
15

Calculate latency when input is real with vector size 4.

latencyDT = getLatency(lmsfilter,real(0),4)
latencyDT = 
18

Input Arguments

collapse all

LMS Filter System object that you created and configured. See dsphdl.LMSFilter.

Input data, specified as a real or complex value.

Vector size, specified in the range [2, 64] and it must be less than the filter length. Use this argument to request the latency of an object similar to hdlobj, 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 object takes to filter the input, returned as an integer. The latency is the number of cycles between the first valid input and the first valid output, assuming the input is contiguous. Each call to the object simulates one cycle.

Version History

Introduced in R2023a

See Also

Blocks

Objects