STM32U5xx: ADF as PDM MIC input - mono and DC offset?
Using STM32U5A5 MCU and adding the ADF example (taken from en.stm32cubeu5-v1-4-0\STM32Cube_FW_U5_V1.4.0\Projects\STM32U575I-EV\Examples\MDF\ADF_AudioRecorder) seems to work.
I have changed to use the PLL3 and setup 3,072MHz as PDM MIC CLK (for 48KHz sample rate, with decimation 64). Also this works (I see the correct PDM CLK on pin and also the data in buffer ADF filtering done looks reasonable).
I have two major questions:
- Is my understanding right, as:
There is just one ADF (not two). And using it for PDM MICs via MDF_SITF_NORMAL_SPI_MODE allows me just to connect/use one MIC?
It means: I can select the clock edge, e.g. via MDF_BITSTREAM0_RISING (for left or right PDM MIC), but
due to the fact that just ONE ADF is available - PDM MIC can work only in Mono mode (what I see in buffer as filter results, a MONO signal stream of PCM values)
So, is ADF for PDM MIC always and just MONO? (just one ADF available)
(just possible to select if the Left or the Right one should be processed) - I have debugged the code and I have dropped the buffer content displayed in debugger into Excel/LibreOffice (to get a graph):
I was playing a 1KHz sine wave from smartphone speaker and I can see it - cool, the PDM MIC works and gets the audio signal.
But:
a) There is a DC offset (around value 1600). I see this DC offset also with a quiet signal (just ambient noise):
all values are around 1600 (plus/minus noise).
b) Where is this DC offset coming from?
c) How to set the output data size, e.g. 16bit signed PCM?
The buffer is defined as: int16_t RecBuff[REC_BUFF_SIZE * 2U];
Is there a config to force 16bit signed? (and why I never get the full swing?, or this DC offset?
My gain setting is 0.)
d) Let's assume I want to merge the result later as stereo, e.g. streaming via USB or SPDIF:
Is there a way to "tell" the filter to place the results for a MONO channel on every second word in buffer?
(so that I could copy over the entire buffer to the final stereo output, instead to add a "vector DMA"
to do so)
Is using ADF for PDM MICs always Mono? (stereo MIC not possible)
Is there a DC Offset expected?


