srmdelay

Compute delay introduced by Sample-Rate Match block

Since R2022b

Syntax

``delay = srmdelay(inputrates,inputlengths,outputrate,outputlength)``
``delay = srmdelay(inputrates,inputlengths,outputrate,outputlength,mode)``

Description

example

````delay = srmdelay(inputrates,inputlengths,outputrate,outputlength)` returns delay in number of samples for the specified inputs. Use this function to compute the delay that will be introduced by the Sample-Rate Match block.```

example

````delay = srmdelay(inputrates,inputlengths,outputrate,outputlength,mode)` returns delay in number of samples for the specified inputs. Use this function to compute the delay that will be introduced by the Sample-Rate Match block.```

Examples

collapse all

Resample a 5G signal at 7.68 MHz and an LTE signal at 3.84 MHz to a higher rate of 15.36 MHz.

```inpRates = [7.68 3.84]*1e6; inpLengths = [1e3 1e3]; outRate = 15.36e6; outLength = 1e3;```

Determine delay incurred for a model configured for multitasking mode.

`d = srmdelay(inpRates,inpLengths,outRate,outLength)`
```d = 2×1 1024 1048 ```

Resample a WLAN signal at 20 MHz and a 5g signal at 15.36 MHz to a higher rate of 30.72 MHz.

```inpRates = [20 15.36]*1e6; inpLengths = [2 1]*10; outRate = 30.72e6; outLength = 50;```

Determine delay incurred for a model configured for single-tasking mode.

`d = srmdelay(inpRates,inpLengths,outRate,outLength,"singletasking")`
```d = 2×1 145 174 ```

Input Arguments

collapse all

Input sample rates in Hz, specified as a 2-element vector of positive values.

Data Types: `double`

Input lengths in samples, specified as a 2-element vector of positive integer values.

Data Types: `double`

Output sample rate in Hz, specified as a positive scalar.

Data Types: `double`

Output length in samples, specified as a positive integer.

Data Types: `double`

Tasking mode of the model, specified as either `"multitasking"` or `"singletasking"`. The Treat each discrete rate as a separate task parameter of the Solver controls the mode of the model. For more information on the Treat each discrete rate as a separate task and Solver parameters, see Solver Pane (Simulink).

Output Arguments

collapse all

Sample rate match delay in samples, returned as a 2-element column vector. The first element corresponds to the delay introduced in the first input and the second element corresponds to the delay introduced in the second input.

Version History

Introduced in R2022b