# How to evaluate fixed-point implementation of LMS filter is correct?

I am having an LMS block with 6 filter coefficients. The value of filter coefficients are

0.0001
0.00045
0.2535
0.546536
0.0000243
0.3423


I have tried to implement the LMS algorithm in floating-point with $$\mu=0.01$$. LMS algorithm implemented in floating point is based on the below equations:(from figure) : v(n)=wT(n)u(n), e(n)=d(n)-v(n), w(n+1)=w(n)+mu e(n)*u(n) ,which is the weight updation equation. Here d(n) is the desired signal,u(n) is the input to lms block,v(n) is the lms filter output ,w(n) is the adaptive filter weights and e(n) is the error.

I have given a set of desired samples and input samples to the LMS filter and the LMS filter output data samples were analyzed. Now, to implement the same LMS filter in fixed-point representation, I will have to do scaling and rounding. Is scaling of filter coefficients by some factor $$2^{s_1}$$ enough and $$\mu$$ value be represented like $$2^{-6}$$ or should we consider any other factors while doing scaling operations. Finally, how to check the fixed-point implementation of LMS filter worked correctly?

I'm not an expert on the LMS algorithm. Perhaps you should add a link to the algorithm description so we can help you. However, I have adapted a lot of algorithms to fixed-point implementation, so I think I can help you.

I'm gonna give you a few pointers :

1 - If your algorithm is not recursive, quantization errors can affect the accuracy of your results but the fixed-point implementation will always be stable.

2 - If your algorithm is recursive, it is possible that quantization will radically change the behaviour of your algorithm, it could become unstable, you could be stuck with a limit cycle, etc.

3 - Create a "perfect" model. In your case, the floating-point implementation could be your perfect model. Then, convert your model to fixed-point and compare the results of your fixed-point model. You can toy around with the number of bits for your coefficients, rounding versus truncation, etc.

Regarding your algorithm, you have 6 coefficients, 3 of them are significant (coefficients 3, 4 and 6) while 3 of them seem insignificant (1,2,5). Is this ok?

• Instead of using scaling factor, why not use "fractional number of bits" ? It's more in line with fixed-point notation. I recommend you read on fixed-point arithmetic before going forward.
– Ben
Aug 29, 2020 at 15:33
• Have you read on fixed-point arithmetic such as the Q notation? I feel this is not a digital signal processing issue but more of a fixed-point arithmetic issue.
– Ben
Aug 29, 2020 at 17:38
• You can have 20 bits for coefficients fractionnal part and 16 bits for the mu coefficients. No one said you have to have the same number of bits. Use the Q notation!
– Ben
Aug 29, 2020 at 17:42