


s2let_transform_curvelet_analysis_lm2lmn
Compute (spin) curvelet transform, input in harmonic space,
output in Wigner space.
Default usage :
[f_cur_lmn, f_scal_lm] = s2let_transform_curvelet_analysis_lm2lmn(flm_init, cur_lm, scal_l, <options>)
flm_init is the input field in harmonic space,
cur_lm is the curvelet kernels,
scal_l is the scaling function kernel.
Option :
'B' = { Dilation factor; B > 1 (default=2) }
'L' = { Harmonic band-limit; L > 1 (default=guessed from input) }
'J_min' = { Minimum curvelet scale to consider;
0 <= J_min < log_B(L) (default=0) }
'Spin' = { Spin; (default=0) }
'Reality' = { false [do not assume corresponding signal f real (default)],
true [assume f real (improves performance)] }
'Upsample' = { false [multiresolution algorithm (default)],
true [full resolution curvelets] }
'SpinLowered' = { true [Apply normalisation factors for spin-lowered
curvelets and scaling function.],
false [Apply the usual normalisation factors such
that the curvelets fulfil the admissibility
condition (default)]}
'SpinLoweredFrom' = [integer; if the SpinLowered option is used, this
option indicates which spin number the curvelets
should be lowered from (default = 0)]
-----------------------------------------------------------
S2LET package to perform Wavelet Transform on the Sphere.
Copyright (C) 2012-2016 Boris Leistedt, Jennifer Chan & Jason McEwen
See LICENSE.txt for license details
-----------------------------------------------------------

