Main Content

getLatency

Latency of downsampler

Since R2022b

Description

Y = getLatency(downsampler) 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 SampleOffset property and length of the input data to the downsampler.

example

Y = getLatency(downsampler,V) returns the latency, Y, between the first valid input sample and the first valid output sample, assuming contiguous input samples and a vector input of size V.

example

Examples

collapse all

The latency of the dsphdl.Downsampler System object™ varies according the downsample factor and the input vector size. Use the getLatency function to find the latency of an downsampler 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 dsphdl.Downsampler System object and get the latency. The default System object has an downsampling factor of 2 and a sample offset of 0.

downsampler = dsphdl.Downsampler
downsampler = 
  dsphdl.Downsampler with properties:

    DownsampleFactor: 2
        SampleOffset: 0

  Use get to show all properties

V = 1;
downsampler.SampleOffset = 1;
Ydefault = getLatency(downsampler,V)
Ydefault = 
3

Modify the object and check the resulting change in latency.

downsampler.DownsampleFactor = 8;
Y1 = getLatency(downsampler)
Y1 = 
1

Change the vector input size to 2. Check the resulting change in latency.

V = 4;
downsampler.DownsampleFactor = 2;
Vec = getLatency(downsampler,V)
Vec = 
2

Input Arguments

collapse all

Downsampler, specified as a dsphdl.Downsampler System object.

Vector size, specified as an integer in the range [1, 64]. DownsampleFactor property of Downsampler must be an integer multiple of the input frame size. Use this argument to get the latency of an Downsampler object with V input data samples. When you do not specify this argument, the function assumes that the input data is scalar.

Output Arguments

collapse all

Cycles of latency that the dsphdl.Downsampler object takes between the first valid input and the first valid output, returned as a nonnegative integer. Each call to the object simulates one cycle. The function calculates this latency under the assumption that the input data is valid on every cycle.

Version History

Introduced in R2022b

See Also

Objects