function Y = FastProd(X)
% X is 2^k -by- m for some k>=0.
% Y = W_k * X

[n,m] = size(X);
if n==1
    Y = X;
else
    m = n/2;
    Z1 = FastProd(X(1:m,:));
    Z2 = FastProd(X(m+1:n,:));
    Y = [Z1+Z2 ; Z1-Z2]/2;
end