Microphone array with 16 microphones Topic is solved

New to XMOS and XCore? Get started here.
Post Reply
inowatom
Member
Posts: 11
Joined: Fri Feb 10, 2017 11:33 am

Microphone array with 16 microphones

Post by inowatom »

Hi all,
i have a problem with developing 16 microphone array.

I have built my own version of xCORE Microphone Array, 8 mics are connected to 8C port and 8 mics are connected to 8D
I use XEF216-512-TQ128-C20, i have changed makefile to it

I use AN00218_app_hiress_DAS_fixed (1.0.3) as a start and it works well with 8C mics or 8D mics. But when i try to run it with 16 mics i do not hear any sound.

I add mic_array_pdm_rx(p_pdm_mics2, c_pdm_to_hires[2], c_pdm_to_hires[3]); for additional 8 mics,

change #define MIC_ARRAY_NUM_MICS 16

change mic_array_hires_delay(c_pdm_to_hires, c_hires_to_dec, 4, c_cmd);

and add to additional decimators:
mic_array_decimate_to_pcm_4ch(c_hires_to_dec[2], c_ds_output[2], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_hires_to_dec[3], c_ds_output[3], MIC_ARRAY_NO_INTERNAL_CHANS);

so in main function i have:

par {
//; mabs_button_and_led_server(lb, 1, leds, p_buttons);
mic_array_pdm_rx(p_pdm_mics, c_pdm_to_hires[0], c_pdm_to_hires[1]);
mic_array_pdm_rx(p_pdm_mics2, c_pdm_to_hires[2], c_pdm_to_hires[3]);

mic_array_hires_delay(c_pdm_to_hires, c_hires_to_dec, 4, c_cmd);

mic_array_decimate_to_pcm_4ch(c_hires_to_dec[0], c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_hires_to_dec[1], c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_hires_to_dec[2], c_ds_output[2], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_hires_to_dec[3], c_ds_output[3], MIC_ARRAY_NO_INTERNAL_CHANS);

hires_DAS_fixed(c_ds_output, c_cmd, c_audio);
}

So what could be wrong? What should i modify next? Of course i modified hires_DAS_fixed but i am not sure if it is OK.
Anybody has done it already? I mean connecting 16 mics to mic_aray app?

BR
Tom


View Solution
User avatar
andrew
Experienced Member
Posts: 114
Joined: Fri Dec 11, 2009 10:22 am

Post by andrew »

You will need two of mic_array_hires_delay(); giving you something like:

Code: Select all

streaming chan c_pdm_to_hires_0_7[2], c_pdm_to_hires_8_15[2];
streaming chan c_hires_to_dec_0_7[2], c_hires_to_dec_8_15[2];

mic_array_pdm_rx(p_pdm_mics, c_pdm_to_hires_0_7[0], c_pdm_to_hires_0_7[1]);
mic_array_pdm_rx(p_pdm_mics2, c_pdm_to_hires_8_15[0], c_pdm_to_hires_8_15[1]);

mic_array_hires_delay(c_pdm_to_hires_0_7, c_hires_to_dec_0_7, 8, c_cmd);
mic_array_hires_delay(c_pdm_to_hires_8_15, c_hires_to_dec_8_15, 8, c_cmd);

mic_array_decimate_to_pcm_4ch(c_hires_to_dec_0_7[0], c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_hires_to_dec_0_7[1], c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_pdm_to_hires_8_15[2], c_ds_output[2], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_pdm_to_hires_8_15[3], c_ds_output[3], MIC_ARRAY_NO_INTERNAL_CHANS);
There are more elegant ways of allocating the chanends but this will work
inowatom
Member
Posts: 11
Joined: Fri Feb 10, 2017 11:33 am

Post by inowatom »

andrew wrote:You will need two of mic_array_hires_delay(); giving you something like:

Code: Select all

streaming chan c_pdm_to_hires_0_7[2], c_pdm_to_hires_8_15[2];
streaming chan c_hires_to_dec_0_7[2], c_hires_to_dec_8_15[2];

mic_array_pdm_rx(p_pdm_mics, c_pdm_to_hires_0_7[0], c_pdm_to_hires_0_7[1]);
mic_array_pdm_rx(p_pdm_mics2, c_pdm_to_hires_8_15[0], c_pdm_to_hires_8_15[1]);

mic_array_hires_delay(c_pdm_to_hires_0_7, c_hires_to_dec_0_7, 8, c_cmd);
mic_array_hires_delay(c_pdm_to_hires_8_15, c_hires_to_dec_8_15, 8, c_cmd);

mic_array_decimate_to_pcm_4ch(c_hires_to_dec_0_7[0], c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_hires_to_dec_0_7[1], c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_pdm_to_hires_8_15[2], c_ds_output[2], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_pdm_to_hires_8_15[3], c_ds_output[3], MIC_ARRAY_NO_INTERNAL_CHANS);
There are more elegant ways of allocating the chanends but this will work
Thank You Andrew for your help. Finally it works. I can record voice from 16 microphones on tile 0. I have to calcultae delays for each microphone because i have a different pcb than evaluation board.

In the mic_array_conf.h i had to change:
#define MIC_ARRAY_NUM_MICS 16

and in the main file (shown only changes):
#define DECIMATOR_COUNT 4 //8 channels requires 2 decimators

on tile[0]: in buffered port:32 p_pdm_mics = XS1_PORT_8C;
on tile[0]: in buffered port:32 p_pdm_mics2 = XS1_PORT_8D;

in hires_DAS_fixed:
unsigned delay[16];

mic_array_decimator_conf_common_t dcc = {0, 1, 0, 0, DECIMATION_FACTOR,
g_third_stage_div_2_fir, 0, FIR_COMPENSATOR_DIV_2,
DECIMATOR_NO_FRAME_OVERLAP, FRAME_BUFFER_COUNT};
mic_array_decimator_config_t dc[4] = {
{&dcc, data[0], {INT_MAX, INT_MAX, INT_MAX, INT_MAX}, 4},
{&dcc, data[4], {INT_MAX, INT_MAX, INT_MAX, INT_MAX}, 4},
{&dcc, data[8], {INT_MAX, INT_MAX, INT_MAX, INT_MAX}, 4},
{&dcc, data[12], {INT_MAX, INT_MAX, INT_MAX, INT_MAX}, 4}
};

for(unsigned i=0;i<MIC_ARRAY_NUM_MICS;i++)
output += (current->data[0]>>3);
output = ((int64_t)output * (int64_t)gain)>>16;

in main function:

par {

mic_array_pdm_rx(p_pdm_mics, c_pdm_to_hires[0], c_pdm_to_hires[1]);
mic_array_pdm_rx(p_pdm_mics2, c_pdm_to_hires[2], c_pdm_to_hires[3]);

mic_array_hires_delay(c_pdm_to_hires, c_hires_to_dec, 4, c_cmd);

mic_array_decimate_to_pcm_4ch(c_hires_to_dec[0], c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_hires_to_dec[1], c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);

mic_array_decimate_to_pcm_4ch(c_hires_to_dec[2], c_ds_output[2], MIC_ARRAY_NO_INTERNAL_CHANS);
mic_array_decimate_to_pcm_4ch(c_hires_to_dec[3], c_ds_output[3], MIC_ARRAY_NO_INTERNAL_CHANS);

hires_DAS_fixed(c_ds_output, c_cmd, c_audio);
}

Ok, i have now a new problem: how to set up additional 8 or 16 mics on next tile : tile 1, so finally i want to have 24 or 32 mics. :)
Post Reply