Sound source positioning method and device based on linear microphone array, equipment and medium

CN122592329APending Publication Date: 2026-08-18MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611082867.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

该类方法在理想消声或弱混响环境中效果较好,但在实际住宅场景中往往面临大混响及家具遮挡等复杂声场条件

Benefits of technology

[0015]综上可知,本申请通过预设线性麦克风阵列播放预设测试信号,以获取所述预设线性麦克风阵列的各通道的初始麦克风信号,对所述初始麦克风信号进行同步与标定处理,以得到对应的处理后麦克风信号;其中,所述预设线性麦克风阵列包括预设数量个阵元,所述阵元配置对应的预设阵元序号,且按照预设阵元间距排列,并以预设采样频率同步采样;利用互相关算法基于所述预设测试信号对各通道的所述处理后麦克风信号分别进行第一次互相关操作,以得到相应的互相关序列,根据所述互相关序列确定所述预设线性麦克风阵列的目标检测阈值;基于所述目标检测阈值检测所述预设线性麦克风阵列各通道的所述互相关序列中的目标首峰,以所述目标首峰为中心对所述互相关序列执行截窗以得到截窗后信号;对各通道的所述截窗后信号之间进行第二次互相关操作,以得到第二次互相关结果,对各所述第二次互相关结果之间进行第三次互相关操作,以得到第三次互相关结果;根据所述预设阵元序号将所述互相关序列、所述第二次互相关结果以及所述第三次互相关结果进行亚采样峰值细化与直线拟合,得到目标斜率,基于所述预设采样频率与所述目标斜率确定目标角度;根据所述预设阵元序号与所述目标斜率对所述截窗后信号进行延迟对齐以及信号增强,以得到增强后信号,通过所述目标检测阈值对所述增强后信号进行预设首峰检测操作,以得到候选峰值位置,基于所述候选峰值位置确定目标距离,根据所述目标角度与所述目标距离确定目标声源定位。由上可知,本申请基于线性麦克风阵列的声源定位方法,通过预设的线性麦克风阵列播放测试信号,采集各通道的初始麦克风信号并进行同步与标定处理,得到处理后信号。利用互相关算法将处理后信号与测试信号进行第一次互相关,获得互相关序列并据此确定检测阈值。基于该阈值在各通道互相关序列中检测目标首峰,并以首峰为中心截窗得到截窗后信号。随后对截窗后信号进行第二次互相关和第三次互相关操作,逐步压制干扰、强化一致性主峰,通过亚采样峰值细化和直线拟合获得目标斜率,结合采样频率解算声源入射角,根据阵元序号和斜率对截窗信号进行延迟对齐与增强,再利用同一检测阈值在增强信号中检测首峰,解算目标距离。最终融合角度与距离信息,实现高鲁棒性的声源三维空间定位。这样一来,根据多通道峰值估计预估距离,计算各通道检测阈值,再取中位数形成检测阈值,在此基础上,通过首峰一致性检验和自适应截窗减少异常峰值与反射干扰,再结合二次互相关与三次互相关级联处理提升时延估计稳定性。距离解算阶段复用该检测阈值,保证定向与测距的检测策略一致。通过多机制协同处理实现大混响及遮挡场景下的鲁棒定位。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122592329A_ABST
    Figure CN122592329A_ABST
Patent Text Reader

Abstract

This application discloses a sound source localization method, apparatus, device, and medium based on a linear microphone array, relating to the computer field. The method includes: playing a preset test signal to obtain an initial microphone signal; processing the initial microphone signal to obtain a processed microphone signal; performing a cross-correlation operation on the processed microphone signal based on the preset test signal to obtain a cross-correlation sequence; determining a target detection threshold based on the cross-correlation sequence; detecting the target's first peak based on the target detection threshold; windowing the cross-correlation sequence with the target's first peak as the center to obtain a windowed signal; performing two cross-correlation operations on the windowed signal to obtain a cross-correlation result, and performing peak refinement and fitting to obtain the target slope to determine the target angle; aligning and enhancing the windowed signal to the enhanced signal; detecting the first peak of the enhanced signal to determine the target distance; and determining the target sound source localization based on the target angle and target distance. This method can perform speaker localization in scenarios with high reverberation and obstruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computers, and in particular to a method, apparatus, device, and medium for sound source localization based on a linear microphone array. Background Technology

[0002] In applications such as home theaters, smart homes, conference sound reinforcement, and robotic hearing, automatic speaker positioning typically relies on microphone array sound source localization technology. Most existing solutions estimate the time difference of arrival using generalized cross-correlation, then combine this with array geometry to calculate the sound source's location and distance. This type of method works well in ideal anechoic or low-reverberation environments, but in real-world residential settings, it often faces complex sound field conditions such as high reverberation and furniture obstruction.

[0003] Complex sound fields can lead to multiple competing peaks in the cross-correlation sequence caused by reflection paths, making the peak corresponding to the true direct sound susceptible to interference from spurious peaks. Furthermore, many existing schemes use fixed thresholds in the first peak detection stage, which cannot adaptively adjust with changes in signal-to-noise ratio, echo intensity, and propagation distance, resulting in near-field false triggering and far-field missed detection. For angle estimation, traditional single or double cross-correlation can still cause peak drift in high-reverberation scenarios, leading to increased fitting error and azimuth instability. For distance estimation, using only static thresholds and direct peak search is easily affected by tail reverberation and local spikes, resulting in insufficient stability.

