# Bandpass Fractional Delay Filter

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)

% HLAGR2

% MATLAB m-file for fractional delay approximation

% by LAGRANGE INTERPOLATION method

% 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;

%

h=ones(1,(N+1));

%

for n=0:N

n1=n+1;

for k=0:N

if (k~=n)

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

end  % if


end; % for k

end; % for n

end

• i would expect that the phase would be linear and pass through f=0 – user28715 Jul 8 '18 at 17:24
• 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 – Amro Goneim Jul 8 '18 at 17:27
• I think you are very optimistic to have that kind of magnitude response, or phase for that matter. – a concerned citizen Jul 9 '18 at 5:35