RosettaCodeData/Task/Deconvolution-1D/Mathematica/deconvolution-1d.math
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

5 lines
195 B
Text

deconv[f_List, g_List] :=
Module[{A =
SparseArray[
Table[Band[{n, 1}] -> f[[n]], {n, 1, Length[f]}], {Length[g], Length[f] - 1}]},
Take[LinearSolve[A, g], Length[g] - Length[f] + 1]]