[0004] In conclusion, how to locate speakers in scenarios with high reverberation and obstruction is a problem that urgently needs to be solved. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a sound source localization method, apparatus, device, and medium based on a linear microphone array, capable of speaker localization in scenarios with high reverberation and obstruction. The specific solution is as follows: In a first aspect, this application provides a sound source localization method based on a linear microphone array, comprising: A preset test signal is played through a preset linear microphone array to obtain the initial microphone signal of each channel of the preset linear microphone array. The initial microphone signal is then synchronized and calibrated to obtain the corresponding processed microphone signal. The preset linear microphone array includes a preset number of array elements, each array element is configured with a corresponding preset array element number, and arranged according to a preset array element spacing, and is synchronously sampled at a preset sampling frequency. The cross-correlation algorithm is used to perform a first cross-correlation operation on the processed microphone signals of each channel based on the preset test signal to obtain the corresponding cross-correlation sequence. The target detection threshold of the preset linear microphone array is determined according to the cross-correlation sequence. Based on the target detection threshold, the first peak of the target in the cross-correlation sequence of each channel of the preset linear microphone array is detected, and the cross-correlation sequence is windowed with the first peak of the target as the center to obtain the windowed signal; A second cross-correlation operation is performed between the windowed signals of each channel to obtain a second cross-correlation result, and a third cross-correlation operation is performed between the second cross-correlation results to obtain a third cross-correlation result; According to the preset array element number, the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result are subjected to subsampling peak refinement and linear fitting to obtain the target slope, and the target angle is determined based on the preset sampling frequency and the target slope; The windowed signal is delayed, aligned, and enhanced according to the preset array element number and the target slope to obtain an enhanced signal. The enhanced signal is then subjected to a preset first peak detection operation through the target detection threshold to obtain a candidate peak position. The target distance is determined based on the candidate peak position, and the target sound source is located according to the target angle and the target distance.

[0006] Optionally, determining the target detection threshold of the preset linear microphone array based on the cross-correlation sequence includes: Determine the first peak value of the cross-correlation sequence that satisfies the preset maximum peak condition; Generate a corresponding set of candidate thresholds based on the first peak value; Determine whether the candidate thresholds in the candidate threshold set meet the preset threshold constraint conditions; If the conditions are met, the corresponding candidate threshold will be determined as the initial detection threshold for the channel. The initial detection thresholds of each channel are integrated into an initial detection threshold set. The median of the thresholds in the initial detection threshold set is determined, and the median of the thresholds is determined as the target detection threshold of the preset linear microphone array.

[0007] Optionally, after detecting the first peak of the target in the cross-correlation sequence of each channel of the preset linear microphone array based on the target detection threshold, the method further includes: A linear fit is performed between the target peak and the preset array element spacing to generate the corresponding residual; Determine whether the residual that satisfies the preset maximum condition is greater than or equal to a first preset number of residuals; If so, the target first peak detection is determined to have failed, and a corresponding error message is returned to the user. If not, the target first peak detection is considered successful.

[0008] Optionally, the step of performing windowing on the cross-correlation sequence centered on the target first peak to obtain the windowed signal includes: Define a preset window length; wherein, the preset window length includes a first window length that meets a preset minimum condition, and a second window length that meets a preset maximum condition; For each channel, with the target peak as the center, the corresponding local peak is obtained in a preset direction based on the target peak and half the length of the first window. The initial window length of each channel is constructed based on the local peak and the target first peak; Determine whether the initial window length is less than or equal to the second window length; If so, the initial window length is determined as the corresponding candidate window length; If not, then the second window length will be determined as the corresponding candidate window length; The candidate window lengths of each channel are integrated into a candidate window length set, the median of the window lengths in the candidate window length set is determined, and the median of the window lengths is determined as the target window length of the preset linear microphone array; Centered on the target peak, the cross-correlation sequence is truncated according to the target window length to obtain the truncated signal.

[0009] Optionally, the step of performing subsampling peak refinement and linear fitting on the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result according to the preset array element number to obtain the target slope, and determining the target angle based on the preset sampling frequency and the target slope, includes: Extract the index of the first peak value of each channel in the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result, and obtain the peak position with subsampling precision by fitting a quadratic function; Using the preset array element number as the abscissa and the peak position as the ordinate, a straight line is fitted to obtain the target slope of each channel; The corresponding fitting error is determined based on the target slope of each channel; Determine whether the fitting error that satisfies the preset maximum condition is greater than or equal to a second preset number of fitting errors; If so, outliers are detected and removed, and then the step of re-executing the subsampling peak refinement and line fitting of the cross-correlation sequence, the second cross-correlation result and the third cross-correlation result according to the preset array element number is performed to obtain the target slope. If not, the target angle is determined based on the preset sampling frequency, the target slope, the sound speed, and the preset array element spacing.

[0010] Optionally, the second cross-correlation operation between the windowed signals of each channel to obtain the second cross-correlation result includes: The reference channel is determined according to the preset array element number; The windowed signal of the reference channel is cross-correlated with the windowed signal of the non-reference channel for a second time to obtain the second cross-correlation result.

[0011] Optionally, the step of delaying and aligning the windowed signal and enhancing it according to the preset element number and the target slope to obtain an enhanced signal, performing a preset first peak detection operation on the enhanced signal through the target detection threshold to obtain candidate peak positions, and determining the target distance based on the candidate peak positions includes: The delay compensation amount of each channel relative to the reference channel is determined based on the preset array element number and the target slope; The windowed signal is delayed and aligned according to the delay compensation amount to obtain the aligned signal; The aligned signals of each channel are normalized and summed according to the channel energy to obtain the enhanced signal; First peak detection is performed on the enhanced signal according to the target detection threshold to determine the candidate peak position for distance calculation; Based on the candidate peak positions, locate the target index corresponding to the target main peak in the enhanced signal; The target distance is determined based on the preset sampling frequency, sound speed, target index, and delay compensation amount.

[0012] Secondly, this application provides a sound source localization device based on a linear microphone array, comprising: The signal processing module is used to play a preset test signal through a preset linear microphone array to obtain the initial microphone signal of each channel of the preset linear microphone array, and to perform synchronization and calibration processing on the initial microphone signal to obtain the corresponding processed microphone signal; wherein, the preset linear microphone array includes a preset number of array elements, the array elements are configured with corresponding preset array element numbers, and are arranged according to a preset array element spacing, and are synchronously sampled at a preset sampling frequency. The threshold determination module is used to perform a first cross-correlation operation on the processed microphone signals of each channel based on the preset test signal using a cross-correlation algorithm to obtain a corresponding cross-correlation sequence, and to determine the target detection threshold of the preset linear microphone array based on the cross-correlation sequence. The signal truncating module is used to detect the first peak of the target in the cross-correlation sequence of each channel of the preset linear microphone array based on the target detection threshold, and to perform truncating on the cross-correlation sequence with the first peak of the target as the center to obtain the truncated signal; The result acquisition module is used to perform a second cross-correlation operation between the windowed signals of each channel to obtain a second cross-correlation result, and to perform a third cross-correlation operation between each of the second cross-correlation results to obtain a third cross-correlation result. An angle determination module is used to refine the sub-sampling peak value and fit a straight line to the cross-correlation sequence, the second cross-correlation result and the third cross-correlation result according to the preset array element number, to obtain the target slope, and to determine the target angle based on the preset sampling frequency and the target slope. The positioning and determination module is used to perform delay alignment and signal enhancement on the windowed signal according to the preset array element number and the target slope to obtain an enhanced signal, perform a preset first peak detection operation on the enhanced signal through the target detection threshold to obtain the candidate peak position, determine the target distance based on the candidate peak position, and determine the target sound source positioning according to the target angle and the target distance.

