-
Notifications
You must be signed in to change notification settings - Fork 4
/
abelpoisson.m
58 lines (47 loc) · 1.42 KB
/
abelpoisson.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
function [K,Al,Dlta,Kp]=abelpoisson(h,Dlta,L)
% [K,Al,Dlta,Kp]=ABELPOISSON(h,Dlta,L)
%
% Calculates the Abel-Poisson kernel and verifies the funky equation
% producing it --- see the work of Freeden and friends..
%
% INPUT:
%
% h The concentration parameter, can be a vector
% L The bandwidth of the explicit expression - if desired
%
% OUTPUT:
%
% K The kernels in terms of spherical distance, [length(Delta)*length(h)]
% Al The degree-dependent sequence
% Dlta The geodesic angular distance
% Kp The kernel in a bandlimited (approximate) expansion
%
% EXAMPLE:
%
% [K,Al,Dlta,Kp]=abelpoisson;
%
% Last modified by fjsimons-at-alum.mit.edu, 09/23/2023
defval('h',0.50)
defval('L',50)
crsfin=unique([linspace(-pi/6,pi/6,100) linspace(-pi,pi,900)]);
defval('Dlta',crsfin)
% Make dimensions work out
N=length(Dlta);
Dlta=Dlta(:);
h=h(:)';
hh=repmat(h,N,1);
% Calculate the kernel
K=(1-hh.^2)./4/pi./(1+hh.^2-2*cos(Dlta)*h).^(3/2);
% Return the spectrum
Al=repmat(h,L+1,1).^(repmat(-[0:L]'/2,1,length(h)));
if nargout==4
% Calculate an alternative representation of the kernel
Kp=NaN(size(K));
for index=1:length(h)
Kp(:,index)=sum(repmat((2*[0:L]'+1)/4/pi.*Al(:,index).^-2,1,N).*...
plm(0:L,0,cos(Dlta)),1);
% Report on the fit
disp(sprintf('Relative misfit L = %i approximation at h = %3.2f : %5.3e %s',...
L,h(index),norm(K(:,index)-Kp(:,index))./norm(K(:,index))*100,'%'))
end
end