1[/ 2Copyright (c) 2019 Nick Thompson 3Copyright (c) 2019 Paul A. Bristow 4Use, modification and distribution are subject to the 5Boost Software License, Version 1.0. (See accompanying file 6LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7] 8 9[section:wavelet_transforms Wavelet Transforms] 10 11[heading Synopsis] 12 13``` 14 #include <boost/math/quadrature/wavelet_transforms.hpp> 15 16 namespace boost::math::quadrature { 17 18 template<class F, typename Real, int p> 19 class daubechies_wavelet_transform 20 { 21 public: 22 daubechies_wavelet_transform(F f, int grid_refinements = -1, Real tol = 100*std::numeric_limits<Real>::epsilon(), 23 int max_refinements = 12) {} 24 25 daubechies_wavelet_transform(F f, boost::math::daubechies_wavelet<Real, p> wavelet, Real tol = 100*std::numeric_limits<Real>::epsilon(), 26 int max_refinements = 12); 27 28 auto operator()(Real s, Real t)->decltype(std::declval<F>()(std::declval<Real>())) const; 29 30 }; 31 } 32``` 33 34The wavelet transform of a function /f/ with respect to a wavelet \u03C8 is 35 36[$../graphs/wavelet_transform_definition.svg] 37 38For compactly supported Daubechies wavelets, the bounds can always be taken as finite, and we have 39 40[$../graphs/daubechies_wavelet_transform_definition.svg] 41 42which also defines the /s/=0 case. 43 44The code provided by Boost merely forwards a lambda to the trapezoidal quadrature routine, which converges quickly due to the Euler-Maclaurin summation formula. 45However, the convergence is not as rapid as for infinitely differentiable functions, so the default tolerances are modified. 46 47A basic usage is 48 49 auto psi = daubechies_wavelet<double, 8>(); 50 auto f = [](double x) { 51 return sin(1/x); 52 }; 53 auto Wf = daubechies_wavelet_transform(f, psi); 54 55 double w = Wf(0.8, 7.2); 56 57An image from this function is shown below. 58 59[$../graphs/scalogram_sin1t_light.png] 60 61 62[endsect] [/section:wavelet_transforms] 63