[0013] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the sound source localization method based on a linear microphone array as described above.

[0014] Fourthly, this application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned sound source localization method based on a linear microphone array.

[0015] In summary, this application uses a preset linear microphone array to play a preset test signal to obtain the initial microphone signals of each channel of the preset linear microphone array. The initial microphone signals are then synchronized and calibrated to obtain the corresponding processed microphone signals. The preset linear microphone array includes a preset number of array elements, each configured with a corresponding preset array element number and arranged according to a preset array element spacing, and sampled synchronously at a preset sampling frequency. A cross-correlation algorithm is used to perform a first cross-correlation operation on the processed microphone signals of each channel based on the preset test signal to obtain a corresponding cross-correlation sequence. A target detection threshold for the preset linear microphone array is determined based on the cross-correlation sequence. Based on the target detection threshold, the first peak of the target in the cross-correlation sequence of each channel of the preset linear microphone array is detected, and the cross-correlation sequence is then centered on the first peak of the target. A windowing process is performed to obtain the windowed signal; a second cross-correlation operation is performed between the windowed signals of each channel to obtain the second cross-correlation result; a third cross-correlation operation is performed between the second cross-correlation results to obtain the third cross-correlation result; subsampling peak refinement and linear fitting are performed on the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result according to the preset array element number to obtain the target slope; the target angle is determined based on the preset sampling frequency and the target slope; the windowed signal is delayed, aligned, and enhanced according to the preset array element number and the target slope to obtain the enhanced signal; a preset first peak detection operation is performed on the enhanced signal through the target detection threshold to obtain the candidate peak position; the target distance is determined based on the candidate peak position; and the target sound source localization is determined based on the target angle and the target distance. As can be seen from the above, this application's sound source localization method based on a linear microphone array plays a test signal through a preset linear microphone array, collects the initial microphone signals of each channel, and performs synchronization and calibration processing to obtain the processed signal. A cross-correlation algorithm is used to perform a first cross-correlation between the processed signal and the test signal to obtain a cross-correlation sequence, which is then used to determine the detection threshold. Based on this threshold, the first peak of the target is detected in the cross-correlation sequence of each channel, and a windowed signal is obtained with the first peak as the center. Subsequently, a second and third cross-correlation operation is performed on the windowed signal to gradually suppress interference and enhance the consistent main peak. The target slope is obtained through subsampling peak refinement and linear fitting. The incident angle of the sound source is calculated by combining the sampling frequency. The windowed signal is delayed, aligned, and enhanced according to the array element number and slope. Then, the first peak is detected in the enhanced signal using the same detection threshold, and the target distance is calculated. Finally, the angle and distance information are fused to achieve highly robust three-dimensional spatial localization of the sound source.In this way, the distance is estimated based on multi-channel peak values, the detection threshold for each channel is calculated, and the median is taken to form the detection threshold. Based on this, first-peak consistency checks and adaptive windowing are used to reduce abnormal peaks and reflection interference. Furthermore, cascaded processing of secondary and tertiary cross-correlation improves the stability of delay estimation. This detection threshold is reused in the distance calculation stage to ensure consistency between the orientation and ranging detection strategies. Robust localization in scenarios with high reverberation and occlusion is achieved through multi-mechanism collaborative processing. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0017] Figure 1 This is a flowchart of a sound source localization method based on a linear microphone array disclosed in this application; Figure 2 This is a flowchart of a specific automatic threshold and first peak robust processing method disclosed in this application; Figure 3 This is a flowchart of a specific cubic cross-correlation orientation and distance estimation method disclosed in this application; Figure 4 This is a flowchart of a specific sound source localization method based on a linear microphone array disclosed in this application; Figure 5 This is a schematic diagram of a sound source localization device based on a linear microphone array disclosed in this application; Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Currently, complex sound fields can lead to multiple competing peaks in the cross-correlation sequence caused by reflection paths, making the peak corresponding to the true direct sound susceptible to interference from spurious peaks. Furthermore, many existing schemes use fixed thresholds in the first peak detection stage, which cannot adaptively adjust with changes in signal-to-noise ratio, echo intensity, and propagation distance, resulting in near-field false triggering and far-field missed detection. For angle estimation, traditional single or double cross-correlation may still experience peak drift in high reverberation scenarios, leading to increased fitting errors and directional instability. For distance estimation, using only static thresholds and direct peak search is easily affected by tail reverberation and local spikes, resulting in insufficient stability. To address these technical problems, this application discloses a sound source localization method, apparatus, device, and medium based on a linear microphone array, capable of speaker localization in high reverberation and obstruction scenarios.

[0020] See Figure 1 As shown, this embodiment of the invention discloses a sound source localization method based on a linear microphone array, including: Step S11: Play a preset test signal through a preset linear microphone array to obtain the initial microphone signal of each channel of the preset linear microphone array, and perform synchronization and calibration processing on the initial microphone signal to obtain the corresponding processed microphone signal; wherein, the preset linear microphone array includes a preset number of array elements, the array elements are configured with corresponding preset array element numbers, and are arranged according to the preset array element spacing, and are synchronously sampled at a preset sampling frequency.

[0021] In this embodiment, a preset test signal is played through a preset linear microphone array. It should be noted that the number of elements in the preset linear microphone array is denoted as... , Each array element corresponds to a unique array element number, and the array element spacing is... Sampling rate After playback, synchronous capture will be performed. The initial microphone signal is processed, and clock synchronization and gain consistency calibration are completed to obtain the corresponding processed microphone signal.

[0022] Step S12: Using a cross-correlation algorithm, perform a first cross-correlation operation on the processed microphone signals of each channel based on the preset test signal to obtain a corresponding cross-correlation sequence, and determine the target detection threshold of the preset linear microphone array based on the cross-correlation sequence.

