Spresense acoustic classification issues

I have two questions about real-time acoustic classification on sony spresense.
I was able to set-up my board, connect to EI, collect data, and do all the pipeline till deployment.

Though, I have two issues to clarify:

  1. I am using an analog microphone, and the recorded sounds are of very low amplitude. How can I increase the amplification rate?

  2. When running in the device, it cannot allocate the second audio buffer, so I get the error showed below:

[SER] Started inferencing, press CTRL+C to stop...
LSE
Inferencing settings:
	Interval: 0.062500ms.	Frame size: 48144
	Sample length: 3009.000000 ms.	No. of classes: 4
Starting inferencing, press 'b' to break
Starting inferencing in 2 seconds...
Can't allocate second audio buffer
ERR: Could not allocate audio buffer (size 48144), this could be due to the window length of your model
Recording

I think I need to increase the allocated audio buffer in the firmware settings.

I am capable of downloading and modifying the ei firmware and modify the parameter values, though I am not sure which ones to edit! Any advice would be appreciated.

Project ID:

Hi @deligkarisk

  1. It should be a problem but I’ve played some of your recordings and what i can say is that there’s noise (the bzzzt), you can probably try to remove the dc offset. You an also try to apply a software amplification. But remember that the samples then are passed to an fft so you should check how the spectrogram looks. For sure you need to collect more data, 3 min for 4 classes it’s not enough.
  2. You need to increase the heap available to the system, cause it can’t allocate the audio buffer. Or, to make it simpler, you can allocate the inference bufferer statically as you already knows the size which is n_samples * sizeof(int16_t) * n_audio_channels = 16000.

regards,
fv

1 Like