Generate fractional delay filter based on Thiran approximation
sys
= thiran(tau
, Ts
)
discretizes
the continuoustime delay sys
= thiran(tau
, Ts
)tau
using a Thiran filter
to approximate the fractional part of the delay. Ts
specifies
the sample time.

Time delay to discretize. 

Sample time. 

Discretetime 
Approximate and discretize a time delay that is a noninteger multiple of the target sample time.
sys1 = thiran(2.4, 1) Transfer function: 0.004159 z^3  0.04813 z^2 + 0.5294 z + 1  z^3 + 0.5294 z^2  0.04813 z + 0.004159 Sample time: 1
The time delay is 2.4 s, and the sample time is 1 s. Therefore, sys1
is
a discretetime transfer function of order 3.
Discretize a time delay that is an integer multiple of the target sample time.
sys2 = thiran(10, 1) Transfer function: 1  z^10 Sample time: 1
If tau
is an integer multiple of Ts
,
then sys
represents the pure discrete delay z^{–N},
with N = tau/Ts
. Otherwise, sys
is
a discretetime, allpass, infinite impulse response (IIR) filter
of order ceil(tau/Ts)
.
thiran
approximates and discretizes
a pure time delay. To approximate a pure continuoustime time delay
without discretizing, use pade
.
To discretize continuoustime models having time delays, use c2d
.
The Thiran fractional delay filter has the following form:
$$H\left(z\right)=\frac{{a}_{N}{z}^{N}+{a}_{N1}{z}^{N1}+\cdots +{a}_{1}}{{a}_{0}{z}^{N}+{a}_{1}{z}^{N1}+\cdots +{a}_{N}}.$$
The coefficients a_{0}, ..., a_{N} are given by:
$$\begin{array}{l}{a}_{k}={\left(1\right)}^{k}\left(\begin{array}{c}N\\ k\end{array}\right){\displaystyle \prod _{i=0}^{N}\frac{DN+i}{DN+k+i}},\text{\hspace{1em}}\forall k:1,2,\dots ,N\\ {a}_{0}=1\end{array}$$
where D = τ/T_{s} and N = ceil(D) is the filter order. See [1].
[1] T. Laakso, V. Valimaki, “Splitting the Unit Delay”, IEEE Signal Processing Magazine, Vol. 13, No. 1, p.3060, 1996.