[0023] In this embodiment, as Figure 2 As shown, the reference signal and each channel signal are processed. One cross-correlation yields the cross-correlation sequences for each channel. : ; in, For the first Channel first-order cross-correlation sequence; L is the signal length; X[k] are the discrete Fourier transform coefficients of the reference signal; Ri [k] is the conjugate of the discrete Fourier transform coefficients of the i-th channel signal; β is the weighting exponent of GCC-PHAT-Beta; k is the frequency index; τ is the time delay index.

[0024] Next, a first peak value satisfying a preset maximum peak condition is determined from the cross-correlation sequence; a corresponding candidate threshold set is generated based on the first peak value; it is determined whether the candidate thresholds in the candidate threshold set satisfy a preset threshold constraint condition; if they do, the corresponding candidate threshold is determined as the initial detection threshold for the channel; the initial detection thresholds of each channel are integrated into an initial detection threshold set, the median of the thresholds in the initial detection threshold set is determined, and the median of the thresholds is determined as the target detection threshold for the preset linear microphone array. Specifically, peak detection is performed based on the obtained cross-correlation sequence, a detection threshold for each channel is constructed based on the maximum peak position, and constraints are applied by combining an upper threshold and a lower threshold. The final threshold is determined as follows. The median of the channel thresholds is used for subsequent first peak detection.

[0025] For the first Channel cross-correlation sequence First, calculate the position of the maximum peak: ; in, This is the index of the position of the maximum peak in the i-th channel; Estimate the distance for the i-th channel; is the preset sampling frequency; c is the speed of sound.

[0026] The candidate threshold for this channel is then obtained from the position of the maximum peak, and the final threshold is obtained by applying upper and lower threshold constraints. ; in, The detection threshold for the i-th channel; The reference threshold is 0.7~0.9 at the reference distance; α is the preset distance attenuation coefficient, 0.02~0.08. The preset reference distance is 1m; The preset detection threshold is 0.5, to prevent noise-induced false triggering due to an excessively low far-field threshold.

[0027] Finally, the median of the multi-channel thresholds was determined: ; in, The system detection threshold used for subsequent detection; is the detection threshold for each channel, and N is the number of array elements.

[0028] Step S13: Detect the first peak of the target in the cross-correlation sequence of each channel of the preset linear microphone array based on the target detection threshold, and perform windowing on the cross-correlation sequence with the first peak of the target as the center to obtain the windowed signal.

[0029] In this embodiment, as Figure 2 As shown, a detection threshold is used. The target peaks for each passage have been identified: ; Where pi is the index of the first peak position of the i-th channel; τ is the time delay index; The detection threshold obtained in step S2; It represents the maximum value of the cross-correlation sequence of the i-th channel.

[0030] Next, a linear fit is performed between the target first peak and the preset element spacing to generate a corresponding residual; it is then determined whether the residual satisfying the preset maximum condition is greater than or equal to a first preset number of residuals; if so, the target first peak detection is deemed to have failed, and a corresponding error message is returned to the user; if not, the target first peak detection is deemed to have succeeded. Specifically, for and the corresponding array element positions Perform linear fitting: ; Where pi is the fitted value of the first peak position in the i-th channel; a and b are the linear coefficients obtained from the least squares fitting; and di is the position of the i-th element. Calculate the residual: ; Where Δi is the residual between the position of the first peak in the i-th channel and the fitted value. If If no sampling point is found, the detection is considered a failure and an error is reported. This constraint is used to eliminate cross-channel inconsistent first peaks caused by occlusion reflections and local noise bursts.

[0031] Then, a preset window length is defined; wherein, the preset window length includes a first window length that satisfies a preset minimum condition, and a second window length that satisfies a preset maximum condition; for each channel, with the target first peak as the center, a corresponding local peak is obtained in a preset direction based on the target first peak and half of the first window length; an initial window length for each channel is constructed based on the local peak and the target first peak; it is determined whether the initial window length is less than or equal to the second window length; if so, the initial window length is determined as the corresponding candidate window length; if not, the second window length is determined as the corresponding candidate window length; the candidate window lengths of each channel are integrated into a candidate window length set, the median of the window lengths in the candidate window length set is determined, and the median of the window lengths is determined as the target window length of the preset linear microphone array; with the target first peak as the center, the cross-correlation sequence is windowed according to the target window length to obtain the windowed signal. Specifically, a minimum window length is defined. With maximum window length For each channel, the position of the first peak is considered. Based on, in Search for the first local peak on the right and record its position as . Construct candidate window length: ; Limit the candidate window length to no more than Take the median of all candidate window lengths as the uniform window length: ; Subsequently, windowing is performed centered on the first peak of each channel to obtain the truncated multi-channel signal. Compared with a fixed window length, this mechanism is more adaptable to different sound fields and reflection structures, and can reduce the risks of introducing reflection peaks due to excessively large window lengths and truncating direct peaks due to excessively small window lengths.

[0032] Step S14: Perform a second cross-correlation operation between the windowed signals of each channel to obtain a second cross-correlation result, and perform a third cross-correlation operation between each of the second cross-correlation results to obtain a third cross-correlation result.

[0033] In this embodiment, as Figure 3 As shown, a reference channel is determined according to the preset array element number; the windowed signal of the reference channel is cross-correlated with the windowed signals of non-reference channels in a second way to obtain the second cross-correlation result. Specifically, taking the first windowed channel as a reference, it is cross-correlated with the remaining channels one by one to obtain... The output of the second-order cross-correlation is then processed. The goal of this stage is to explicitly encode "reference channel consistency" into the intermediate results. Then, the above... The outputs of the second cross-correlation are cross-correlated pairwise to obtain the third cross-correlation result.

[0034] Step S15: Based on the preset array element number, perform subsampling peak refinement and linear fitting on the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result to obtain the target slope, and determine the target angle based on the preset sampling frequency and the target slope.

