The following code executes seemlessly
wave = HaarWavelet[];
type = "PrimalLowpass";
h = WaveletFilterCoefficients[
wave, type,
WorkingPrecision -> \[Infinity]
];
h = Flatten[
Take[h,
Range[1, Length[h]],
Table[2, {Length[h]}]
]
]
But when wrapping it with in a Module some goes awry. Consider the function
getWaveletFilter[wave_, type_]:=
Module[{filter}, (* treated as local *)
filter = WaveletFilterCoefficients[
wave, type, WorkingPrecision -> \[Infinity]
]
filter = Flatten[
Take[filter,
Range[1, Length[filter]],
Table[2, {Length[filter]}]
]
]
filter
]
I would like getWaveletFilter[HaarWavelet[], "PrimalHighpass"]
to return
{1/2, -1/2}
Instead Mathematica, has all sorts of complains. Any suggestion?
You need to put a semi-colon between each action in your module to separate them:
Read CompoundExpression (;) for a better understanding.