September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
20
Task/Deconvolution-1D/Phix/deconvolution-1d.phix
Normal file
20
Task/Deconvolution-1D/Phix/deconvolution-1d.phix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
function deconv(sequence g, sequence f)
|
||||
integer lf = length(f)
|
||||
sequence h = repeat(0,length(g)-lf+1)
|
||||
for n = 1 to length(h) do
|
||||
atom e = g[n]
|
||||
for i=max(n-lf,0) to n-2 do
|
||||
e -= h[i+1] * f[n-i]
|
||||
end for
|
||||
h[n] = e/f[1]
|
||||
end for
|
||||
return h
|
||||
end function
|
||||
|
||||
constant h = {-8,-9,-3,-1,-6,7}
|
||||
constant f = {-3,-6,-1,8,-6,3,-1,-9,-9,3,-2,5,2,-2,-7,-1}
|
||||
constant g = {24,75,71,-34,3,22,-45,23,245,25,52,25,-67,
|
||||
-96,96,31,55,36,29,-43,-7}
|
||||
sequence r
|
||||
r = deconv(g, f) ?{r==h,r}
|
||||
r = deconv(g, h) ?{r==f,r}
|
||||
Loading…
Add table
Add a link
Reference in a new issue