[0035] In this embodiment, as Figure 3 As shown, the index of the first peak value of each channel in the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result is extracted, and the peak position with subsampling precision is obtained by fitting a quadratic function. A straight line is fitted with the preset array element number as the abscissa and the peak position as the ordinate to obtain the target slope of each channel. The corresponding fitting error is determined based on the target slope of each channel. It is determined whether the fitting error satisfying the preset maximum condition is greater than or equal to the second preset number of fitting errors. If so, outliers are detected and removed, and then the step of re-executing the subsampling peak refinement and straight line fitting of the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result based on the preset array element number to obtain the target slope is re-executed. If not, the target angle is determined based on the preset sampling frequency, the target slope, the sound velocity, and the preset array element spacing. Specifically, the index of the maximum peak value of each channel in the three cross-correlation sequences is extracted, and the peak position with subsampling precision is obtained by fitting a quadratic function. The array element number is used as the abscissa and the peak position is used as the ordinate. For the horizontal axis, the sub-sampling refined peak position index of the corresponding path By fitting a straight line to the ordinate, the slope can be obtained. : ; in, For the first Fitting position of the peak value of the third cross-correlation of the road; To fit the slope (reflecting the linear relationship between time delay and spacing between array elements); The intercept is the fitting distance. For the first The microphone spacing corresponding to the third cross-correlation of the path.

[0036] Under the uniform linear array and far-field plane wave approximation This represents the change in peak index when the element number increases by one unit. It is consistent with the equivalent time delay difference between adjacent elements on the sampling point scale and can be directly used for delay alignment. Before fitting, weights are allocated according to the peak energy ratio to reduce the perturbation of the slope by weak peaks.

[0037] It is important to know that the maximum error from all points to the fitted line must satisfy... First, remove outliers and then refit; if the refit still does not meet the requirements, report an error.

[0038] Finally, the angle of the sound source entering the target is calculated based on the slope. : ; in, Speed ​​of sound; This represents the spacing between adjacent array elements. To ensure the computability of inverse trigonometric functions, in engineering implementation, [the following can be done]: Cut off the interval to When the geometric definition of the angle of arrival differs from the array layout direction, the above relationship can be rewritten equivalently without changing the engineering implementation logic of this step.

[0039] Step S16: Delay alignment and signal enhancement are performed on the windowed signal according to the preset array element number and the target slope to obtain an enhanced signal. The enhanced signal is then subjected to a preset first peak detection operation through the target detection threshold to obtain the candidate peak position. The target distance is determined based on the candidate peak position. The target sound source is located according to the target angle and the target distance.

[0040] In this embodiment, the delay compensation amount of each channel relative to the reference channel is determined according to the preset array element number and the target slope; the windowed signal is delayed and aligned according to the delay compensation amount to obtain the aligned signal; the aligned signal of each channel is normalized and summed according to the channel energy to obtain the enhanced signal; the first peak detection is performed on the enhanced signal according to the target detection threshold to determine the candidate peak position for distance calculation; the target index corresponding to the main peak of the target is located in the enhanced signal according to the candidate peak position; the target distance is determined based on the preset sampling frequency, sound speed, target index and delay compensation amount.

[0041] Specifically, based on the preset array element sequence number and Determine the delay compensation amount for each channel relative to the reference channel, perform delay alignment on the windowed signal, and sum the results to obtain the enhanced signal. The first channel is used as the reference by default; when… At this point, switch to using the last channel as a reference and recalculate the compensation amount. For the first... Channel, compensation amount is defined as ,in This is the reference channel index. Integer delays are implemented using delay lines, and fractional delays are implemented using first-order all-pass filters. ; Where H(z) is the transfer function of the first-order all-pass filter; z is the complex frequency variable; and a is the coefficient of the all-pass filter. For decimal delay terms, i.e. The decimal part. After delay alignment, normalization can be performed according to channel energy before summation, reducing the bias of individual high-energy channels on the main peak position.

[0042] Detection threshold for reuse calculation First peak detection is performed on the enhanced signal to determine the candidate peak positions for distance calculation.

[0043] Locate the sampling index corresponding to the main peak in the enhanced single-channel signal. Furthermore, local interpolation methods can be used in the neighborhood of the main peak to refine the peak position. Under the above fitting definition, the number of equivalent time delay sampling points between array elements... Can be taken as Alternatively, it can be specified according to the project specifications. Establish a linear conversion relationship. Considering the offset relationship between the array reference point and the peak index definition, a compensation amount is introduced when the first channel is the reference. When the last channel is used as a reference, the opposite compensation amount is taken, and the ranging expression is written as: ; in, This represents the amount of equivalent time delay difference between adjacent array elements at the sampling point scale. This indicates a fixed system link delay, which can be obtained through pre-calibration. Speed ​​of sound; symbol In the above calculation, the first channel is used as the reference and the last channel is used as the reference and the last channel is used as the reference and the last channel is used as the reference and the last channel is used and the last channel is used and the last channel is used. In practical engineering, steady-state fusion of multiple consecutive ranging results can be performed to improve the output distance's resistance to fluctuations.

[0044] After obtaining the target angle θ and target distance L, the polar coordinates of the speaker can be determined to locate the sound source.

[0045] As described above, the sound source localization method based on a linear microphone array in this application involves playing a test signal through a preset linear microphone array, acquiring the initial microphone signals of each channel, and performing synchronization and calibration processing to obtain the processed signal. A cross-correlation algorithm is used to perform a first cross-correlation between the processed signal and the test signal to obtain a cross-correlation sequence, which is then used to determine a detection threshold. Based on this threshold, the target's first peak is detected in the cross-correlation sequence of each channel, and a window is obtained centered on the first peak to obtain the windowed signal. Subsequently, a second and third cross-correlation operation is performed on the windowed signal to gradually suppress interference and strengthen the consistent main peak. The target slope is obtained through subsampling peak refinement and linear fitting, and the sound source incident angle is calculated by combining the sampling frequency. The windowed signal is then delayed, aligned, and enhanced according to the array element number and slope. The first peak is then detected in the enhanced signal using the same detection threshold, and the target distance is calculated. Finally, the angle and distance information are fused to achieve highly robust three-dimensional spatial localization of the sound source. In this way, the distance is estimated based on multi-channel peak values, the detection threshold for each channel is calculated, and the median is taken to form the detection threshold. Based on this, first-peak consistency checks and adaptive windowing are used to reduce abnormal peaks and reflection interference. Furthermore, cascaded processing of secondary and tertiary cross-correlation improves the stability of delay estimation. This detection threshold is reused in the distance calculation stage to ensure consistency between the orientation and ranging detection strategies. Robust localization in scenarios with high reverberation and occlusion is achieved through multi-mechanism collaborative processing.

