-
Notifications
You must be signed in to change notification settings - Fork 136
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
Doubt regarding esp32s3-eye mic input (AIS-1531) #130
Comments
Because the data type is int32_t, in the C language, it will be an arithmetic right shift, so the sign bit will not be lost. |
Yes, but after the right shift is complete, the MSB of the resulting value still ends up being discarded right? |
After the right shift, the MSB is not discarded. After the right shift, the result is still assigned to the current variable, which is of type int32_t. You may need to learn more about pointers and right shift operations in C language. |
Yeah, the result is still stored in the int32_t variable. But the first 2 bits are discarded when it's passed to AFE. For esp-eye, the AFE examples initialize with one mic and one reference channel, which means that only the first 16 bits is used as data for AFE applications and the second half is discarded (or used for aec). |
Wouldn't this make more sense instead:
|
Hi! I just had a query regarding the bsp_get_feed_data function for esp32s3-eye board in the hardware driver.
From this line:
tmp_buff[i] = tmp_buff[i] >> 14; // 32:8为有效位, 8:0为低8位, 全为0, AFE的输入为16位语音数据,拿29:13位是为了对语音信号放大。
I can assume that:
So my query is, assuming that the I2S input is two's complement 24-bit left justified, wouldn't the bit 31 contain the MSB of the audio sample? If we just discard it, wouldn't it affect the sign of the audio sample?
Sorry if I misunderstood something, thanks!
The text was updated successfully, but these errors were encountered: