how to DSP-code "signed square root"?
Posted: Wed Mar 18, 2020 1:05 pm
if x positive
then x = sqrt(x)
else x = - (sqrt (-x))
end
I've just completed a 64-tap Widrow-Hoff LMS Machinery. It is written in DSP (not in Green, not in Ruby, not in x86 Assembly). The "textbook" variant is doing fine. I would like to experiment a "signed square root" variant, that's "softening" the error signal using the above mentioned "signed square root" function, and also "softening" the incoming signal, before one is combining them using a multiplication.
Thus, I need to compute :
a00=leak*(a00+SIGNEDSQUAREROOT(mu2err * m00));
a01=leak*(a01+SIGNEDSQUAREROOT(mu2err * m01));
etc.
Any help much appreciated
Have a nice day
then x = sqrt(x)
else x = - (sqrt (-x))
end
I've just completed a 64-tap Widrow-Hoff LMS Machinery. It is written in DSP (not in Green, not in Ruby, not in x86 Assembly). The "textbook" variant is doing fine. I would like to experiment a "signed square root" variant, that's "softening" the error signal using the above mentioned "signed square root" function, and also "softening" the incoming signal, before one is combining them using a multiplication.
- Code: Select all
mu2err = mu * 2.0 * err;
a00=leak*(a00+(mu2err * m00));
a01=leak*(a01+(mu2err * m01));
a02=leak*(a02+(mu2err * m02));
a03=leak*(a03+(mu2err * m03));
a04=leak*(a04+(mu2err * m04));
Thus, I need to compute :
a00=leak*(a00+SIGNEDSQUAREROOT(mu2err * m00));
a01=leak*(a01+SIGNEDSQUAREROOT(mu2err * m01));
etc.
Any help much appreciated
Have a nice day