An all-pass filter-based sound source orientation method, device, equipment and medium
By employing a sound source localization method based on an all-pass filter, utilizing a multi-channel linear microphone array and a Thiran all-pass filter, the problem of limited delay estimation accuracy in traditional sound source localization systems is solved, achieving high-precision sound source localization.
Patent Information
- Application Number
- CN202610361376.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-24
- Publication Date
- 2026-06-05
AI Technical Summary
In traditional microphone linear array sound source localization systems, the delay estimation accuracy is constrained by the Rayleigh limit, making it difficult to meet the requirements of high-precision sound source localization, especially under low sampling rate conditions or noisy environments where robustness is insufficient.
A sound source localization method based on an all-pass filter is adopted. Recording is performed using a multi-channel linear microphone array. Initial delay estimation is performed through generalized cross-correlation and quadratic function fitting. The target filter coefficients are determined by combining the Thiran all-pass filter and the least squares method to achieve high-precision sound source localization.
Breaking through the Rayleigh limit, it achieves delay estimation accuracy at the sub-sampling point level, meeting the requirements for high-precision sound source localization and improving the accuracy of sound source orientation.
Smart Images

Figure CN122150985A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for sound source localization based on an all-pass filter. Background Technology
[0002] In microphone linear array sound source localization systems, delay estimation is a core technical aspect. Traditional delay estimation methods mainly rely on cross-correlation algorithms, which calculate the cross-correlation function between signals received by different microphones and find the location of its maximum value to determine the signal arrival time difference. This method is theoretically simple and intuitive, and has been widely used in practical applications. However, the cross-correlation method has a fundamental limitation: its delay estimation accuracy is constrained by the sampling rate, the so-called Rayleigh Limit. Specifically, when the sampling rate is... At that time, the highest accuracy of delay estimation achieved by the cross-correlation method can only reach... This means that traditional cross-correlation methods often fail to meet the requirements under low sampling rate conditions or when the application scenario demands higher positioning accuracy. For example, at a sampling rate of 48kHz, the delay estimation accuracy is approximately 20.8 microseconds, corresponding to a spatial resolution of approximately 7 millimeters, which is insufficient for high-precision sound source localization applications. To improve delay estimation accuracy, various improvement methods exist, including parabolic interpolation and frequency domain phase methods. However, while these methods can achieve delay estimation with sub-sampling point accuracy to a certain extent, they still struggle to overcome the fundamental limitation of the Rayleigh limit and lack robustness in noisy environments.
[0003] As can be seen from the above, how to overcome the Rayleigh limit constraint to achieve high-precision delay estimation in order to ensure the accuracy of sound source localization is an urgent problem to be solved. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a sound source localization method, apparatus, device, and medium based on an all-pass filter, which can overcome the Rayleigh limit constraint to achieve high-precision delay estimation, thereby ensuring the accuracy of sound source localization. The specific solution is as follows: In a first aspect, this application provides a sound source localization method based on an all-pass filter, comprising: A broadband excitation signal is played using a sound source, and the sound source is recorded using a multi-channel linear microphone array to obtain multi-channel recording data. A first generalized cross-correlation operation is performed on the broadband excitation signal and the multi-channel recording data to obtain a first cross-correlation result. The first cross-correlation result is a cross-correlation result that corresponds one-to-one with each channel. The first cross-correlation result is sliced to obtain multi-channel slice data. A second generalized cross-correlation operation is performed based on the multi-channel slice data to obtain a second cross-correlation result. Based on the second cross-correlation result, an initial delay value is determined using a quadratic function fitting method, and it is determined whether the absolute value of the initial delay value is greater than a preset threshold. If the value is greater than the preset threshold, the multi-channel slice data is upsampled to obtain upsampled slice data. Based on the upsampled slice data, the signal delay relationship between each adjacent channel is modeled using a Thiran all-pass filter to obtain linear equations. Based on the linear equations, the target filter coefficients are determined using the least squares method. The Thiran all-pass filter is an all-pass filter designed based on the Thiran approximation algorithm. The target delay value of each adjacent channel is determined using the target filter coefficients. Based on the target delay value and the target parameters of the linear microphone array, the sound source incident angle is determined to complete the corresponding sound source orientation operation.
[0005] Optionally, the step of playing a broadband excitation signal using a sound source, recording the sound source based on a multi-channel linear microphone array to obtain multi-channel recording data, and performing a first generalized cross-correlation operation on the broadband excitation signal and the multi-channel recording data to obtain a first cross-correlation result includes: A multi-channel linear microphone array is constructed using a target number of microphones arranged in a straight line. A broadband excitation signal is played using a sound source, and the sound source is synchronously recorded based on the multi-channel linear microphone array to obtain multi-channel recording data. The broadband excitation signal and the multi-channel recording data are subjected to a first generalized cross-correlation operation using a generalized cross-correlation algorithm or a generalized cross-correlation-phase transformation algorithm to obtain a first cross-correlation result.
[0006] Optionally, the step of slicing the first cross-correlation result to obtain multi-channel slice data, performing a second generalized cross-correlation operation based on the multi-channel slice data to obtain a second cross-correlation result, and determining the initial delay value based on the second cross-correlation result using a quadratic function fitting method includes: Based on the first cross-correlation result, the position corresponding to the maximum value of the first cross-correlation result of the middle channel in the multi-channel is determined as the slice center; The first cross-correlation result is sliced using the slice center and a preset window length to obtain multi-channel slice data; Based on the multi-channel slice data, a second generalized cross-correlation operation is performed on the slice data of the first channel and the slice data of the last channel to obtain the second cross-correlation result; The target index position corresponding to the maximum value in the second cross-correlation result is determined using a quadratic function fitting method, and the initial delay value is determined based on the target index position.
[0007] Optionally, after determining whether the absolute value of the initial delay value is greater than a preset threshold, the method further includes: If the absolute value of the initial delay value is not greater than a preset threshold, then a target delay value is determined based on the initial delay value, and the step of determining the sound source incident angle based on the target delay value and using the target parameters of the linear microphone array is triggered.
[0008] Optionally, if the value is greater than the preset threshold, the multi-channel slice data is upsampled to obtain upsampled slice data. Based on the upsampled slice data, the signal delay relationship between adjacent channels is modeled using a Thiran all-pass filter to obtain linear equations. Based on the linear equations, the target filter coefficients are determined using the least squares method, including: If the value is greater than the preset threshold, it is determined whether the initial delay value is negative, and the multi-channel slice data is upsampled by a target multiple based on the determination result to obtain upsampled slice data. Based on the upsampled slice data and using the Thiran all-pass filter, the signal delay relationship of each adjacent channel is modeled to obtain each linear equation, and the linear equations are combined to obtain the target equation set. The target filter coefficients are determined based on the target equation set and using the least squares method.
[0009] Optionally, determining whether the initial delay value is negative, and upsampling the multi-channel slice data by a target factor based on the determined result to obtain upsampled slice data, includes: Determine whether the initial delay value is negative; If the initial delay value is negative, the multi-channel slice data is flipped in the time domain to obtain flipped slice data, and the flipped slice data is upsampled by a target multiple to obtain upsampled slice data. If the initial delay value is not negative, the multi-channel slice data is upsampled by a target factor to obtain upsampled slice data.
[0010] Optionally, determining the sound source incident angle based on the target delay value and using the target parameters of the linear microphone array includes: The sound source incident angle is determined based on the target delay value and using the spacing between adjacent microphones of the linear microphone array, the sound speed of the sound source in the environment, and the sampling rate of the linear microphone array during recording.
[0011] Secondly, this application provides a sound source directional device based on an all-pass filter, comprising: The cross-correlation operation module is used to play a broadband excitation signal using a sound source, record the sound source based on a multi-channel linear microphone array to obtain multi-channel recording data, and perform a first generalized cross-correlation operation on the broadband excitation signal and the multi-channel recording data to obtain a first cross-correlation result; the first cross-correlation result is a cross-correlation result that corresponds one-to-one with each channel; The initial delay value determination module is used to slice the first cross-correlation result to obtain multi-channel slice data, perform a second generalized cross-correlation operation based on the multi-channel slice data to obtain a second cross-correlation result, determine the initial delay value based on the second cross-correlation result and using a quadratic function fitting method, and determine whether the absolute value of the initial delay value is greater than a preset threshold. The target coefficient determination module is used to upsample the multi-channel slice data if the target coefficient is greater than the preset threshold, to obtain upsampled slice data, to model the signal delay relationship of each adjacent channel based on the upsampled slice data and using a Thiran all-pass filter to obtain linear equations, and to determine the target filter coefficients based on the linear equations and using the least squares method; the Thiran all-pass filter is an all-pass filter designed based on the Thiran approximation algorithm. An incident angle determination module is used to determine the target delay value of each adjacent channel using the target filter coefficients, and to determine the sound source incident angle based on the target delay value and the target parameters of the linear microphone array, so as to complete the corresponding sound source orientation operation.
[0012] 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 aforementioned sound source localization method based on an all-pass filter.
[0013] Fourthly, this application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned sound source localization method based on an all-pass filter.
[0014] This application utilizes a sound source to play a broadband excitation signal, and records the sound source using a multi-channel linear microphone array to obtain multi-channel recording data. A first generalized cross-correlation operation is performed on the broadband excitation signal and the multi-channel recording data to obtain a first cross-correlation result; the first cross-correlation result is a cross-correlation result corresponding one-to-one with each channel. The first cross-correlation result is sliced to obtain multi-channel slice data. A second generalized cross-correlation operation is performed on the multi-channel slice data to obtain a second cross-correlation result. Based on the second cross-correlation result, an initial delay value is determined using a quadratic function fitting method, and it is determined whether the absolute value of the initial delay value is greater than a preset value. A threshold is set; if the threshold is greater than the preset threshold, the multi-channel slice data is upsampled to obtain upsampled slice data. Based on the upsampled slice data, the signal delay relationship of each adjacent channel is modeled using a Thiran all-pass filter to obtain linear equations. Based on the linear equations, the target filter coefficients are determined using the least squares method. The Thiran all-pass filter is an all-pass filter designed based on the Thiran approximation algorithm. The target delay value of each adjacent channel is determined using the target filter coefficients. Based on the target delay value and the target parameters of the linear microphone array, the sound source incident angle is determined to complete the corresponding sound source orientation operation.
[0015] As can be seen from the above, this application acquires multi-channel recording data. The broadband excitation signal can carry more significant time-domain / frequency-domain features, avoiding the problem of ambiguity in delay information of single-frequency signals. Generalized cross-correlation operation performs similarity matching on the broadband excitation signal and the recording data of each channel to obtain the first cross-correlation result. Secondary cross-correlation is performed on the first and last channel data after slicing, and the quadratic function fitting method is combined to overcome the limitation of integer sampling points, realizing the initial coarse estimation of delay at the sub-sampling point level. Then, the multi-channel sliced data is upsampled to improve the signal time resolution. The delay relationship of each adjacent channel signal is modeled using a Thiran all-pass filter, transforming the traditional direct delay estimation problem into a parameter estimation problem. The least squares method is used to solve the simultaneous linear equations to obtain the optimal target filter coefficients. In this way, the target filter parameters are used to determine the high-precision target delay value of each adjacent channel, and the target delay value is converted into the sound source incident angle by combining the target parameters of the linear microphone array, realizing high-precision sound source localization at the oversampling level, meeting the needs of high-precision positioning scenarios. 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 an all-pass filter disclosed in this application; Figure 2 This is a flowchart of a specific sound source localization method based on an all-pass filter disclosed in this application; Figure 3 This is a schematic diagram of a sound source directional device based on an all-pass filter disclosed in this application; Figure 4 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, cross-correlation methods suffer from a fundamental limitation: their delay estimation accuracy is constrained by the sampling rate, known as the Rayleigh limit. This limitation means that under low sampling rate conditions, or when applications demand higher positioning accuracy, traditional cross-correlation methods often fail to meet the requirements, struggle to overcome the Rayleigh limit, and lack robustness in noisy environments. To address this, this application provides a sound source localization method based on an all-pass filter. This method utilizes target filter parameters to determine high-precision target delay values for each adjacent channel, and combines these with the target parameters of a linear microphone array to convert the target delay values into sound source incident angles, achieving high-precision sound source localization at the oversampling level and meeting the needs of high-precision positioning scenarios.
[0020] See Figure 1 As shown, this embodiment of the invention discloses a sound source localization method based on an all-pass filter, comprising: Step S11: Play a broadband excitation signal using a sound source, record the sound source using a multi-channel linear microphone array to obtain multi-channel recording data, and perform a first generalized cross-correlation operation on the broadband excitation signal and the multi-channel recording data to obtain a first cross-correlation result; the first cross-correlation result is a cross-correlation result that corresponds one-to-one with each channel.
[0021] In this embodiment, a multi-channel linear microphone array is constructed using M microphones arranged in a straight line. A broadband excitation signal, such as a sweep frequency signal or a music signal, is played from a sound source. Synchronous recording is performed on the sound source based on the linear microphone array to obtain M channels of recording data. A first generalized cross-correlation operation is performed on the broadband excitation signal and the multi-channel recording data using either the Generalized Cross-Correlation (GCC) algorithm or the Generalized Cross-Correlation-Phase Transformation (GCC-PHAT) algorithm to obtain a first cross-correlation result. The frequency domain expression corresponding to the Generalized Cross-Correlation-Phase Transformation algorithm is: ; in, This is the result of the first cross-correlation. This is the frequency domain form of the reference signal; The conjugate of the recording signal; To convert the frequency domain results back to the time domain; To prevent extremely small positive numbers with a denominator of 0 from being used in the formula, cross-correlation operations can effectively suppress the influence of environmental noise and highlight the delay information in the recorded signal.
[0022] Specifically, the step of playing a broadband excitation signal using a sound source, recording the sound source using a multi-channel linear microphone array to obtain multi-channel recording data, and performing a first generalized cross-correlation operation on the broadband excitation signal and the multi-channel recording data to obtain a first cross-correlation result includes: constructing a multi-channel linear microphone array using a target number of microphones arranged in a straight line; playing a broadband excitation signal using a sound source; synchronously recording the sound source using the multi-channel linear microphone array to obtain multi-channel recording data; and performing a first generalized cross-correlation operation on the broadband excitation signal and the multi-channel recording data using a generalized cross-correlation algorithm or a generalized cross-correlation-phase transform algorithm to obtain a first cross-correlation result.
[0023] Step S12: Slice the first cross-correlation result to obtain multi-channel slice data; perform a second generalized cross-correlation operation based on the multi-channel slice data to obtain a second cross-correlation result; determine the initial delay value based on the second cross-correlation result and using a quadratic function fitting method; and determine whether the absolute value of the initial delay value is greater than a preset threshold.
[0024] In this embodiment, the position corresponding to the maximum value in the first cross-correlation result of the M / 2 channel is determined as the slice center. The first cross-correlation result of the M channel is sliced using the slice center, and the slice interval is: ;in, The center of the slice, W is the number of channels; W is the length of the segment, i.e., the window length, which is required to... ;in, The distance between adjacent microphones in the linear microphone array; The speed of sound from the sound source in the environment; The sampling rate for recording the linear microphone array; The number of channels is used. After obtaining the multi-channel slice data, the slice data of the first channel and the slice data of the Mth channel are subjected to a second generalized cross-correlation operation to obtain the second cross-correlation result. The index position of the maximum value of the subsampling point precision is obtained by using the quadratic function fitting method, that is, the target index position corresponding to the maximum value in the second cross-correlation result. The initial delay value is determined based on the target index position.
[0025] Specifically, the step of slicing the first cross-correlation result to obtain multi-channel slice data, performing a second generalized cross-correlation operation based on the multi-channel slice data to obtain a second cross-correlation result, and determining an initial delay value based on the second cross-correlation result and using a quadratic function fitting method, includes: determining the position corresponding to the maximum value of the first cross-correlation result in the middle channel of the multi-channel array as the slice center; slicing the first cross-correlation result using the slice center and a preset window length to obtain multi-channel slice data; performing a second generalized cross-correlation operation on the slice data of the first channel and the slice data of the last channel based on the multi-channel slice data to obtain a second cross-correlation result; determining the target index position corresponding to the maximum value in the second cross-correlation result using a quadratic function fitting method, and determining the initial delay value based on the target index position.
[0026] It is understood that the initial delay value is determined to be greater than a preset threshold. This preset threshold is a threshold pre-set by the user and can be adjusted according to actual conditions. If the absolute value of the initial delay value is not greater than the preset threshold, it indicates that the delay difference between all microphones is particularly small. Therefore, the average delay difference is calculated using the following formula: ; in, The average delay difference; Number of channels; The initial delay value is used as the initial delay value. The average delay difference is used as the target delay value. Specifically, after determining whether the absolute value of the initial delay value is greater than a preset threshold, the method further includes: if the absolute value of the initial delay value is not greater than the preset threshold, then determining the target delay value based on the initial delay value, and triggering the step of determining the sound source incident angle based on the target delay value and using the target parameters of the linear microphone array.
[0027] Step S13: If the value is greater than the preset threshold, the multi-channel slice data is upsampled to obtain upsampled slice data. Based on the upsampled slice data, the signal delay relationship of each adjacent channel is modeled using a Thiran all-pass filter to obtain each linear equation. Based on the linear equation, the target filter coefficients are determined using the least squares method. The Thiran all-pass filter is an all-pass filter designed based on the Thiran approximation algorithm.
[0028] In this embodiment, if the initial delay value is greater than the preset threshold, it is further determined whether the initial delay value is negative. If it is negative, it indicates that the sound source is on the other side or behind the linear microphone array, and the multi-channel slice data needs to be time-domain flipped to obtain the flipped slice data. The corresponding formula is as follows: ; in, This refers to the slice data of the Mth channel in the flipped slice data; This represents the slice data of the Mth channel before time-domain flipping; W is the slice length, i.e., the window length. This refers to the time sequence number. In one specific implementation, the multi-channel slice data before flipping can be... The multi-channel slice data before flipping can be Then, the flipped slice data is upsampled by a factor of 2 to obtain upsampled slice data. Where M is the number of channels; W is the slice length; and i is the channel index. The value is the time sequence number; if it is not negative, the multi-channel slice data is directly upsampled to obtain upsampled slice data. The purpose of upsampling is to reduce the estimation error of the Thiran all-pass filter, because the Thiran all-pass filter has a phase error near the Nyquist frequency. By improving the signal time resolution through upsampling, it can operate at a higher equivalent sampling rate, reduce the parameter estimation deviation caused by frequency domain phase nonlinearity, and thus improve the delay estimation accuracy.
[0029] Specifically, determining whether the initial delay value is negative, and upsampling the multi-channel slice data by a target factor based on the determined result to obtain upsampled slice data, includes: determining whether the initial delay value is negative; if the initial delay value is negative, performing time-domain flipping on the multi-channel slice data to obtain flipped slice data, and upsampling the flipped slice data by a target factor to obtain upsampled slice data; if the initial delay value is not negative, upsampling the multi-channel slice data by a target factor to obtain upsampled slice data.
[0030] It is understandable that after obtaining the upsampled slice data, the signal delay relationship between adjacent channels i and i+1 (i=0,1,…M-2) is modeled using a Thiran all-pass filter to obtain the linear equations, the corresponding formulas of which are as follows: ; in, This is the signal of the i-th channel, i.e., the upsampled slice data of the i-th channel; This is the upsampled slice data for the (i+1)th channel; This is the sampling point index, i.e., the time sequence number; Let W be the filter coefficients to be estimated, i.e., the target filter coefficients; and W be the slice length. Then, the linear equations are combined to construct a system of target equations in vector form. ; where vector , They are all column vectors. The target filter coefficients; column vector The elements are , ; Column vector The corresponding element is , ;in, This represents the upsampled slice data for the i-th channel; i is the channel index. Where M is the time sequence number; W is the number of channels; and W is the slice length. The target filter coefficients can be solved using the following formula: ; in, These are the coefficients of the target filter; , Let be the column vector in the objective equation system; For vectors Transpose of; For matrix The inverse matrix of the system is obtained. The delay estimation is transformed into a parameter estimation problem through system identification methods, and the optimal filter coefficients are obtained using the least squares algorithm, laying the foundation for achieving high-precision delay estimation.
[0031] Specifically, if the delay value is greater than the preset threshold, the multi-channel slice data is upsampled to obtain upsampled slice data. Based on the upsampled slice data, the signal delay relationship of each adjacent channel is modeled using a Thiran all-pass filter to obtain linear equations. Based on the linear equations, the target filter coefficients are determined using the least squares method. This includes: if the delay value is greater than the preset threshold, determining whether the initial delay value is negative, and upsampling the multi-channel slice data by a target multiple based on the determination result to obtain upsampled slice data; the target multiple can be adjusted according to actual conditions; modeling the signal delay relationship of each adjacent channel using a Thiran all-pass filter based on the upsampled slice data to obtain linear equations, and simultaneously solving the linear equations to obtain a target equation set; and determining the target filter coefficients based on the target equation set using the least squares method.
[0032] Step S14: Determine the target delay value of each adjacent channel using the target filter coefficients, and determine the sound source incident angle based on the target delay value and the target parameters of the linear microphone array to complete the corresponding sound source orientation operation.
[0033] In this embodiment, after obtaining the target filter coefficients, the target delay value of each adjacent channel is determined using the target filter coefficients, and the corresponding formula is as follows: ; in, The target delay value; The target filter coefficients are defined as follows. Then, based on the target delay value and using the spacing between adjacent microphones in the linear microphone array, the sound velocity of the sound source in the environment, and the sampling rate of the linear microphone array during recording, the sound source incident angle is determined using the following formula: ; in, The incident angle of the sound source; The target delay value; These are the coefficients of the target filter; The sampling rate for recording the linear microphone array; The distance between adjacent microphones in the linear microphone array; The speed of sound of the sound source in the environment. Specifically, determining the sound source incident angle based on the target delay value and using the target parameters of the linear microphone array includes: determining the sound source incident angle based on the target delay value and using the spacing between adjacent microphones of the linear microphone array, the speed of sound of the sound source in the environment, and the sampling rate of the linear microphone array during recording.
[0034] As can be seen from the above, this application acquires multi-channel recording data. The broadband excitation signal can carry more significant time-domain / frequency-domain features, avoiding the problem of ambiguity in delay information of single-frequency signals. Generalized cross-correlation operation performs similarity matching on the broadband excitation signal and the recording data of each channel to obtain the first cross-correlation result. Secondary cross-correlation is performed on the first and last channel data after slicing, and the quadratic function fitting method is combined to overcome the limitation of integer sampling points, realizing the initial coarse estimation of delay at the sub-sampling point level. Then, the multi-channel sliced data is upsampled to improve the signal time resolution. The delay relationship of each adjacent channel signal is modeled using a Thiran all-pass filter, transforming the traditional direct delay estimation problem into a parameter estimation problem. The least squares method is used to solve the simultaneous linear equations to obtain the optimal target filter coefficients. In this way, the target filter parameters are used to determine the high-precision target delay value of each adjacent channel, and the target delay value is converted into the sound source incident angle by combining the target parameters of the linear microphone array, realizing high-precision sound source localization at the oversampling level, meeting the needs of high-precision positioning scenarios.
[0035] As can be seen from the above embodiments, this application transforms the direct delay estimation problem into a parameter estimation problem based on the Thiran all-pass filter to achieve high-precision sound source localization. Therefore, the process of transforming the direct delay estimation problem into a parameter estimation problem based on the Thiran all-pass filter is described.
[0036] See Figure 2 As shown, this embodiment of the invention discloses a specific sound source localization method based on an all-pass filter, including: In this embodiment, a multi-channel linear microphone array is constructed using multiple microphones arranged in a straight line. A broadband excitation signal is played using a sound source, and synchronous recording is performed on the sound source based on the linear microphone array to obtain multi-channel recording data. A first generalized cross-correlation operation is performed on the broadband excitation signal and the multi-channel recording data using a generalized cross-correlation algorithm or a generalized cross-correlation-phase transform algorithm to obtain a first cross-correlation result. The position corresponding to the maximum value in the first cross-correlation result of the middle channel is determined as the slice center. The first cross-correlation result of the M channel is sliced using the slice center to obtain multi-channel slice data. A second generalized cross-correlation operation is performed on the slice data of the first channel and the slice data of the last channel to obtain a second cross-correlation result. The target index position corresponding to the maximum value in the second cross-correlation result is determined using a quadratic function fitting method, and an initial delay value is determined based on the target index position.
[0037] Understandably, the initial delay value is determined to be greater than a preset threshold. The preset threshold is a threshold pre-set by the user and can also be adjusted according to the actual situation. If the absolute value of the initial delay value is not greater than the preset threshold, it indicates that the delay difference between all microphones is particularly small, and the average delay difference is used as the target delay value. If it is greater than the preset threshold, the initial delay value is further determined to be negative. If it is negative, the multi-channel slice data is time-domain flipped to obtain flipped slice data, and the flipped slice data is upsampled by 2 times to obtain upsampled slice data. If it is not negative, the multi-channel slice data is upsampled to obtain upsampled slice data.
[0038] Furthermore, after obtaining the upsampled slice data, the signal delay relationship between adjacent channels is modeled using a Thiran all-pass filter to obtain linear equations. These linear equations are then combined to construct a vector-form target equation set. Based on this target equation set, the target filter coefficients are determined using the least squares method. The target delay values for each adjacent channel are then determined using these target delay values. Finally, the sound source incident angle is determined based on the target delay values, the spacing between adjacent microphones in the linear microphone array, the sound velocity of the sound source in the environment, and the sampling rate of the linear microphone array during recording, thereby completing the sound source localization operation. This solution can run on a general-purpose CPU, DSP (Digital Signal Processor), or FPGA (Field Programmable Gate Array), providing a parameter configuration interface to set the upsampling factor, sound velocity, microphone spacing, number of channels, etc.
[0039] As can be seen from the above, this application performs generalized cross-correlation calculations on multi-channel recording data to obtain the first cross-correlation result, performs secondary cross-correlation on the first and last channel data after slicing, and combines the quadratic function fitting method to perform initial delay coarse estimation; upsamples the multi-channel sliced data, and uses the Thiran all-pass filter to model the delay relationship of each adjacent channel signal to obtain a linear equation, uses the least squares method to solve the simultaneous linear equation to obtain the target filter coefficients, uses the target filter parameters to determine the high-precision target delay value of each adjacent channel, and combines the target parameters of the linear microphone array to determine the sound source incident angle by the target delay value, thereby improving the accuracy of sound source localization of the microphone array.
[0040] Accordingly, see Figure 3 As shown, this application also provides a sound source directional device based on an all-pass filter, comprising: The cross-correlation operation module 11 is used to play a broadband excitation signal using a sound source, record the sound source based on a multi-channel linear microphone array to obtain multi-channel recording data, and perform a first generalized cross-correlation operation on the broadband excitation signal and the multi-channel recording data to obtain a first cross-correlation result; the first cross-correlation result is a cross-correlation result that corresponds one-to-one with each channel; The initial delay value determination module 12 is used to slice the first cross-correlation result to obtain multi-channel slice data, perform a second generalized cross-correlation operation based on the multi-channel slice data to obtain a second cross-correlation result, determine the initial delay value based on the second cross-correlation result and using a quadratic function fitting method, and determine whether the absolute value of the initial delay value is greater than a preset threshold. The target coefficient determination module 13 is used to upsample the multi-channel slice data if the target coefficient is greater than the preset threshold, to obtain upsampled slice data, to model the signal delay relationship of each adjacent channel based on the upsampled slice data and using a Thiran all-pass filter to obtain each linear equation, and to determine the target filter coefficients based on the linear equations and using the least squares method; the Thiran all-pass filter is an all-pass filter designed based on the Thiran approximation algorithm. The incident angle determination module 14 is used to determine the target delay value of each adjacent channel using the target filter coefficients, and to determine the sound source incident angle based on the target delay value and the target parameters of the linear microphone array, so as to complete the corresponding sound source orientation operation.
[0041] In some specific embodiments, the cross-correlation calculation module 11 may specifically include: The sound source recording unit is used to construct a multi-channel linear microphone array using a target number of microphones arranged in a straight line, play a broadband excitation signal using a sound source, and synchronously record the sound source based on the multi-channel linear microphone array to obtain multi-channel recording data. The first cross-correlation operation unit is used to perform a first generalized cross-correlation operation on the broadband excitation signal and the multi-channel recording data using a generalized cross-correlation algorithm or a generalized cross-correlation-phase transformation algorithm to obtain a first cross-correlation result.
[0042] In some specific embodiments, the initial delay value determination module 12 may specifically include: The slice center determination unit is used to determine the position corresponding to the maximum value of the first cross-correlation result of the middle channel in the multi-channel as the slice center based on the first cross-correlation result; The first result slicing unit is used to slice the first cross-correlation result using the slice center and a preset window length to obtain multi-channel slice data; The second cross-correlation operation unit is used to perform a second generalized cross-correlation operation on the slice data of the first channel and the slice data of the last channel based on the multi-channel slice data to obtain the second cross-correlation result. The initial delay value determination unit is used to determine the target index position corresponding to the maximum value in the second cross-correlation result using a quadratic function fitting method, and to determine the initial delay value based on the target index position.
[0043] In some specific embodiments, the sound source directional device based on the all-pass filter may further include: The target delay value determination unit is used to determine a target delay value based on the initial delay value if the absolute value of the initial delay value is not greater than a preset threshold, and to trigger the step of determining the sound source incident angle based on the target delay value and using the target parameters of the linear microphone array.
[0044] In some specific embodiments, the target coefficient determination module 13 may specifically include: The delay value judgment submodule is used to determine whether the initial delay value is negative if it is greater than the preset threshold, and to upsample the multi-channel slice data by a target multiple based on the judgment result to obtain upsampled slice data. The thread equation fusion unit is used to model the signal delay relationship of each adjacent channel based on the upsampled slice data and using the Thiran all-pass filter to obtain each linear equation, and to fuse each of the linear equations to obtain the target equation set. The target filter coefficients are determined based on the target equation set and using the least squares method.
[0045] In some specific implementations, the delay value determination submodule may specifically include: The delay value determination unit is used to determine whether the initial delay value is negative; The slice data flipping unit is used to flip the multi-channel slice data in the time domain if the initial delay value is negative, so as to obtain the flipped slice data, and to upsample the flipped slice data by a target multiple to obtain the upsampled slice data. The slice data upsampling unit is used to upsample the multi-channel slice data by a target multiple if the initial delay value is not negative, so as to obtain upsampled slice data.
[0046] In some specific embodiments, the incident angle determination module 14 may specifically include: An incident angle determination unit is used to determine the incident angle of the sound source based on the target delay value and by utilizing the spacing between adjacent microphones of the linear microphone array, the sound speed of the sound source in the environment, and the sampling rate of the linear microphone array during recording.
[0047] Furthermore, embodiments of this application also disclose an electronic device, Figure 4 This 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 an all-pass filter disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be a computer.
[0048] 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.
[0049] 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.
[0050] 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 direction finding method based on an all-pass filter as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0051] 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 an all-pass filter. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0052] 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.
[0053] 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.
[0054] 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.
[0055] 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.
[0056] 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 an all-pass filter, characterized in that, include: A broadband excitation signal is played using a sound source, and the sound source is recorded using a multi-channel linear microphone array to obtain multi-channel recording data. A first generalized cross-correlation operation is performed on the broadband excitation signal and the multi-channel recording data to obtain a first cross-correlation result. The first cross-correlation result is a cross-correlation result that corresponds one-to-one with each channel. The first cross-correlation result is sliced to obtain multi-channel slice data. A second generalized cross-correlation operation is performed based on the multi-channel slice data to obtain a second cross-correlation result. Based on the second cross-correlation result, an initial delay value is determined using a quadratic function fitting method, and it is determined whether the absolute value of the initial delay value is greater than a preset threshold. If the value is greater than the preset threshold, the multi-channel slice data is upsampled to obtain upsampled slice data. Based on the upsampled slice data, the signal delay relationship between each adjacent channel is modeled using a Thiran all-pass filter to obtain linear equations. Based on the linear equations, the target filter coefficients are determined using the least squares method. The Thiran all-pass filter is an all-pass filter designed based on the Thiran approximation algorithm. The target delay value of each adjacent channel is determined using the target filter coefficients. Based on the target delay value and the target parameters of the linear microphone array, the sound source incident angle is determined to complete the corresponding sound source orientation operation.
2. The sound source localization method based on an all-pass filter according to claim 1, characterized in that, The process of playing a broadband excitation signal from a sound source, recording the sound source using a multi-channel linear microphone array to obtain multi-channel recording data, and performing a first generalized cross-correlation operation on the broadband excitation signal and the multi-channel recording data to obtain a first cross-correlation result includes: A multi-channel linear microphone array is constructed using a target number of microphones arranged in a straight line. A broadband excitation signal is played using a sound source, and the sound source is synchronously recorded based on the multi-channel linear microphone array to obtain multi-channel recording data. The broadband excitation signal and the multi-channel recording data are subjected to a first generalized cross-correlation operation using a generalized cross-correlation algorithm or a generalized cross-correlation-phase transformation algorithm to obtain a first cross-correlation result.
3. The sound source localization method based on an all-pass filter according to claim 1, characterized in that, The step of slicing the first cross-correlation result to obtain multi-channel slice data, performing a second generalized cross-correlation operation based on the multi-channel slice data to obtain a second cross-correlation result, and determining the initial delay value based on the second cross-correlation result using a quadratic function fitting method includes: Based on the first cross-correlation result, the position corresponding to the maximum value of the first cross-correlation result of the middle channel in the multi-channel is determined as the slice center; The first cross-correlation result is sliced using the slice center and a preset window length to obtain multi-channel slice data; Based on the multi-channel slice data, a second generalized cross-correlation operation is performed on the slice data of the first channel and the slice data of the last channel to obtain the second cross-correlation result; The target index position corresponding to the maximum value in the second cross-correlation result is determined using a quadratic function fitting method, and the initial delay value is determined based on the target index position.
4. The sound source localization method based on an all-pass filter according to claim 1, characterized in that, After determining whether the absolute value of the initial delay value is greater than a preset threshold, the method further includes: If the absolute value of the initial delay value is not greater than a preset threshold, then a target delay value is determined based on the initial delay value, and the step of determining the sound source incident angle based on the target delay value and using the target parameters of the linear microphone array is triggered.
5. The sound source localization method based on an all-pass filter according to claim 1, characterized in that, If the value is greater than the preset threshold, the multi-channel slice data is upsampled to obtain upsampled slice data. Based on the upsampled slice data, the signal delay relationship between adjacent channels is modeled using a Thiran all-pass filter to obtain linear equations. Based on the linear equations, the target filter coefficients are determined using the least squares method, including: If the value is greater than the preset threshold, it is determined whether the initial delay value is negative, and the multi-channel slice data is upsampled by a target multiple based on the determination result to obtain upsampled slice data. Based on the upsampled slice data and using the Thiran all-pass filter, the signal delay relationship of each adjacent channel is modeled to obtain each linear equation, and the linear equations are combined to obtain the target equation set. The target filter coefficients are determined based on the target equation set and using the least squares method.
6. The sound source localization method based on an all-pass filter according to claim 5, characterized in that, The step of determining whether the initial delay value is negative, and then upsampling the multi-channel slice data by a target factor based on the determined result to obtain upsampled slice data, includes: Determine whether the initial delay value is negative; If the initial delay value is negative, the multi-channel slice data is flipped in the time domain to obtain flipped slice data, and the flipped slice data is upsampled by a target multiple to obtain upsampled slice data. If the initial delay value is not negative, the multi-channel slice data is upsampled by a target factor to obtain upsampled slice data.
7. The sound source localization method based on an all-pass filter according to any one of claims 1 to 6, characterized in that, The step of determining the sound source incident angle based on the target delay value and using the target parameters of the linear microphone array includes: The sound source incident angle is determined based on the target delay value and using the spacing between adjacent microphones of the linear microphone array, the sound speed of the sound source in the environment, and the sampling rate of the linear microphone array during recording.
8. A sound source directional device based on an all-pass filter, characterized in that, include: The cross-correlation operation module is used to play a broadband excitation signal using a sound source, record the sound source based on a multi-channel linear microphone array to obtain multi-channel recording data, and perform a first generalized cross-correlation operation on the broadband excitation signal and the multi-channel recording data to obtain a first cross-correlation result; the first cross-correlation result is a cross-correlation result that corresponds one-to-one with each channel; The initial delay value determination module is used to slice the first cross-correlation result to obtain multi-channel slice data, perform a second generalized cross-correlation operation based on the multi-channel slice data to obtain a second cross-correlation result, determine the initial delay value based on the second cross-correlation result and using a quadratic function fitting method, and determine whether the absolute value of the initial delay value is greater than a preset threshold. The target coefficient determination module is used to upsample the multi-channel slice data if the target coefficient is greater than the preset threshold, to obtain upsampled slice data, to model the signal delay relationship of each adjacent channel based on the upsampled slice data and using a Thiran all-pass filter to obtain linear equations, and to determine the target filter coefficients based on the linear equations and using the least squares method; the Thiran all-pass filter is an all-pass filter designed based on the Thiran approximation algorithm. An incident angle determination module is used to determine the target delay value of each adjacent channel using the target filter coefficients, and to determine the sound source incident angle based on the target delay value and the target parameters of the linear microphone array, so as to complete the corresponding sound source orientation operation.
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 an all-pass filter as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the sound source localization method based on an all-pass filter as described in any one of claims 1 to 7.