I am designing a fractional delay filter, I found this code for lagrange FIR fractional delay filter, The fractional delay filter acts as a low pass filter, it passes low frequencies from 0 to 0.25*fs. But I want a Bandpass fractional delay filter which passes higher frequencies from 0.25*fs to 0.5*fs. I also want the phase response to be linear and equal to zero at 0.25*fs. Could you please help me how can I get a bandpass fractional delay filter. Thanks

function h = lagrange(L,x)


% MATLAB m-file for fractional delay approximation


% h = lagrange(L,x) returns a length L (real) FIR

% filter which approximates the fractional delay

% of x samples.

% Input: L = filter length (filter order N = L-1)

% x = fractional delay (0 < x <= 1)

% Output: Filter coefficient vector h(1)...h(L)

% Subroutines: standard MATLAB functions


% Timo Laakso 27.12.1992

% Revised 14.01.1996 by Timo Laakso

% 17.01.1996 by Vesa Valimaki

N = L-1; % filter order

M = N/2; % middle value

if (M-round(M))==0 D=x+M; % integer part closest to middle

else D=x+M-0.5; end;




for n=0:N


for k=0:N

if (k~=n)

  h(n1) = h(n1)*(D-k)/(n-k);

end  % if

end; % for k

end; % for n

end enter image description here

enter image description here

  • $\begingroup$ i would expect that the phase would be linear and pass through f=0 $\endgroup$
    – user28715
    Jul 8, 2018 at 17:24
  • $\begingroup$ Hi, what I meant is how can I modify the current fractional delay filter to get the desired fractional delay filter, I want a bandpass fractional delay filter with a phase reponse equal to 0 at 0.25*fs, and with a magnitude equal to 0 during 0 to 0.25*fs $\endgroup$ Jul 8, 2018 at 17:27
  • $\begingroup$ I think you are very optimistic to have that kind of magnitude response, or phase for that matter. $\endgroup$ Jul 9, 2018 at 5:35


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.