1D Walsh Transform

Version 1.0.0.0 (2.22 KB) by Andre
Function to generate a Walsh-Matrix one can use to do a 1D Walsh Transform
1.8K Downloads
Updated 30 Jun 2008

View License

This function generates a Walsh-Matrix which can be used to perform the 1D-Walsh transform on a vector:
Example:
>> walsh(4)*[1 2 3 4]'

The returned matrix is internally cached within the function (persistent) which implies that it is efficient to call the function in a loop as long as the arguments passed remain the same.

The transform is faster than other (loop-) implementations found here on the File Exchange since the loop induces a lot of overhead.

This file is actually just part of my 2D-Walsh-Transform file submission (ID 20312).

Type "help walsh" for help.

>> help walsh
WALSH Hadamard matrix.
WALSH(N) is a Walsh matrix of order N, that is,
a matrix W with elements 1 or -1 such that W'*W = N*EYE(N).
An N-by-N Walsh matrix with N > 2.
This function handles only the cases where N is a power of 2.
The function internally cashes the generated matrix so that
it is efficient to call this function multiple times if the
passed parameters remain the same among the calls.

WALSH(N,CLASSNAME) produces a matrix of class CLASSNAME.
CLASSNAME must be either 'single' or 'double' (the default).

Cite As

Andre (2024). 1D Walsh Transform (https://www.mathworks.com/matlabcentral/fileexchange/20500-1d-walsh-transform), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: Faster 2D-Hadmard Tranform

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0