Page 1 of 1

Dsp lib: function dsp_adaptive_lms() have undesired outpu

Posted: Wed Jul 03, 2019 4:02 am
by link0513
I try to use adaptive filter to do some signal procession. When I input a 1K Hz sine data as input sample and reference sample for the dsp_adaptive_nlms(), return output is strange. I use printf to get the output data is all show 7FFFFFFF and 80000000. Whether do I misunderstand the function usage ? Please help.

adapt_array[128]= 7FFFFFFF 7FFFFFFF 80000000 7FFFFFFF 80000000 7FFFFFFF 80000000 8000000
0 80000000 7FFFFFFF 80000000 7FFFFFFF 7FFFFFFF 7FFFFFFF 80000000 80000000 7FFFFFFF 80000000 7FF
FFFFF 7FFFFFFF 7FFFFFFF 7FFFFFFF 80000000 80000000 7FFFFFFF 7FFFFFFF 80000000 7FFFFFFF 7FFFFFFF
7FFFFFFF 7FFFFFFF 7FFFFFFF 80000000 7FFFFFFF 80000000 80000000 7FFFFFFF 80000000 7FFFFFFF 7FFFF
FFF 7FFFFFFF 7FFFFFFF 80000000 80000000 7FFFFFFF 7FFFFFFF 80000000 80000000 7FFFFFFF 7FFFFFFF 7
FFFFFFF 7FFFFFFF 80000000 7FFFFFFF 7FFFFFFF 7FFFFFFF 80000000 80000000 80000000 80000000 7FFFFFF
F 7FFFFFFF 7FFFFFFF 7FFFFFFF

Re: Dsp lib: function dsp_adaptive_nlms() have undesired output

Posted: Wed Jul 03, 2019 12:44 pm
by mon2
Use of printf is blocking on the XMOS CPU. Please review the use of printf in real time application as documented here:

https://www.xmos.com/developer/debug-pr ... ion=X1093A

If this is not the issue, please post your code (and use the above code-format tags) for others to review and supply more ideas.

Re: Dsp lib: function dsp_adaptive_nlms() have undesired output

Posted: Wed Jul 03, 2019 12:56 pm
by link0513
Thanks. The problem is solved. The root of case is that I use Q28 format and cause the data overflow. I use Q31 is ok.

Re: Dsp lib: function dsp_adaptive_lms() have undesired outpu

Posted: Tue Jul 09, 2019 12:56 pm
by link0513
Hi,when I input a voice data to the dsp_adaptive_lms for a time, the problem is reproduced and it keep output the noise even if stop the input.


below is part of code:

sample = old_sample;
sample1 = sample - preSample;
preSample = dsp_adaptive_lms(sample, sample1, &error_sample, coeffs, state, 100, Q31(0.01), 31);
old_sample = sample1;

return sample;