![NXP Semiconductors SLN-LOCAL2-IOT User Manual Download Page 52](http://html.mh-extra.com/html/nxp-semiconductors/sln-local2-iot/sln-local2-iot_user-manual_1721901052.webp)
• “#define USE_SAI2_MIC (1)” – three microphones used.
• “#define USE_SAI2_MIC (0)” – two microphones used.
7.2.2 Changing the post gain
The post gain can affect how the board performs in low noise using a low-volume voice (far-field). In the default configuration, this
setting is set to the maximum value. In real life, this can cause the device to wake up more often than other devices, which can
generate problems if the devices in the consumer's home are less capable.
Table 11. u16PostProcessedGain description
Parameter
postProcessedGain
Description
Acoustic signal digital gain in a linear scale up to x64. The signal level after applying this gain is
still under the Dynamic Range Control (DRC) constraint, so it is not used as a traditional DRC
make-up gain.
Data type
Data range
Unit
Default
uint16_t
[0x0000,0x4000]
N/A
0x0600
Inside the local_demo or usb_aec_alignment_tool project, navigate to audio_processing_task.c, as shown in
.
Figure 66. Gain variable in audio_process_task.c
Inside the audio_processing_task.c file, locate the code snippet from
and adjust the post processing dynamic gain
variable “afeConfig.postProcessedGain” corresponding to the signal level needed.
7.2.3 Changing the pre-processed microphone gain
The i.MX RT106S MCU does not have a PDM hardware block, which means that it is required to convert the PDM data to PCM
within software. This allows the gain to be adjusted to fit the needs of the developer. The gain may be required to change because
some product designs may have a higher/lower Echo Return Loss (ERL) which can affect the barge-in performance. See
Performance Requirements for Audio Front End of i.MX RT106A/L
for more information. The microphone gain is also modified
before the DC offset is applied, allowing for higher shift precision. To change the gain, open the file located in the local_demo or
usb_aec_alignment_tool folders in the audio subfolder called pdm_to_pcm_task.c.
Table 12. SLN_DSP_SetGainFactor function description
Function
SLN_DSP_SetGainFactor
Description
Modifies the PCM gain before the DC Offset is applied. This increases the gain factor but it can
also cause clipping.
Table continues on the next page...
NXP Semiconductors
Far-field local voice control framework
SLN-LOCAL2-IOT Developer’s Guide, Rev. 0, 19 April 2021
User's Guide
52 / 87