Fast Walsh-Hadamard transform
y = fwht(x) y = fwht(x,n) y = fwht(x,n,ordering)
the coefficients of the discrete Walsh-Hadamard transform.
a input vector having real/integer values. If x is a matrix then fast walsh-hadamard transform is calculated on each column of x.
discrete walsh-hadamard transform is calculated upto n point of the input signal. If the length of x is longer than n then x is truncated and if x is shorter then x is padded with 0.
ordering specifies the ordering used for the output coefficients of the fast walsh-hadamard transform. If no ordering is selected default ordering is used.
Fast Walsh-Hadamard transform is similar to the Cooley-Tukey algorithm. Since the Walsh matrix is symmetric, both the forward and inverse transformations are identical operations except for the scaling factor of 1/N. The input 'ordering' can take 3 options. 'sequency' - Coefficients are having increasing sequency value, where each row has an additional zero crossing. This is the default option. 'hadamard' - Coefficients are having normal Hadamard order. 'dyadic' - Coefficients are having Gray code order, where a single bit change occurs from one coefficient to the next.
a = [2 12 0 10 5 6 1]; b = fwht(a); <p class="para">This transformation can be used in the electrocardiogram (ECG) signal. The length of the ECG signal is very large and needs to be stored for analysis in future time. That is why Walsh-Hadamard transformations are very much useful for this application as it produces compression to the input signal thus need less storage and rapidly done the reconstruction. It is also used in the spread-spectrum based communication technologies like CDMA.</p> | ![]() | ![]() |