NatureDSP bkfir32x32_process not producing meaningful outputs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NatureDSP bkfir32x32_process not producing meaningful outputs

724 Views
abdob
Contributor III

Hi,

I have checked closely with the NatureDSP Signal Library reference. I have been able to use some of the functions in the NatureDSP library, like the FFTs so the libnaturedsp.a seems to work.

I am having an issue with bkfir32x32_process, I cannot get it to work and produce meaningful output.

Here is the relevant code:

#define M 256 // filter length
#define N 80 // Block size
void TEST_BKFIR_SCENARIO1()
{

int extIR = 0;
int alloc_bytes = bkfir32x32_alloc(M,extIR);
void *objmem = malloc(alloc_bytes);

// N samples per block
int32_t bkfir_in[N];
int32_t bkfir_out[N];

//
for (int i = 0; i < N; i++)
bkfir_in[i] = (int) bkfir_in_ref[i];

bkfir32x32_handle_t bkfir_handle = bkfir32x32_init(objmem, M, extIR, h_ref);

bkfir32x32_process( bkfir_handle, bkfir_out, bkfir_in, N);

for (int i = 0; i < N; i++)
printf("%d ", bkfir_in[i]);
printf("\n\n");
for (int i = 0; i < N; i++)
printf("%d ", bkfir_out[i]);
printf("\n\n");
for (int i = 0; i < M; i++)
printf("%d ", h_ref[i]);
}

The first printed function prints the bkfir inputs:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

The second prints the bkfir outputs:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

The third prints the bkfir filter coefficients:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Am I missing something or am I doing anything wrong?

The NatureDSP Signal Library reference mentions the use of:
bkfir32x32_alloc, bkfir32x32_init and bkfir32x32_process, I am attempting to make correct use of these functions but the output doesn't make sense.

Any help is appreciated, thank you.

0 Kudos
2 Replies

709 Views
abdob
Contributor III

I realized that the inputs and filter coefficients needed scaling, the inputs seem to be scaled by 2^16 whereas the coefficients need to be scaled by 2^15, is this correct?

0 Kudos

701 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @abdob ,

but this is a 32x32 FIR.... 

This is the NtureDSP reference manual. Please take a look.

Last page has customer support email address. You can rise a question to them.

 

Regards,

Jing

0 Kudos