Filter löschen
Filter löschen

Generation of n_th anonymouse Walsh function

1 Ansicht (letzte 30 Tage)
Andrei
Andrei am 27 Okt. 2023
I need Walsh functions for fourier approximation of some test function (let it be sinx on interval from -pi to pi). So I need to find n_th Walsh function as a function of x to use in integral for coefficients. Here is my try (I tried to use haddamar matrices)
function y = wal(x,n)
N = 2^n;
H = hadamard(N);
id = fix(x*N -1e-9) + 1;
y = H(N,id);
end
But here is my problem, first of all these functions are not correct. Secondly, they are defined only on (0,1) interval, and I don't know how to generalise in on [-pi,pi]. Thirdly input x is an array, and I need to make anonymous func @(x), but then my id is undefined and function is not working at all

Antworten (0)

Kategorien

Mehr zu Mathematics and Optimization finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by