s2let_transform_analysis_lm2wav Compute spin directional wavelet transform, input in harmonic space, output in pixel space. Default usage : [f_wav, f_scal] = s2let_transform_analysis_lm2wav(flm, <options>) flm is the input field in harmonic space, f_wav contains the output wavelet contributions, f_scal contains the output scaling contributions, Option : 'B' = { Dilation factor; B > 1 (default=2) } 'L' = { Harmonic band-limit; L > 1 (default=guessed from input) } 'N' = { Azimuthal/directional band-limit; N > 1 (default=L) } 'Spin' = { Spin; (default=0) } 'J_min' = { Minimum wavelet scale to consider; 0 <= J_min < log_B(L) (default=0) } 'Upsample' = { false [multiresolution algorithm (default)], true [full resolution wavelets] } 'Sampling' = { 'MW' [McEwen & Wiaux sampling (default)], 'MWSS' [McEwen & Wiaux symmetric sampling] } 'Reality' = { false [do not assume corresponding signal f real (default)], true [assume f real (improves performance)] } 'OriginalSpin' = [integer; if the SpinLowered option is used, this option indicates which spin number the wavelets should be lowered from (default = 0)] S2LET package to perform Wavelets transform on the Sphere. Copyright (C) 2012-2015 Boris Leistedt & Jason McEwen See LICENSE.txt for license details
0001 function [f_wav, f_scal] = s2let_transform_analysis_lm2wav(flm, varargin) 0002 0003 % s2let_transform_analysis_lm2wav 0004 % Compute spin directional wavelet transform, input in harmonic space, 0005 % output in pixel space. 0006 % 0007 % Default usage : 0008 % 0009 % [f_wav, f_scal] = s2let_transform_analysis_lm2wav(flm, <options>) 0010 % 0011 % flm is the input field in harmonic space, 0012 % f_wav contains the output wavelet contributions, 0013 % f_scal contains the output scaling contributions, 0014 % 0015 % Option : 0016 % 'B' = { Dilation factor; B > 1 (default=2) } 0017 % 'L' = { Harmonic band-limit; L > 1 (default=guessed from input) } 0018 % 'N' = { Azimuthal/directional band-limit; N > 1 (default=L) } 0019 % 'Spin' = { Spin; (default=0) } 0020 % 'J_min' = { Minimum wavelet scale to consider; 0021 % 0 <= J_min < log_B(L) (default=0) } 0022 % 'Upsample' = { false [multiresolution algorithm (default)], 0023 % true [full resolution wavelets] } 0024 % 'Sampling' = { 'MW' [McEwen & Wiaux sampling (default)], 0025 % 'MWSS' [McEwen & Wiaux symmetric sampling] } 0026 % 'Reality' = { false [do not assume corresponding signal f real (default)], 0027 % true [assume f real (improves performance)] } 0028 % 'OriginalSpin' = [integer; if the SpinLowered option is used, this 0029 % option indicates which spin number the wavelets 0030 % should be lowered from (default = 0)] 0031 % 0032 % S2LET package to perform Wavelets transform on the Sphere. 0033 % Copyright (C) 2012-2015 Boris Leistedt & Jason McEwen 0034 % See LICENSE.txt for license details 0035 0036 sz = length(flm(:)); 0037 Lguessed = sqrt(sz); 0038 0039 p = inputParser; 0040 p.addRequired('flm', @isnumeric); 0041 p.addParamValue('B', 2, @isnumeric); 0042 p.addParamValue('L', Lguessed, @isnumeric); 0043 p.addParamValue('J_min', 0, @isnumeric); 0044 p.addParamValue('N', Lguessed, @isnumeric); 0045 p.addParamValue('Spin', 0, @isnumeric); 0046 p.addParamValue('Upsample', false, @islogical); 0047 p.addParamValue('Sampling', 'MW', @ischar); 0048 p.addParamValue('Reality', false, @islogical); 0049 p.addParamValue('OriginalSpin', 0, @isnumeric); 0050 p.parse(flm, varargin{:}); 0051 args = p.Results; 0052 0053 flm_vec = flm(:); 0054 0055 if(all(isreal(flm_vec))) 0056 flm_vec = complex(flm_vec,0); 0057 end 0058 0059 [f_wav_vec, f_scal_vec] = s2let_transform_analysis_lm2wav_mex(flm_vec, args.B, args.L, args.J_min, ... 0060 args.N, args.Spin, ... 0061 args.Reality, args.Upsample, ... 0062 args.OriginalSpin, ... 0063 args.Sampling); 0064 0065 if strcmp(args.Sampling, 'MWSS') 0066 f_scal = s2let_mwss_vec2arr(f_scal_vec); 0067 0068 J = s2let_jmax(args.L, args.B); 0069 f_wav = cell(J+1-args.J_min, args.N); 0070 offset = 0; 0071 for j = args.J_min:J 0072 for en = 1:args.N 0073 if args.Upsample 0074 band_limit = args.L; 0075 else 0076 band_limit = min([ s2let_bandlimit(j,args.J_min,args.B,args.L) args.L ]); 0077 end 0078 temp = zeros(band_limit+1, 2*band_limit); 0079 for t = 1:band_limit+1 0080 for p = 1:2*band_limit 0081 ind = offset + (t-1) * 2 * band_limit + p; 0082 temp(t,p) = f_wav_vec(1,ind); 0083 end 0084 end 0085 f_wav{j+1-args.J_min, en} = temp; 0086 offset = offset + (band_limit+1) * 2*band_limit; 0087 end 0088 end 0089 else 0090 f_scal = s2let_mw_vec2arr(f_scal_vec); 0091 0092 J = s2let_jmax(args.L, args.B); 0093 f_wav = cell(J+1-args.J_min, args.N); 0094 offset = 0; 0095 for j = args.J_min:J 0096 for en = 1:args.N 0097 if args.Upsample 0098 band_limit = args.L; 0099 else 0100 band_limit = min([ s2let_bandlimit(j,args.J_min,args.B,args.L) args.L ]); 0101 end 0102 temp = zeros(band_limit, 2*band_limit-1); 0103 for t = 1:band_limit 0104 for p = 1:2*band_limit-1 0105 ind = offset + (t-1) * ( 2 * band_limit - 1) + p; 0106 temp(t,p) = f_wav_vec(1,ind); 0107 end 0108 end 0109 f_wav{j+1-args.J_min, en} = temp; 0110 offset = offset + band_limit * (2*band_limit-1); 0111 end 0112 end 0113 end