Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Deconvolution-1D/Racket/deconvolution-1d-1.rkt
Normal file
18
Task/Deconvolution-1D/Racket/deconvolution-1d-1.rkt
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#lang racket
|
||||
(require math/matrix)
|
||||
(define T matrix-transpose)
|
||||
|
||||
(define (convolution-matrix f m n)
|
||||
(define l (matrix-num-rows f))
|
||||
(for*/matrix m n ([i (in-range 0 m)] [j (in-range 0 n)])
|
||||
(cond [(or (< i j) (>= i (+ j l))) 0]
|
||||
[(matrix-ref f (- i j) 0)])))
|
||||
|
||||
(define (least-square X y)
|
||||
(matrix-solve (matrix* (T X) X) (matrix* (T X) y)))
|
||||
|
||||
(define (deconvolve g f)
|
||||
(define lg (matrix-num-rows g))
|
||||
(define lf (matrix-num-rows f))
|
||||
(define lh (+ (- lg lf) 1))
|
||||
(least-square (convolution-matrix f lg lh) g))
|
||||
6
Task/Deconvolution-1D/Racket/deconvolution-1d-2.rkt
Normal file
6
Task/Deconvolution-1D/Racket/deconvolution-1d-2.rkt
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
(define f (col-matrix [-3 -6 -1 8 -6 3 -1 -9 -9 3 -2 5 2 -2 -7 -1]))
|
||||
(define h (col-matrix [-8 -9 -3 -1 -6 7]))
|
||||
(define g (col-matrix [24 75 71 -34 3 22 -45 23 245 25 52 25 -67 -96 96 31 55 36 29 -43 -7]))
|
||||
|
||||
(deconvolve g f)
|
||||
(deconvolve g h)
|
||||
2
Task/Deconvolution-1D/Racket/deconvolution-1d-3.rkt
Normal file
2
Task/Deconvolution-1D/Racket/deconvolution-1d-3.rkt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#<array '#(6 1) #[-8 -9 -3 -1 -6 7]>
|
||||
#<array '#(16 1) #[-3 -6 -1 8 -6 3 -1 -9 -9 3 -2 5 2 -2 -7 -1]>
|
||||
Loading…
Add table
Add a link
Reference in a new issue