0001 function [f_cur_lmn, f_scal_lm] = s2let_transform_curvelet_analysis_lm2lmn(flm_init, cur_lm, scal_l, varargin) 0002 0003 % s2let_transform_curvelet_analysis_lm2lmn 0004 % Compute (spin) curvelet transform, input in harmonic space, 0005 % output in Wigner space. 0006 % 0007 % Default usage : 0008 % 0009 % [f_cur_lmn, f_scal_lm] = s2let_transform_curvelet_analysis_lm2lmn(flm_init, cur_lm, scal_l, <options>) 0010 % 0011 % flm_init is the input field in harmonic space, 0012 % cur_lm is the curvelet kernels, 0013 % scal_l is the scaling function kernel. 0014 % 0015 % Option : 0016 % 'B' = { Dilation factor; B > 1 (default=2) } 0017 % 'L' = { Harmonic band-limit; L > 1 (default=guessed from input) } 0018 % 'J_min' = { Minimum curvelet scale to consider; 0019 % 0 <= J_min < log_B(L) (default=0) } 0020 % 'Spin' = { Spin; (default=0) } 0021 % 'Reality' = { false [do not assume corresponding signal f real (default)], 0022 % true [assume f real (improves performance)] } 0023 % 'Upsample' = { false [multiresolution algorithm (default)], 0024 % true [full resolution curvelets] } 0025 % 'SpinLowered' = { true [Apply normalisation factors for spin-lowered 0026 % curvelets and scaling function.], 0027 % false [Apply the usual normalisation factors such 0028 % that the curvelets fulfil the admissibility 0029 % condition (default)]} 0030 % 'SpinLoweredFrom' = [integer; if the SpinLowered option is used, this 0031 % option indicates which spin number the curvelets 0032 % should be lowered from (default = 0)] 0033 % ----------------------------------------------------------- 0034 % S2LET package to perform Wavelet Transform on the Sphere. 0035 % Copyright (C) 2012-2016 Boris Leistedt, Jennifer Chan & Jason McEwen 0036 % See LICENSE.txt for license details 0037 % ----------------------------------------------------------- 0038 0039 sz = length(flm_init(:)); 0040 Lguessed = sqrt(sz); 0041 0042 p = inputParser; 0043 p.addRequired('flm_init', @isnumeric); 0044 p.addRequired('cur_lm', @iscell); 0045 p.addRequired('scal_l', @isnumeric); 0046 p.addParamValue('B', 2, @isnumeric); 0047 p.addParamValue('L', Lguessed, @isnumeric); 0048 p.addParamValue('J_min', 0, @isnumeric); 0049 p.addParamValue('Spin', 0, @isnumeric); 0050 p.addParamValue('Reality', false, @islogical); 0051 p.addParamValue('Upsample', false, @islogical); 0052 p.addParamValue('SpinLowered', false, @islogical); 0053 p.addParamValue('SpinLoweredFrom', 0, @isnumeric); 0054 p.addParamValue('Sampling', 'MW', @ischar); 0055 p.parse(flm_init, cur_lm, scal_l, varargin{:}); 0056 args = p.Results; 0057 0058 J = s2let_jmax(args.L, args.B); 0059 0060 % ----------------- 0061 % Signal Analysis: 0062 % ----------------- 0063 % Curvelet contribution: 0064 for j = args.J_min:J, 0065 band_limit = min([ s2let_bandlimit(j,args.J_min,args.B,args.L) args.L ]); 0066 % Nj = orientational band-limit at j-th scale 0067 Nj = band_limit; 0068 if (args.Reality == 0) 0069 % for the case SO3_STORAGE_PADDED: 0070 if (args.Upsample ~= 0) 0071 f_cur_lmn{j-args.J_min+1} = zeros((2*Nj-1)*args.L^2,1); 0072 else 0073 f_cur_lmn{j-args.J_min+1} = zeros((2*Nj-1)*band_limit^2,1); 0074 end 0075 for en = -Nj+1:Nj-1, 0076 for el = max(abs(args.Spin),abs(en)):band_limit-1, 0077 ind_ln = ssht_elm2ind(el, en); 0078 psi = 8.*pi*pi/(2.*el+1) *conj(cur_lm{j-args.J_min+1}(ind_ln)); 0079 for m = -el:el, 0080 ind_lm = ssht_elm2ind(el, m); 0081 if (args.Upsample ~= 0) 0082 ind_lmn = so3_elmn2ind(el,m,en,args.L,Nj); 0083 else 0084 ind_lmn = so3_elmn2ind(el,m,en,band_limit,Nj); 0085 end 0086 f_cur_lmn{j-args.J_min+1}(ind_lmn) = flm_init(ind_lm) * psi; 0087 end 0088 end 0089 end 0090 else % real setting: 0091 if (args.Upsample ~= 0) 0092 f_cur_lmn{j-args.J_min+1} = zeros(Nj*args.L^2,1); 0093 else 0094 f_cur_lmn{j-args.J_min+1} = zeros(Nj*band_limit^2,1); 0095 end 0096 for el = 1:band_limit-1, 0097 for m = -el:el, 0098 ind_lm = ssht_elm2ind(el, m); 0099 % (n =0) terms: 0100 ind_lnzero = ssht_elm2ind(el, 0); 0101 psizero = 8.*pi*pi/(2.*el+1) *conj(cur_lm{j-args.J_min+1}(ind_lnzero)); 0102 ind_lmnzero = so3_elmn2ind(el,m,0,band_limit,Nj,'Reality', args.Reality); 0103 f_cur_lmn{j-args.J_min+1}(ind_lmnzero) = flm_init(ind_lm) *psizero; 0104 % (n ~=0) terms: 0105 for en = 1: Nj-1, 0106 if (el >= en) 0107 ind_ln = ssht_elm2ind(el, en); 0108 psi = 8.*pi*pi/(2.*el+1) *conj(cur_lm{j-args.J_min+1}(ind_ln)); 0109 if (args.Upsample == 0) 0110 ind_lmn = so3_elmn2ind(el,m,en,band_limit,Nj,'Reality', args.Reality); 0111 else 0112 ind_lmn = so3_elmn2ind(el,m,en,args.L,Nj,'Reality', args.Reality); 0113 end 0114 f_cur_lmn{j-args.J_min+1}(ind_lmn) = flm_init(ind_lm) * psi; 0115 end 0116 end 0117 end 0118 end 0119 end % end if loop for Reality Option 0120 end % end j-loop 0121 0122 0123 % Scaling function contribution: 0124 if (args.Upsample ~= 0) 0125 band_limit = args.L ; 0126 else 0127 band_limit = min([ s2let_bandlimit(args.J_min-1, args.J_min, args.B,args.L) args.L ]); 0128 end 0129 f_scal_lm = zeros(band_limit^2,1); 0130 if (args.Reality == 0) 0131 for el = abs(args.Spin):band_limit-1, 0132 phi = sqrt(4.0*pi/(2.*el+1))*scal_l(el^2+el+1,1); 0133 for m = -el:el, 0134 lm_ind=ssht_elm2ind(el, m); 0135 f_scal_lm(lm_ind) = flm_init(lm_ind) * phi; 0136 end 0137 end 0138 else % real setting: 0139 for el = 0 :band_limit-1, 0140 phi = sqrt(4.0*pi/(2.*el+1))*scal_l(el^2+el+1,1); 0141 for m = -el:el, 0142 lm_ind=ssht_elm2ind(el, m); 0143 f_scal_lm(lm_ind) = flm_init(lm_ind) * phi; 0144 end 0145 end 0146 end % end if-loop for Reality Option 0147 0148 0149 end 0150