Learn R Programming

rje (version 1.12.1)

fastHadamard: Compute fast Hadamard-transform of vector

Description

Passes vector through Hadamard orthogonal design matrix. Also known as the Fast Walsh-Hadamard transform.

Usage

fastHadamard(x, pad = FALSE)

Value

A vector of the same length as x

Arguments

x

vector of values to be transformed

pad

optional logical asking whether vector not of length \(2^k\) should be padded with zeroes

Author

Robin Evans

Details

This is equivalent to multiplying by designMatrix(log2(length(x))) but should run much faster

See Also

designMatrix, subsetMatrix.

Examples

Run this code

fastHadamard(1:8)
fastHadamard(1:5, pad=TRUE)

Run the code above in your browser using DataLab