Instructions for using DOA¶
The direction of arrival (Direction of Arrival) estimation algorithm is generally used to estimate the azimuth angle of the sound source to obtain the position of the target sound source. This document mainly introduces the applicable scenarios and how to enable the function.
1. Default configuration of DOA algorithm in SDK and corresponding hardware board¶
The DOA algorithm must be used with a dual-microphone hardware scheme, and the default chip configuration is CI1306.
2. Application scenario¶
The schematic diagram of DOA angle setting and microphone array placement is shown in the figure below. The microphone array in Figure a and B is a linear double-microphone array, and the recommended microphone spacing is 4 cm. Set the angle from the left microphone to the right microphone to change from 0 degrees to 180 degrees, and use the DOA algorithm to obtain the azimuth angle of the target voice.
Fig. (a) Schematic diagram of microphone array horizontal structure and angle setting
Fig. (B) Schematic Diagram of Vertical Structure and Angle Setting of Microphone Array
3. Instructions for use of offline _ ASR _ sample engineering¶
3.1 Instructions for using the DOA algorithm¶
Step 1: Enable the DOA algorithm
Open the relevant macro in the project offline _ ASR _ sample SRC user _ config. H.
//Turn on dual microphone DOA function
#define USE_DOA_MODULE 1
//Turn off dual microphone DOA function
#define USE_DOA_MODULE 0
Step 2: Parameter configuration
Configure the DOA algorithm parameters in the projects\offline_asr_sample\src\ci_ssp_config.c file:
//DOA module configuration
const doa_config_t doa_config =
{
.distance = 40 ,
.min_frebin = 40,
.max_frebin = 130,
.samplerate = 16000,
.doa_resolut = 5 // doa_resolut = 3、5、10
};
Parameter description:
Distance: microphone array distance, int type, default 40mm
Min _ frebin: the lowest frequency point for DOA calculation, the range is [0 255], and the default value is 40
Max _ frebin: the highest frequency point for DOA calculation, the range is [0 255], and the default is 130
Samplerate: Enter the audio sample rate, the default 16000.
DOA _ resolut: DOa output resolution, only 3, 5, 10 can be selected. Indicating that the output is 3, 5, and 10 angles, respectively.
The outputs of the three angles are 45 °, 90 ° and 135 °;
The outputs of the five angles are 0 °, 45 °, 90 °, 135 ° and 180 °;
The output for 10 angles is 0 to 180 °, with one angle output every 20 °.
Note: DOA uses the wake-up word mode by default, that is, the corresponding angle information will be output after the wake-up word is recognized.
4. Effect confirmation¶
4.1 View log¶
Through serial port printing, when the wake-up word is recognized, the printed angle information can be seen, for example, the print display angle = 90 indicates that the sound source is about 90 °.
When the wake-up words are spoken in different directions, different angle information is printed, and the angle information is consistent with the direction of the actual target voice (for example, stand at a position 1m away from the array, speak the wake-up words on both sides of the mic, the angle displayed on one side is about 45 degrees, the angle displayed on the other side is about 135 degrees, and the wake-up word spoken in front of the array is about 90 degrees). It indicates that the DOA estimation algorithm module works normally.