Main Content

getLatency

Latency of upsampler

Since R2022b

Description

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

example

Y = getLatency(upsampler,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.Upsampler System object™ varies according to the upsample factor and the input vector size. Use the getLatency function to find the latency of an upsampler 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.Upsampler System object and get the latency. The default System object has an upsampling factor of 3 and a sample offset set of 0.

upsampler = dsphdl.Upsampler
upsampler = 
  dsphdl.Upsampler with properties:

    UpsampleFactor: 3
      SampleOffset: 0
         NumCycles: 1

  Use get to show all properties

V = 1;
Ydefault = getLatency(upsampler,V)
Ydefault = 
3

Modify the object and check the resulting change in latency.

upsampler.UpsampleFactor = 8;
Y1 = getLatency(upsampler)
Y1 = 
2

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

V = 2;
upsampler.UpsampleFactor = 10;
LVec = getLatency(upsampler,V)
LVec = 
2

Input Arguments

collapse all

Upsampler, specified as a dsphdl.Upsampler System object.

Vector size, specified as an integer in the range [1, 64]. UpsampleFactor property of upsampler must be an integer multiple of the input frame size. Use this argument to get the latency of an upsampler 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.Upsampler 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. This latency assumes valid input data on every cycle.

Version History

Introduced in R2022b

See Also

Objects