BES2300x notes (3) - ANC debugging notes finishing 1

Hello everyone, this is the third article in this series~ article~ Reprint the article, please indicate the source

<<[Series Blog Index] Fast Track>>

I. Introduction

Recently, I have been in the state of 996. I feel that there is not enough time. I don’t even have time to be lazy~~1024 is still working overtime. Let’s arrange ANC today. Let’s talk about ANC debugging in this third article. Process and related documents.

Two, debugging notes

1. Software part

1) According to the hardware schematic diagram, configure the channel of the mic and the bias voltage VMIC (multiple voltages can be ORed);
Insert picture description here

2) The default spk of the BES project uses L. The method to change to R is:
a. Keep the channel configuration as L unchanged;
b. Add the macro CODEC_OUTPUT_DEV, the chip will eventually push the signal to the right R of spk, and the signal will be pushed when the macro is not added. To spk left L.

Insert picture description here
aisle:

tgt_hardware.h
#define ANC_FF_MIC_CH_L    		AUD_CHANNEL_MAP_CH4
#define ANC_FF_MIC_CH_R         0
#define ANC_FB_MIC_CH_L         AUD_CHANNEL_MAP_CH1
#define ANC_FB_MIC_CH_R         0

Bias voltage:

#define ANC_VMIC_CFG        	(AUD_VMIC_MAP_VMIC1 | AUD_VMIC_MAP_VMIC2)

SPK:

#define CFG_HW_AUD_OUTPUT_PATH_SPEAKER_DEV (AUD_CHANNEL_MAP_CH1)
#define CODEC_OUTPUT_DEV                   (AUD_CHANNEL_MAP_CH0)

Call MIC:

tgt_hardware.c
#define CFG_HW_AUD_INPUT_PATH_MAINMIC_DEV (AUD_CHANNEL_MAP_CH4 | AUD_VMIC_MAP_VMIC1) 

JSON file:

productline_cfg.json
"aud_channel_cfg": {
    "anc_ff_mic_ch_l": "AUD_CHANNEL_MAP_CH4",
    "anc_ff_mic_ch_r": "AUD_CHANNEL_MAP_CH2",
    "anc_fb_mic_ch_l": "AUD_CHANNEL_MAP_CH1",
    "anc_fb_mic_ch_r": "AUD_CHANNEL_MAP_CH3"
},
2. Tools

1) The json file in the tool must be consistent with the software, and the unused channel can be unchanged
. Changing to a blank character will cause the tool to fail to open the port; 2) During online debugging, use preview and click "Anc switch off". Noise reduction effect;
3) There is a small bug in the tool, you need to modify the parameters to display the ANC noise reduction curve;
Using the tool for online debugging, the actual running is the bin file inside the tool, which is completely independent from the bin of the program. With the json file, you can run and debug normally. This process is only to get a set of filter parameters and write them into the chip later. , So the json file should be consistent with the content of the software configuration;

3. Microphone section

1) The microphone has three wires: signal, power and ground;
2) The principle of radio: inside is a diaphragm, which will vibrate when receiving sound waves, which will cause the capacitance to change and then detect the sound;
3) The principle of noise reduction: mic collection —>ANC chip —>SPK output reverse waveform, you can use an oscilloscope to measure the signal pins of mic and spk to verify the hardware path;

4. Mode related

1) ANC mode and transparent mode (the sound is compensated when transparent, mainly to compensate for passive noise reduction PEQ) parameters can be combined into a cfg file, use the tool to load once, load to mode1 and mode2 respectively, modify ANC_COEF_NUM Is 2, and then the software can switch cyclically.
Insert picture description here
2) ANC_COEF_NUM is 1 which means mode1; 2 means that it supports mode1 and mode2 dual modes; the logic of calling is: press a noise reduction button, call it cyclically, noise reduction—>transparency—>off—>noise reduction.

Three, ANC parameters

Acoustics colleagues will provide noise reduction parameter files with the suffix .cfgv2 or .cfgv3. The parameters can be imported into the chip through the ANC Designer tool, or directly integrated into the code. Click here to download the ANC parameter integration instructions and myself A small tool written to incorporate parameters;

Four, EQ debugging

When ANC noise reduction is turned on, it will affect the sound quality of the music. You need to add EQ for sound compensation. The default code only has the EQ parameters of normal mode, and the gain is all 0. How to add the EQ parameters that ANC turns on?
1) Add the EQ array of ANC mode:
Insert picture description here
2) The place where EQ parameters are called:
Insert picture description here

Five, related interfaces

1. Transparent mode

app_anc_get_coef(); //(0:close, 1:open)

2. Noise reduction mode

app_anc_work_status(); //(0:close, 1:open)

Six, supplement

When the volume is at the maximum, the music is louder, and the dB value can be adjusted:
Insert picture description here

Seven, notice

Subsequent chapters will update the content related to OTA upgrade and master-slave switching;

Guess you like

Origin blog.csdn.net/zhanghuaishu0/article/details/109265280