RosettaCodeData/Task/Deconvolution-1D/Mathematica/deconvolution-1d.math

6 lines
195 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
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]]