I am having trouble understanding something about the function:
![Image](https://s9.postimg.cc/chv6bhhff/IE_7_R6_CE_59_Z_7_I_1_A_R.png)
I do understand what it is doing, while I don't know why it is called like this in the dsp_adaptive_lms function in the app_adaptive which is part of the AN00209 example:
Code: Select all
int32_t dsp_adaptive_lms
(
int32_t source_sample,
int32_t reference_sample,
int32_t* error_sample,
const int32_t* filter_coeffs,
int32_t* state_data,
const int32_t num_taps,
const int32_t mu,
const int32_t q_format
) {
int32_t output_sample, mu_err;
// Output signal y[n] is computed via standard FIR filter:
// y[n] = b[0] * x[n] + b[1] * x[n-1] + b[2] * x[n-2] + ...+ b[N-1] * x[n-N+1]
output_sample = dsp_filters_fir( source_sample, filter_coeffs, state_data, num_taps, q_format );
// Error equals difference between reference and filter output:
// e[n] = d[n] - y[n]
*error_sample = reference_sample - output_sample;
// FIR filter coefficients b[k] are updated on a sample-by-sample basis:
// b[k] = b[k] + mu_err * x[n-k] --- where mu_err = e[n] * mu
mu_err = dsp_math_multiply( *error_sample, mu, q_format );
[b]dsp_vector_muls_addv( state_data, mu_err, (int32_t*) filter_coeffs, (int32_t*) filter_coeffs, num_taps, q_format );[/b]
return output_sample;
}
When I try to write a simple demo like this :
Code: Select all
int32_t input[] = {1,2,3,4,5,6};
int32_t fir_coeff[6] = {1,0,2,3,1,2};
dsp_vector_muls_addv( input, 2, (int32_t*)fir_coeff, (int32_t*)fir_coeff, 6, 0 );
Thank you!../src/app_adaptive.xc:534:62: error: call makes alias in function `dsp_vector_muls_addv'
dsp_vector_muls_addv( state_data, 2, (int32_t*)fir_coeff, (int32_t*)fir_coeff, 6, 0 );
^~~~~~~~~~~~~~~~~~~
../src/app_adaptive.xc:534:41: note: aliased item is here