⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fht.m

📁 SparseLab is a Matlab software package designed to find sparse solutions to systems of linear equati
💻 M
字号:
function y = FHT(x)
% FHT: Computes the Hadamard transform of a signal
%  Usage:
%    y = FHT(x);
%  Inputs:
%    x      signal of dyadic length
%  Outputs:
%    y      Hadamard transform coefficients
%
% Description
%   FHT computes the Fast Hadamard transform of the signal x.
% See Also
%   IFHT

x = x(:);
n = length(x);

y = x;
t = zeros(size(x));  

odds = 1:2:n;
evens = 2:2:n;

for ii = 1:log2(n)
    t(odds) = y(odds) + y(evens);
    t(evens) = y(odds) - y(evens);
    y(1:(n/2)) = t(odds);
    y((n/2+1):n) = t(evens);
end

y = y ./ sqrt(n);
%% Part of SparseLab Version:100% Created Tuesday March 28, 2006% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail sparselab@stanford.edu%

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -