Learn R Programming

rje (version 1.10.16)

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)

Arguments

x

vector of values to be transformed

pad

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

Value

A vector of the same length as x

Details

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

See Also

designMatrix, subsetMatrix.

Examples

Run this code
# NOT RUN {
fastHadamard(1:8)
fastHadamard(1:5, pad=TRUE)

# }

Run the code above in your browser using DataLab