Wed 24 Jul 2013 06:13:48 PM UTC, original submission:
The title says everything - Octave produces a result that does not match Matlab or literature values.
Package: signal
Function: fwht, third parameter = "dyadic"
Here is a basic functioning code that exemplifies the problem:
N=1024; t = linspace(-5,5, N);
f=t.**100;
pkg load signal
F = fwht(f,N,"dyadic"); #<--- "sequency" or "hadamard"
# produces correct results
Finv = ifwht(F,N,"dyadic");
#Normalization for visualization:
out1=t;
out2=abs(F)/norm(F);
out3=abs(Finv)/norm(Finv);
out4=f/norm(f);
plot(t,out4) #original function
hold on;
plot(t,out3) #plot reconstruction: notice that right hand sideof
#original function is reconstructed completely wrong
hold off;
The same code in Matlab produces a correct result (correct reconstruction, matches literature).
|