September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
8
Task/Deconvolution-1D/Zkl/deconvolution-1d-1.zkl
Normal file
8
Task/Deconvolution-1D/Zkl/deconvolution-1d-1.zkl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
var [const] GSL=Import("zklGSL"); // libGSL (GNU Scientific Library)
|
||||
fcn dconv1D(f,g){
|
||||
fsz,hsz:=f.len(), g.len() - fsz +1;
|
||||
A:=GSL.Matrix(g.len(),hsz);
|
||||
foreach n,fn in ([0..].zip(f)){ foreach rc in (hsz){ A[rc+n,rc]=fn } }
|
||||
h:=A.AxEQb(g);
|
||||
h
|
||||
}
|
||||
7
Task/Deconvolution-1D/Zkl/deconvolution-1d-2.zkl
Normal file
7
Task/Deconvolution-1D/Zkl/deconvolution-1d-2.zkl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
f:=GSL.VectorFromData(-3,-6,-1,8,-6,3,-1,-9,-9,3,-2,5,2,-2,-7,-1);
|
||||
g:=GSL.VectorFromData(24,75,71,-34,3,22,-45,23,245,25,52,25,-67,-96,96,31,55,36,29,-43,-7);
|
||||
h:=dconv1D(f,g);
|
||||
h.format().println();
|
||||
|
||||
f:=dconv1D(h,g);
|
||||
f.format().println();
|
||||
11
Task/Deconvolution-1D/Zkl/deconvolution-1d-3.zkl
Normal file
11
Task/Deconvolution-1D/Zkl/deconvolution-1d-3.zkl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fcn deconv(g,f){
|
||||
flen, glen, delta:=f.len(), g.len(), glen - flen + 1;
|
||||
result:=List.createLong(delta); // allocate list with space for items
|
||||
foreach n in (delta){
|
||||
e:=g[n];
|
||||
lowerBound:=(if (n>=flen) n - flen + 1 else 0);
|
||||
foreach i in ([lowerBound .. n-1]){ e-=result[i]*f[n - i]; }
|
||||
result.append(e/f[0]);
|
||||
}
|
||||
result;
|
||||
}
|
||||
6
Task/Deconvolution-1D/Zkl/deconvolution-1d-4.zkl
Normal file
6
Task/Deconvolution-1D/Zkl/deconvolution-1d-4.zkl
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
h:=T(-8,-9,-3,-1,-6,7);
|
||||
f:=T(-3,-6,-1,8,-6,3,-1,-9,-9,3,-2,5,2,-2,-7,-1);
|
||||
g:=T(24,75,71,-34,3,22,-45,23,245,25,52,25,-67,
|
||||
-96,96,31,55,36,29,-43,-7);
|
||||
println(deconv(g, f) == h, " ", deconv(g, f));
|
||||
println(deconv(g, h) == f, " ", deconv(g, h));
|
||||
Loading…
Add table
Add a link
Reference in a new issue