[0046] As can be seen from the previous embodiment, this application discloses a sound source localization method based on a linear microphone array, which can locate loudspeakers in scenarios with high reverberation and obstruction. Next, we will address methods such as... Figure 4 The sound source localization method based on a linear microphone array is explained in detail.

[0047] Take an intelligent meeting system as an example. A linear microphone array device is placed in the center of the table. It consists of multiple microphones arranged in a straight line at equal intervals. Each microphone has a fixed number and records synchronously at a uniform sampling frequency.

[0048] To locate the speaker's position in the room, a chirp sweep is played while all microphones simultaneously capture sound, obtaining the raw signal for each channel. These raw signals may contain deviations due to hardware differences or asynchrony, so they need to be synchronized and calibrated to align them with a unified time reference and amplitude scale, resulting in the processed microphone signal.

[0049] Next, using a cross-correlation algorithm, the processed signal of each channel is cross-correlated with the known test signal for the first time. Cross-correlation reveals the time shift of the part of the received signal most similar to the test signal, thus obtaining the cross-correlation sequence for each channel. These sequences will have a noticeable peak, but in order to distinguish between real target reflected sound and noise, the system calculates a target detection threshold based on the overall statistical characteristics of the cross-correlation sequence.

[0050] Then, in the cross-correlation sequence of each channel, find the first peak that exceeds the threshold, i.e. the target first peak, and window the sequence with this peak as the center, retaining only a small segment of signal near the peak.

[0051] Subsequently, the windowed signals from different channels are cross-correlated pairwise to obtain the second cross-correlation result. This step allows for a more precise extraction of the time delay difference between channels. Next, the second cross-correlation results are cross-correlated a third time, which further suppresses noise and enhances the shared time delay pattern. This results in a series of sequences reflecting the time delay relationships.

[0052] Based on the microphone numbering order, the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result are fitted between discrete sampling points to obtain a more accurate peak position. Then, a straight line is used to fit their relationship with the array element number. The slope of this straight line directly corresponds to the time delay gradient of the sound wave arriving at each array element. Combined with the pre-known sampling frequency, the incident angle of the target sound source can be calculated.

[0053] After determining the angle, return to the signal after the previous windowing. Shift the signals received by each microphone in the opposite direction to ensure that the components from the target direction are perfectly aligned in time. Then, superimpose and enhance them to obtain an enhanced signal with a higher signal-to-noise ratio. Next, use the target detection threshold calculated at the beginning to perform first peak detection on this enhanced signal to find the most significant peak position, thereby calculating the target distance.

[0054] Ultimately, by fusing the calculated target angle and distance, the speaker's exact location is pinpointed on the plane of the conference table, which can then drive the camera to turn towards that location or automatically adjust the sound pickup beam. The entire process, from raw sound acquisition to multiple rounds of cross-correlation, threshold filtering, fine fitting, and enhanced detection, transforms faint reflected sound in a noisy environment into accurate spatial coordinates step by step.

[0055] See Figure 5 As shown, this embodiment of the invention discloses a sound source localization device based on a linear microphone array, comprising: The signal processing module 11 is used to play a preset test signal through a preset linear microphone array to obtain the initial microphone signal of each channel of the preset linear microphone array, and to perform synchronization and calibration processing on the initial microphone signal to obtain the corresponding processed microphone signal; wherein, the preset linear microphone array includes a preset number of array elements, the array elements are configured with corresponding preset array element numbers, and are arranged according to a preset array element spacing, and are synchronously sampled at a preset sampling frequency. The threshold determination module 12 is used to perform a first cross-correlation operation on the processed microphone signals of each channel based on the preset test signal using a cross-correlation algorithm to obtain a corresponding cross-correlation sequence, and to determine the target detection threshold of the preset linear microphone array based on the cross-correlation sequence. The signal truncating module 13 is used to detect the first peak of the target in the cross-correlation sequence of each channel of the preset linear microphone array based on the target detection threshold, and to perform truncating on the cross-correlation sequence with the first peak of the target as the center to obtain the truncated signal; The result acquisition module 14 is used to perform a second cross-correlation operation between the windowed signals of each channel to obtain a second cross-correlation result, and to perform a third cross-correlation operation between each of the second cross-correlation results to obtain a third cross-correlation result. Angle determination module 15 is used to refine the subsampling peak value and fit the target slope by refining the cross-correlation sequence, the second cross-correlation result and the third cross-correlation result according to the preset array element number, and determine the target angle based on the preset sampling frequency and the target slope. The positioning determination module 16 is used to perform delay alignment and signal enhancement on the windowed signal according to the preset array element number and the target slope to obtain an enhanced signal, perform a preset first peak detection operation on the enhanced signal through the target detection threshold to obtain the candidate peak position, determine the target distance based on the candidate peak position, and determine the target sound source positioning according to the target angle and the target distance.

[0056] As described above, the sound source localization method based on a linear microphone array in this application plays a test signal through a preset linear microphone array, collects the initial microphone signals of each channel, and performs synchronization and calibration processing to obtain the processed signal. A cross-correlation algorithm is used to perform a first cross-correlation between the processed signal and the test signal to obtain a cross-correlation sequence, which is then used to determine the detection threshold. Based on this threshold, the first peak of the target is detected in the cross-correlation sequence of each channel, and a window is obtained with the first peak as the center. Subsequently, a second and third cross-correlation operation is performed on the windowed signal to gradually suppress interference and strengthen the consistent main peak. The target slope is obtained through subsampling peak refinement and linear fitting. The sound source incident angle is calculated by combining the sampling frequency. The windowed signal is delayed, aligned, and enhanced according to the array element number and slope. Then, the first peak is detected in the enhanced signal using the same detection threshold, and the target distance is calculated. Finally, the angle and distance information are fused to achieve highly robust three-dimensional spatial localization of the sound source. In this way, the distance is estimated based on multi-channel peak values, the detection threshold for each channel is calculated, and the median is taken to form the detection threshold. Based on this, first-peak consistency checks and adaptive windowing are used to reduce abnormal peaks and reflection interference. Furthermore, cascaded processing of secondary and tertiary cross-correlation improves the stability of delay estimation. This detection threshold is reused in the distance calculation stage to ensure consistency between the orientation and ranging detection strategies. Robust localization in scenarios with high reverberation and occlusion is achieved through multi-mechanism collaborative processing.

