Walsh matrix: Difference between revisions
Content deleted Content added
Line 803: | Line 803: | ||
<syntaxhighlight lang="jq"> |
<syntaxhighlight lang="jq"> |
||
## Generate a Walsh matrix of size 2^$n for $n >= 1 |
## Generate a Walsh matrix of size 2^$n for $n >= 1 |
||
def |
def walsh: |
||
. as $n |
. as $n |
||
| [[1, 1], [1, -1]] as $w2 |
| [[1, 1], [1, -1]] as $w2 |
||
| if $n < 2 then $w2 else kprod($w2; $n - 1 | |
| if $n < 2 then $w2 else kprod($w2; $n - 1 | walsh) end; |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
<syntaxhighlight lang="jq"> |
<syntaxhighlight lang="jq"> |