FIR filtering on ESP32 #394
-
Hey I was working on INMP441 with esp32 and want to get frequency range from 20 to 200 hz only. I used streams i2s-filter-i2s example code but haven't got the filtered output. As the sampling rate is varied inmp441 has inbuilt band pass filter that filters some of the frequency. Can some one help me figure it out? And also how to select sampling frequency to get the filter coefficients in matlab or tfilter. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 6 replies
-
The documentation in the Wiki contains a link to a filter design tool. |
Beta Was this translation helpful? Give feedback.
-
Did you measure the effective sample rate: I would be surprised if anything below 8000 would work correctly |
Beta Was this translation helpful? Give feedback.
-
What is this effective sampling rate? I have no idea about it. |
Beta Was this translation helpful? Give feedback.
-
Just add a counter to the loop that is resetting every second and count the number of frames that you process (I2S_READ_LEN/(sizeof(int16_t)*2)) |
Beta Was this translation helpful? Give feedback.
-
The sample rate is the number of samples per second: So you can measure this in you loop. |
Beta Was this translation helpful? Give feedback.
-
I don't think anything is dynamically changing: You just empty the buffer at full speed and this is limited by the speed the buffer is filled: This should be pretty consistent... |
Beta Was this translation helpful? Give feedback.
-
That was my point: you can't go that low! |
Beta Was this translation helpful? Give feedback.
-
I guess it is just the other way round: it was clear because the effective sampling rate was much higher then you thought it is... |
Beta Was this translation helpful? Give feedback.
The documentation in the Wiki contains a link to a filter design tool.
I don't think that you can use the built in low pass filter of the INMP441: You would need to select a sampling rate of 300-400 hz, but this will not give any good audio!