[0057] In some specific implementations, the threshold determination module 12 may specifically include: A peak determination unit is used to determine the first peak value of the cross-correlation sequence that satisfies a preset maximum peak condition; A set generation unit is used to generate a corresponding set of candidate thresholds based on the first peak value; A threshold determination unit is used to determine whether the candidate thresholds in the candidate threshold set meet the preset threshold constraint conditions. The first threshold determination unit is used to determine the corresponding candidate threshold as the initial detection threshold for the channel if the condition is met. The second threshold determination unit is used to integrate the initial detection thresholds of each channel into an initial detection threshold set, determine the median of the thresholds in the initial detection threshold set, and determine the median of the thresholds as the target detection threshold of the preset linear microphone array.

[0058] In some specific embodiments, the sound source localization device based on a linear microphone array may further include: The residual generation module is used to perform linear fitting between the target first peak and the preset array element spacing to generate the corresponding residual; The residual judgment module is used to determine whether the residual that satisfies the preset maximum condition is greater than or equal to a first preset number of the residuals. The first residual determination module is used to determine that the target first peak detection has failed if the condition is met, and to return the corresponding error message to the user. The second residual determination module is used to determine that the first peak of the target was successfully detected if the result is not found.

[0059] In some specific implementations, the signal clipping module 13 may specifically include: A length definition unit is used to define a preset cut-off window length; wherein, the preset cut-off window length includes a first window length that meets a preset minimum condition and a second window length that meets a preset maximum condition; The local peak acquisition unit is used to acquire corresponding local peaks in each channel with the target first peak as the center, based on the target first peak and half the length of the first window in a preset direction. A window length construction unit is used to construct the initial window length of each channel based on the local peak and the target first peak; A window length determination unit is used to determine whether the initial window length is less than or equal to the second window length; The first window length determination unit is used to determine the initial window length as the corresponding candidate window length if the condition is met. The second window length determination unit is used to determine the second window length as the corresponding candidate window length if the condition is not met. A window length determination unit is used to integrate the candidate window lengths of each channel into a candidate window length set, determine the median of the window lengths in the candidate window length set, and determine the median of the window lengths as the target window length of the preset linear microphone array. The signal acquisition unit is used to perform windowing on the cross-correlation sequence with the target first peak as the center and according to the target window length to obtain the windowed signal.

[0060] In some specific implementations, the angle determination module 15 may specifically include: The position acquisition unit is used to extract the index of the first peak value of each channel in the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result, and obtain the peak position with subsampling precision by fitting a quadratic function; The slope acquisition unit is used to perform linear fitting with the preset array element number as the horizontal axis and the peak position as the vertical axis to obtain the target slope of each channel. An error determination unit is used to determine the corresponding fitting error based on the target slope of each channel; An error judgment unit is used to determine whether the fitting error that satisfies the preset maximum condition is greater than or equal to a second preset number of the fitting errors; The first error determination unit is used to detect and remove outliers if the error is found, and then re-execute the step of refining the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result according to the preset array element number and performing subsampling peak refinement and line fitting to obtain the target slope. The second error determination unit is used to determine the target angle based on the preset sampling frequency, the target slope, the sound speed, and the preset array element spacing if the error is not found.

[0061] In some specific implementations, the result acquisition module 14 may specifically include: A channel determination unit is used to determine a reference channel based on the preset array element number; The result acquisition unit is used to perform a second cross-correlation operation between the windowed signal of the reference channel and the windowed signal of the non-reference channel to obtain the second cross-correlation result.

[0062] In some specific embodiments, the positioning determination module 16 may specifically include: The compensation amount determination unit is used to determine the delay compensation amount of each channel relative to the reference channel based on the preset array element number and the target slope; The first signal acquisition unit is used to perform delay alignment on the windowed signal according to the delay compensation amount to obtain the aligned signal. The second signal acquisition unit is used to normalize and sum the aligned signals of each channel according to the channel energy to obtain the enhanced signal. A location determination unit is used to perform first peak detection on the enhanced signal according to the target detection threshold, so as to determine the candidate peak position for distance calculation; An index positioning unit is used to locate the target index corresponding to the target main peak in the enhanced signal according to the candidate peak position; The distance determination unit is used to determine the target distance based on the preset sampling frequency, sound speed, target index, and delay compensation amount.

[0063] Furthermore, embodiments of this application also disclose an electronic device, Figure 6This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the sound source localization method based on a linear microphone array disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be a computer.

[0064] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0065] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0066] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the sound source localization method based on a linear microphone array as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.

[0067] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned sound source localization method based on a linear microphone array. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0068] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0069] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0070] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0071] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0072] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A sound source localization method based on a linear microphone array, characterized in that, include: A preset test signal is played through a preset linear microphone array to obtain the initial microphone signal of each channel of the preset linear microphone array. The initial microphone signal is then synchronized and calibrated to obtain the corresponding processed microphone signal. The preset linear microphone array includes a preset number of array elements, each array element is configured with a corresponding preset array element number, and arranged according to a preset array element spacing, and is synchronously sampled at a preset sampling frequency. The cross-correlation algorithm is used to perform a first cross-correlation operation on the processed microphone signals of each channel based on the preset test signal to obtain the corresponding cross-correlation sequence. The target detection threshold of the preset linear microphone array is determined according to the cross-correlation sequence. Based on the target detection threshold, the first peak of the target in the cross-correlation sequence of each channel of the preset linear microphone array is detected, and the cross-correlation sequence is windowed with the first peak of the target as the center to obtain the windowed signal; A second cross-correlation operation is performed between the windowed signals of each channel to obtain a second cross-correlation result, and a third cross-correlation operation is performed between the second cross-correlation results to obtain a third cross-correlation result; According to the preset array element number, the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result are subjected to subsampling peak refinement and linear fitting to obtain the target slope, and the target angle is determined based on the preset sampling frequency and the target slope; The windowed signal is delayed, aligned, and enhanced according to the preset array element number and the target slope to obtain an enhanced signal. The enhanced signal is then subjected to a preset first peak detection operation through the target detection threshold to obtain a candidate peak position. The target distance is determined based on the candidate peak position, and the target sound source is located according to the target angle and the target distance.

