Hey,
I'm experiencing a similar issue as in this question asked by Binge.
I'm implementing a fir interpolation filter with the number of input sample 1. Similar to Binge, I can't get correct outputs from fir_interp. I was using the default fir_interp from filter.h in CCES 2.10.0. Then I also added fir_interp_vec_21XI.asm to my project and tried the updated version fir_interp. I also tried with CCES 2.11.0. The outputs are the same as before. Some values in the outputs are not correct. I attached my code and the outputs here.
#define N_INTERP 8
#define N_POLYPHASES (N_INTERP)
#define N_SAMPLES_IN 1
#define N_SAMPLES_OUT (N_SAMPLES_IN * N_INTERP)
#define N_COEFFS_PER_POLY 17
#define N_COEFFS (N_COEFFS_PER_POLY * N_POLYPHASES)
float coeffs[N_COEFFS]; //coefficients in normal order
float pm coeffs_imple[N_COEFFS]; //coefficients in implmentation order
float state[N_COEFFS_PER_POLY + 1];
float input[N_SAMPLES_IN];
float output[N_SAMPLES_OUT];
int main(void)
{
// Create filter coeffs
for (i = 0;i < N_COEFFS; i++)
{
coeffs[i] = (float)(i * 0.1f);
}
// Initialize the delay line
for (i = 0; i < (N_COEFFS_PER_POLY + 1); i++)
{
state[i] = 0.0f;
}
// Transform the normal order coeffs to polyphase implementation
i = N_COEFFS;
for (np = 1; np <= N_POLYPHASES; np++)
for (nc = 1; nc <= (N_COEFFS_PER_POLY); nc++)
coeffs_imple[--i] = coeffs[(nc * N_POLYPHASES) - np];
float input = 1.0f;
fir_interp(input, output, coeffs_imple, state, N_SAMPLES_IN, N_COEFFS_PER_POLY, N_INTERP);
int scale = N_INTERP;
for(i = 0; i < N_SAMPLES_OUT; i++)
{
output[i] = output[i] / scale;
}
The output I got is like this. output[3], output[5], output[6] and output[7] are not correct. Could you please help me on this? Can fir_interp (SIMD) work with number of input samples = 1?
Change the link to a former question.
[edited by: feedfeed123 at 4:21 PM (GMT -5) on 20 Feb 2024]