ESP32 INMP441 I2S sound recorder spectrogram shows strange artefacts

butty_bach

New Member
I've built a sound recorder based on ESP32 with an I2S INMP441 microphone. The code needed a lot of massaging to get it to work using lots of hints and tips from samples etc on the web. It appears to work OK, and I created a spectrogram using Audacity to get an idea of frequency response etc. But the spectrogram has strange features in it that I don't understand, and I could do with some idea of what could be causing them.

The sound recorded is a generated linear tone from 100Hz to 20kHz over 30 secs. The most obvious weird thing is the "anti" signal descending from on high and crossing the "real" signal at about the point where the microphone is beginning to hit its frequency limit. There is also a dark band, faint in this sample but more pronounced at lower sampling rates, where the two obvious signals cross. I feel this must be related. There's also faint arcing signals, perhaps harmonics?

The other obvious thing is the banding that appears when there's (relative) silence.

I've played with the I2S config and buffering parameters without fundamentally changing anything. Changing the sampling rate does move things around a bit but all the artefacts remain.

I'm hoping someone knowledgeable in audio may have some idea what this is showing!
 
This is my I2S config:

const i2s_driver_config_t i2s_config = {
.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX),
.sample_rate = SAMPLE_RATE,
.bits_per_sample = (i2s_bits_per_sample_t)BITS_PER_SAMPLE,
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, // ALL_LEFT or RIGHT_LEFT gives loud mush
.communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
.dma_buf_count = 4,
.dma_buf_len = 1024
};

BITS_PER_SAMPLE is 16
I've tried many sample rates, which give basically the same result, although the dark band where the two arcs cross becomes more pronounced at lower rates.

I've spent a fair amount of time looking at examples on the web and this is the result. There are more parameters available that I have no idea what they do
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…