Цитата(Xenia @ Jul 19 2013, 00:23)

Вроде бы функции Уолша в явном виде не генерят
генерят. Пусть нужен i-ый бит j-ой последовательности Уолша-Аадамара длины 2^N:
b = parity(j AND i). parity рассчитывает mod2 сумму N-1 бит аргумента. информация например
здесь. Вероятно, есть и лучшая ссылка, но на ум она не приходит в 3 часа ночи :-). Ключевые слова: walch sequence generation with counter
Вот мой код на с++, может станет понятнее:
//generates single i-th bit of walch-hadamard sequence of length N
template<int N>
class WalchSequence
{
//log2 of sequence length
static_assert(N > 0, "WalchSequence: N shall not be negative.");
static_assert((1<<(misc::SignificantBits<N-1>::n)) == N, "WalchSequence: N shall be power of 2.");
template<int L>
friend typename std::enable_if<L!=1, bool>::type get_walch_element(unsigned int ix, unsigned int i)
{
const int l2 = misc::SignificantBits<L-1>::n;
return (compute_parity<l2>(ix & i) != 0);
}
template<int L>
friend typename std::enable_if<L==1, bool>::type get_walch_element(unsigned int ix, unsigned int i)
{
return false;
}
public:
bool operator()(int seq_ix, int ix) const {return get_walch_element<N>(seq_ix,ix);}
};