-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1D Fermat Number Transform deconvolution #14
base: master
Are you sure you want to change the base?
Conversation
Build fails cause this PR is not merged yet JuliaRegistries/General#7482 |
h = [3, 2, 0, 0] | ||
y = [3, 5, 3, 0] | ||
x = fermat(y, h, 4, 17) | ||
@test Circulant(h) * x == y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circular convolution again, it uses the same fft approach as above
https://github.com/JuliaMatrices/SpecialMatrices.jl/blob/master/src/toeplitz.jl#L54
I have feeling that we need some package with better api to perform convolution. I don't like the fact that floating point arithmetic is used here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you have a plan 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The biggest limitation of this method is that each element of H matrix needs to have inverse, what is hard to achieve for real data, so I'm not sure if Deconvolution.jl is good place for algorithms like this.
While currently implemented methods are probably easier to use in practice, I don't see why this would be a problem for including this method here 😉
h = [3, 2, 0, 0] | ||
y = [3, 5, 3, 0] | ||
x = fermat(y, h, 4, 17) | ||
@test Circulant(h) * x == y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you have a plan 🙂
xm = ifnt(H_inv .* fnt(convolved, g, q), g, q) | ||
x0 = mod.(Dm * xm, q) | ||
x0[x0 .>= bias] .-= q | ||
x = x0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x
will be exactly the same thing as x0
, this means that chaning x0
will have the same effect on x
and vice versa. Is this what you want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this assignment is just to follow variable naming form the paper, x0 is not modified later, and new variable xj is introduced later int the loop.
Codecov Report
@@ Coverage Diff @@
## master #14 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 4 +1
Lines 25 48 +23
=====================================
+ Hits 25 48 +23
Continue to review full report at Codecov.
|
@giordano build is green, but please do not merge yet, I need to add docs and replace fft with precise integer convolution. To do that I think I will start a new project for integer DSP algorithms. |
I implemented 1D case of FNT deconvolution what partially solves #2 I'll update docs if it makes sense.
The biggest limitation of this method is that each element of H matrix needs to have inverse, what is hard to achieve for real data, so I'm not sure if Deconvolution.jl is good place for algorithms like this.