Walsh matrix: Difference between revisions
Content deleted Content added
Thundergnat (talk | contribs) New draft task and Raku example |
Thundergnat (talk | contribs) m Add some links, clarifications |
||
Line 3: | Line 3: | ||
A '''Walsh matrix''' is a specific square matrix of dimensions 2<sup>''n''</sup>, where ''n'' is some particular natural number. The |
A '''Walsh matrix''' is a specific square matrix of dimensions 2<sup>''n''</sup>, where ''n'' is some particular natural number. The elements of the matrix are either '''+1''' or '''−1''' and its rows as well as columns are orthogonal, ''i.e. dot product is zero''. Each row of a Walsh matrix corresponds to a Walsh function. |
||
Walsh matrices are a special case of Hadamard matrices. The ''naturally ordered'' Hadamard (Walsh) matrix is defined by the recursive formula below, and the ''sequency-ordered'' Hadamard (Walsh) matrix is formed by rearranging the rows so that the number of sign changes in a row is in increasing order. |
Walsh matrices are a special case of Hadamard matrices. The ''naturally ordered'' Hadamard (Walsh) matrix is defined by the recursive formula below, and the ''sequency-ordered'' Hadamard (Walsh) matrix is formed by rearranging the rows so that the number of sign changes in a row is in increasing order. |
||
Line 38: | Line 38: | ||
;* Write a routine that, given a natural number '''k''', returns a '''naturally ordered''' Walsh matrix of order 2<sup>''k''</sup>. |
;* Write a routine that, given a natural number '''k''', returns a '''naturally ordered''' Walsh matrix of order 2<sup>''k''</sup>. |
||
;* Display a few sample generated matrices. |
;* Display a few sample generated matrices. |
||
::''Traditionally, Walsh matrices use '''1''' & '''-1''' to denote the different cell values in text mode, or ''' |
::''Traditionally, Walsh matrices use '''1''' & '''-1''' to denote the different cell values in text mode, or '''green''' and '''red''' blocks in image mode. You may use whichever display mode is most convenient for your particular language.'' |
||
;Stretch |
;Stretch |
||
;* Also generate '''sequency ordered''' Walsh matrices. |
;* Also, optionally generate '''sequency ordered''' Walsh matrices. |
||
::''A sequency ordered Walsh matrix has the rows sorted by number of sign changes.'' |
::''A sequency ordered Walsh matrix has the rows sorted by number of sign changes.'' |
||
;See also |
|||
;* [[wp:Walsh_matrix|Wikipedia: Walsh matrix]] |
|||
;* [[Kronecker product|Related task: Kronecker product]] |
|||