2. The sound source localization method based on a linear microphone array according to claim 1, characterized in that, Determining the target detection threshold of the preset linear microphone array based on the cross-correlation sequence includes: Determine the first peak value of the cross-correlation sequence that satisfies the preset maximum peak condition; Generate a corresponding set of candidate thresholds based on the first peak value; Determine whether the candidate thresholds in the candidate threshold set meet the preset threshold constraint conditions; If the conditions are met, the corresponding candidate threshold will be determined as the initial detection threshold for the channel. The initial detection thresholds of each channel are integrated into an initial detection threshold set. The median of the thresholds in the initial detection threshold set is determined, and the median of the thresholds is determined as the target detection threshold of the preset linear microphone array.

3. The sound source localization method based on a linear microphone array according to claim 1, characterized in that, After detecting the first peak of the target in the cross-correlation sequence of each channel of the preset linear microphone array based on the target detection threshold, the method further includes: A linear fit is performed between the target peak and the preset array element spacing to generate the corresponding residual; Determine whether the residual that satisfies the preset maximum condition is greater than or equal to a first preset number of residuals; If so, the target first peak detection is determined to have failed, and a corresponding error message is returned to the user. If not, the target first peak detection is considered successful.

4. The sound source localization method based on a linear microphone array according to claim 1, characterized in that, The step of windowing the cross-correlation sequence centered on the target peak to obtain the windowed signal includes: Define a preset window length; wherein, the preset window length includes a first window length that meets a preset minimum condition, and a second window length that meets a preset maximum condition; For each channel, with the target peak as the center, the corresponding local peak is obtained in a preset direction based on the target peak and half the length of the first window. The initial window length of each channel is constructed based on the local peak and the target first peak; Determine whether the initial window length is less than or equal to the second window length; If so, the initial window length is determined as the corresponding candidate window length; If not, then the second window length will be determined as the corresponding candidate window length; The candidate window lengths of each channel are integrated into a candidate window length set, the median of the window lengths in the candidate window length set is determined, and the median of the window lengths is determined as the target window length of the preset linear microphone array; Centered on the target peak, the cross-correlation sequence is truncated according to the target window length to obtain the truncated signal.

5. The sound source localization method based on a linear microphone array according to claim 1, characterized in that, The step of refining the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result by subsampling peak refinement and linear fitting according to the preset array element number to obtain the target slope, and determining the target angle based on the preset sampling frequency and the target slope, includes: Extract the index of the first peak value of each channel in the cross-correlation sequence, the second cross-correlation result, and the third cross-correlation result, and obtain the peak position with subsampling precision by fitting a quadratic function; Using the preset array element number as the abscissa and the peak position as the ordinate, a straight line is fitted to obtain the target slope of each channel; The corresponding fitting error is determined based on the target slope of each channel; Determine whether the fitting error that satisfies the preset maximum condition is greater than or equal to a second preset number of fitting errors; If so, outliers are detected and removed, and then the step of re-executing the subsampling peak refinement and line fitting of the cross-correlation sequence, the second cross-correlation result and the third cross-correlation result according to the preset array element number is performed to obtain the target slope. If not, the target angle is determined based on the preset sampling frequency, the target slope, the sound speed, and the preset array element spacing.

6. The sound source localization method based on a linear microphone array according to any one of claims 1 to 5, characterized in that, The second cross-correlation operation between the windowed signals of each channel to obtain the second cross-correlation result includes: The reference channel is determined according to the preset array element number; The windowed signal of the reference channel is cross-correlated with the windowed signal of the non-reference channel for a second time to obtain the second cross-correlation result.

7. The sound source localization method based on a linear microphone array according to claim 6, characterized in that, The step of delaying and aligning the windowed signal and enhancing it according to the preset array element number and the target slope to obtain an enhanced signal, performing a preset first peak detection operation on the enhanced signal through the target detection threshold to obtain candidate peak positions, and determining the target distance based on the candidate peak positions includes: The delay compensation amount of each channel relative to the reference channel is determined based on the preset array element number and the target slope; The windowed signal is delayed and aligned according to the delay compensation amount to obtain the aligned signal; The aligned signals of each channel are normalized and summed according to the channel energy to obtain the enhanced signal; First peak detection is performed on the enhanced signal according to the target detection threshold to determine the candidate peak position for distance calculation; Based on the candidate peak positions, locate the target index corresponding to the target main peak in the enhanced signal; The target distance is determined based on the preset sampling frequency, sound speed, target index, and delay compensation amount.

8. A sound source localization device based on a linear microphone array, characterized in that, include: The signal processing module is used to play a preset test signal through a preset linear microphone array to obtain the initial microphone signal of each channel of the preset linear microphone array, and to perform synchronization and calibration processing on the initial microphone signal to obtain the corresponding processed microphone signal; wherein, the preset linear microphone array includes a preset number of array elements, the array elements are configured with corresponding preset array element numbers, and are arranged according to a preset array element spacing, and are synchronously sampled at a preset sampling frequency. The threshold determination module is used to perform a first cross-correlation operation on the processed microphone signals of each channel based on the preset test signal using a cross-correlation algorithm to obtain a corresponding cross-correlation sequence, and to determine the target detection threshold of the preset linear microphone array based on the cross-correlation sequence. The signal truncating module is used to detect the first peak of the target in the cross-correlation sequence of each channel of the preset linear microphone array based on the target detection threshold, and to perform truncating on the cross-correlation sequence with the first peak of the target as the center to obtain the truncated signal; The result acquisition module is used to perform a second cross-correlation operation between the windowed signals of each channel to obtain a second cross-correlation result, and to perform a third cross-correlation operation between each of the second cross-correlation results to obtain a third cross-correlation result. An angle determination module is used to refine the sub-sampling peak value and fit a straight line to the cross-correlation sequence, the second cross-correlation result and the third cross-correlation result according to the preset array element number, to obtain the target slope, and to determine the target angle based on the preset sampling frequency and the target slope. The positioning and determination module is used to perform delay alignment and signal enhancement on the windowed signal according to the preset array element number and the target slope to obtain an enhanced signal, perform a preset first peak detection operation on the enhanced signal through the target detection threshold to obtain the candidate peak position, determine the target distance based on the candidate peak position, and determine the target sound source positioning according to the target angle and the target distance.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the sound source localization method based on a linear microphone array as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the sound source localization method based on a linear microphone array as described in any one of claims 1 to 7.