-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add walsh(n) function that returns a Walsh matrix #28
Conversation
…mutation of a Hadamard matrix.
Also needs some tests, e.g. @testset "walsh(n)" begin
@test walsh(8) == [1 1 1 1 1 1 1 1; 1 1 1 1 -1 -1 -1 -1; 1 1 -1 -1 -1 -1 1 1; 1 1 -1 -1 1 1 -1 -1; 1 -1 -1 1 1 -1 -1 1; 1 -1 -1 1 -1 1 1 -1; 1 -1 1 -1 -1 1 -1 1; 1 -1 1 -1 1 -1 1 -1]
@test_throws ArgumentError walsh(24)
for n in 2 .^ (0:10)
@test fwht(Matrix(I(n)), 1) * n ≈ walsh(n) rtol=1e-13
end
end |
Co-authored-by: Steven G. Johnson <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #28 +/- ##
==========================================
+ Coverage 78.23% 78.84% +0.61%
==========================================
Files 1 1
Lines 147 156 +9
==========================================
+ Hits 115 123 +8
- Misses 32 33 +1 ☔ View full report in Codecov by Sentry. |
Thank you for your review. I have incorporated the suggested changes and tests into the code and verified that the tests passed. |
You should also add a note about the |
I updated README.md. |
I added a function
walsh(n)
that returns a Walsh matrix by bit-reversal permutation of a Hadamard matrix. The following package provides a similar function but merges it into Hadamard.jl would be helpful.https://github.com/syoshida1983/Walsh.jl