Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2S_BITS_PER_SAMPLE_16BIT creates folding around Fs/2 with ICS-43434 #2

Closed
jetpax opened this issue Apr 10, 2021 · 1 comment
Closed

Comments

@jetpax
Copy link

jetpax commented Apr 10, 2021

Hi Chris,

Great project !

I noticed that you have folding of the input frequencies around Fs/2.

So for example, your FFT display goes up to 4kHz, but an input signal of 4.1kHz is displayed as 3.9kHz (ie Fs/2-4.1kHz, this alias frequency is apparent even on the time domain plot)

I had similar problems with very different code (MicroPython, though of course still using espidf like Arduino under the hood), with a 1kHz input being aliased to 7kHz (Fs=16000, I2S_BITS_PER_SAMPLE_16BIT )

image

At first I thought it was ESP-IDF, but it seems it may be related to how the ICS-43434 decimation filter works; the datasheet shows 32 bitclocks per sample, not 16 (w. 24 bits of data).
In any case, I found that using I2S_BITS_PER_SAMPLE_32BIT and dumping the bottom 8 bits fixed the issue for me.

image

cgreening added a commit that referenced this issue Apr 11, 2021
@cgreening
Copy link
Contributor

That is some brilliant detective work! I've pushed up a commit to switch to I2S_BITS_PER_SAMPLE_32BIT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants