1
$\begingroup$

For my masters task I have to perform a Haar wavelet transform using an L1 norm. But Mathematica's built-in wavelet library can work only with L2 norm space. I tried to do this:

haarBasic[t_] := If[0 <= t <= 0.5, 1, If[0.5 <= t <= 1, -1, 0]]
haarBasic[t_] := If[0 <= t <= 0.5, 1, If[0.5 <= t <= 1, -1, 0]]


haarCoeffs[list_List, N_] := 
    Module[{coeffs = Table[c[i][j], {i, N}, {j, 2^i - 1}], minimazed},
      minimazed = NMinimize[
          Sum[Abs[Sum[
             coeffs[[i, j]] haarBasisFunc[t, i, j], {i, N}, {j, 
                2^i - 1}] - list[[t]]], {t, Length@list}], coeffs];
          Print[minimazed[[1]]];
          coeffs /. minimazed[[2]]
   ];

but it does not work. I have syntax problems and understanding problem. Because all books what I have seen (Daubechies, for example) has focused on the L2 norm spaces.

Can someone help me?

$\endgroup$

closed as unclear what you're asking by Daniel Lichtblau, MarcoB, happy fish, gwr, bbgodfrey Mar 19 '17 at 12:22

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ What is the definition of haarBasisFunc? $\endgroup$ – bill s Mar 14 '17 at 21:46
  • $\begingroup$ haarBasisFunc[t_, k_, n_] := 2^(k/2) haarBasic[2^k t - n]; Sorry, I failed with copy-paste. $\endgroup$ – Maxim Yalymov Mar 18 '17 at 9:43