# Question:How to implement decomposition function respect basis wavelet Haar and scaling Haar fucntions form MRA?

## Question:How to implement decomposition function respect basis wavelet Haar and scaling Haar fucntions form MRA?

Maple 2021

I describe my problem accurately in mws file. I have a step function

 > First step. This is f(x) function
 >
 (1)
 > Next step. I try to approximate this function f(x) using wavelet transform, and  I  want to decomposite this function, choose wavelet Haar function and scaling functon  , choose basisn funtion from multiresolution analysis of the Lebesgue space  L^2(R). I choose  such wavelet fucntion  from space MRA V0 and scaling function from space MRA V0:
 >
 (2)
 >
 (3)
 > After I try approximate initial function f(x), decomposed using such contruction:
 >
 >
 > where coeff m shows, space MRA, to which the basis function belongs, and kk shows,basis function shift (x-k)
 > i.e. I try decompose function respective to basis function, where coeffs calculate the such way:
 >
 >
 > The approximation is considered satisfactory if the following condition is  true:
 >
 >
 > For example  calculate that such way:
 >
 > if the wavelet Haar functions:
 >
 (4)
 >
 > Then vector of Haar functions compute using the follow code:
 >
 >
 > Then integrals
 >
 >
 > where  is an d-square matrix called an operational matrix of integration
 >
 >
 > And now, it's not working, so I have troubles for calculate coeffs and writing and  plotting this result, so, I have some questions: 1) How to calculate coeffs and   for my fucntion f(x) and get value of coeffs? 2) How to implement integration and write the final sum (approximation of function f(x)? 3) How to calculate
 >
 >
 > and plot initial function f(x) and approximation sum at one plot?
 > Do I understand correctly that I need to calculate this integral for my function on each interval of my function?
 >
 >
 > How to implement this procedure?

Code for calculating procs a I try ude from this source: http://www.m-hikari.com/ams/ams-2012/ams-125-128-2012/sunmonuAMS125-128-2012.pdf