1function [phit,phitt] = window(b,w)
2% WINDOW1 generates the Kaiser Bessel window function and its time
3% derivative
4%
5% [phit,phitt] = window(b,w)
6% returns the Kaiser Bessel window function phit and its time derivative
7% phitt whose support is w.
8%
9% Input values:
10% b = log(1/tol), where tol phit(0) = phit(delta) = tol
11% w : the width of the support of phit
12%
13% Note: fuNction rewritten from a Julia code provided by Alex Barnett
15cen = w/2.0; % center of the window function
16prefac = (1/w) * b/(sinh(b));
17phit = @(x) prefac*besseli(0,b*sqrt(1-((2/w)*(x-cen)).^2));
18phitt = @(x) prefac*besseli(1,b*sqrt(1-((2/w)*(x-cen)).^2)).*(-4*b*(x - cen))./((w^2)*sqrt(1-((2/w)*(x-cen)).^2));
20end