Code covered by the BSD License

# H-infinity optimal fractional delay filter

### Masaaki Nagahara (view profile)

28 Feb 2013 (Updated )

A code for designing H-infinity optimal fractional delay filters

fdf_hinf(F, D, T)
```function K = fdf_hinf(F, D, T)

% FDF_HINF(F, D, T) computes the H-infinity optimal fractional delay filter
%
% [INPUT]
% F: analog filter (TF object)
% D: fractional delay (positive real number)
% T: sampling period (positive real number)
%
% [OUTPUT]
% K: the optimal fractional delay filter (TF object)

%% Initial settings
% Delay D = mT + d; m: integer, 0<= d < T
m = floor(D/T);
d = mod(D, T);
% State space matrices of F(s)
[A,B,C,D]=ssdata(F);
if isempty(A)
A=0; B=0; C=0;
end
eig_max = max(real(eig(A)));
if eig_max >=0
disp('The filter F(s) must be stable !');
K = [];
return;
end
% Size of A
n=size(A,1);

%% H-inf Discretization
z = tf('z');
Delay_m = z^(-m);
[Am,Bm,Cm,Dm] = ssdata(ss(Delay_m));

C1 = [zeros(1,n),0,Cm];
C2 = [C,0,zeros(1,m)];

Fh = expm([-A, B*B'; zeros(n,n),A']*T);
Fd = expm([-A, B*B'; zeros(n,n),A']*(T-d));

F12h = Fh(1:n,n+1:n+n);
F22h = Fh(n+1:n+n,n+1:n+n);

F12d = Fd(1:n,n+1:n+n);
F22d = Fd(n+1:n+n,n+1:n+n);

Mh = F22h'*F12h; % M(T)
Md = F22d'*F12d; % M(T-d)

BB11 = Mh;
BB12 = expm(A*d)*Md*C';
BB21 = BB12';
BB22 = C*Md*C';
BB = [BB11,BB12;BB21,BB22];

Bd = sqrtm(BB);

p=size(Bd,2);

%% H-infinity design