Audio screening method, apparatus, computing device, storage medium, and program product
Patent Information
- Application Number
- CN202611102615.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-10-16
AI Technical Summary
[0002]在近远场音频筛选领域,传统方案通常基于直达声与混响声的能量比进行分类判断,然而该能量比同时受声源距离和房间混响特性两个因素影响,当房间混响较强时,即使声源距离较近,该能量比也会偏低,导致与远场音频的取值区域产生重叠,仅凭该能量比无法区分是距离因素还是混响因素导致的比值下降,从而产生误判
[0010]本说明书一个实施例通过从脉冲响应序列中分别确定直达混响比和早期能量比,其中直达混响比基于设定校正窗时间对应的区间计算,早期能量比基于设定早期时间上限对应的区间计算,两个能量比分别反映不同时间尺度上的声能分布特征,通过联合两个能量比确定近远场筛选结果,在单一能量比无法准确分类时提供额外的判别依据,从而提高近远场音频筛选的准确性。
Smart Images

Figure CN122930102A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of audio filtering technology, and in particular to an audio filtering method, apparatus, computing device, storage medium, and program product. Background Technology
[0002] In the field of near-field and far-field audio screening, traditional methods usually classify and judge based on the energy ratio of direct sound to reverberant sound. However, this energy ratio is affected by two factors: the distance of the sound source and the reverberation characteristics of the room. When the room reverberation is strong, even if the sound source is close, the energy ratio will be low, causing it to overlap with the value range of far-field audio. Based solely on this energy ratio, it is impossible to distinguish whether the decrease in the ratio is caused by distance factors or reverberation factors, thus leading to misjudgment.
[0003] Therefore, there is an urgent need for a method to improve the accuracy of screening in near-field and far-field audio. Summary of the Invention
[0004] In view of this, embodiments of this specification provide an audio filtering method. One or more embodiments of this specification also relate to an audio filtering device, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.
[0005] According to a first aspect of the embodiments of this specification, an audio filtering method is provided, comprising: Acquire the audio to be filtered, determine the impulse response sequence of the audio to be filtered, and determine the location of the direct sound in the impulse response sequence; The direct reverberation ratio is determined based on the set correction window time, direct sound location, and impulse response sequence; The early energy ratio is determined based on the set early time limit, direct sound location, and impulse response sequence; The near-field and far-field screening results of the audio to be screened are determined based on the direct reverberation ratio and the early energy ratio.
[0006] According to a second aspect of the embodiments of this specification, an audio filtering device is provided, comprising: The acquisition module is configured to acquire the audio to be filtered, determine the impulse response sequence of the audio to be filtered, and determine the location of the direct sound in the impulse response sequence; The first determining module is configured to determine the direct reverberation ratio based on a set correction window time, the location of the direct sound, and the impulse response sequence. The second determining module is configured to determine the early energy ratio based on a set early time upper limit, the direct sound location, and the impulse response sequence. The filtering module is configured to determine the near-field and far-field filtering results of the audio to be filtered based on the direct reverberation ratio and the early energy ratio.
[0007] According to a third aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the above-described audio filtering method.
[0008] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions that, when executed by a processor, implement the steps of the audio filtering method described above.
[0009] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the audio filtering method described above.
[0010] One embodiment of this specification determines the direct reverberation ratio and the early energy ratio from the impulse response sequence, wherein the direct reverberation ratio is calculated based on the interval corresponding to the set correction window time, and the early energy ratio is calculated based on the interval corresponding to the set early time upper limit. The two energy ratios reflect the sound energy distribution characteristics at different time scales. By combining the two energy ratios to determine the near-field and far-field screening results, additional discrimination criteria are provided when a single energy ratio cannot accurately classify the audio, thereby improving the accuracy of near-field and far-field audio screening. Attached Figure Description
[0011] Figure 1 This is a flowchart of an audio filtering method provided in one embodiment of this specification; Figure 2 This is a schematic diagram of the structure of an audio filtering device provided in one embodiment of this specification; Figure 3 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0012] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0013] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0014] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0015] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0016] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0017] RIR (Room Impulse Response): Room impulse response, which is the acoustic transfer function between the sound source and the receiver, describes the reflection, reverberation, and attenuation characteristics of sound in an enclosed space.
[0018] CTE (Clarity-to-Total Energy Ratio): The ratio of early reverberation energy to total reverberation energy, used to measure the impact of reverberation on speech intelligibility. A higher ratio indicates that early reflections are dominant.
[0019] EDT (Early Decay Time): The early decay time refers to the time required for the sound pressure level to decay by 10 dB from its initial value multiplied by 6. It reflects the decay rate in the early stage of reverberation and is often related to the subjective perception of reverberation.
[0020] DRR (Direct-to-Reverberant Ratio): The ratio of direct sound energy to reverberant sound energy. The higher the value, the higher the proportion of direct sound and the clearer the sense of space. It is an important indicator for evaluating the acoustic quality of a room.
[0021] RT (Reverberation Time): Reverberation time, usually referring to RT60, which is the time required for the sound pressure level to decay by 60dB. It is used to quantify the degree of spatial reverberation and affects speech intelligibility and musical fullness.
[0022] PIM algorithm: an iterative method for parameter estimation in audio or signal processing that optimizes model parameters through impulse response measurement and is often used for acoustic identification.
[0023] Near field and far field: The division of the sound field into regions closer to the sound source (near field, where sound pressure changes drastically with distance) and regions farther away (far field, where sound pressure attenuates approximately like a spherical wave), affecting microphone placement and acoustic measurements. This specification provides an audio filtering method, and also relates to an audio filtering device, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail in the following embodiments.
[0024] See Figure 1 , Figure 1 This is a flowchart of an audio filtering method provided in one embodiment of this specification, which specifically includes the following steps.
[0025] Step 102: Obtain the audio to be filtered, determine the impulse response sequence of the audio to be filtered, and determine the location of the direct sound in the impulse response sequence; The audio to be screened is audio signal data that requires near-field or far-field filtering. As input for acoustic analysis, its impulse response sequence is extracted and acoustic characteristic parameters are calculated to determine whether the audio was acquired in the near-field or far-field environment, thus providing a basis for subsequent audio processing or filtering. For example, the audio to be screened could be a speech signal acquired in a conference room environment using a single microphone; or it could be an audio clip recorded in an open outdoor environment using a mobile device.
[0026] An impulse response sequence is a series of time-sampled data points that describe the characteristics of sound propagation from a sound source to a receiving location. It reflects the temporal characteristics of sound waves after reflection from walls, objects, etc., during propagation. It includes information such as direct sound, early reflections, and reverberation, and serves as the fundamental data for extracting various acoustic characteristic parameters. For example, an impulse response sequence can be a time-domain signal sequence containing thousands of sampling points, where the earliest arriving peak corresponds to the direct sound, and subsequent gradually decaying sequences correspond to reflected and reverberated sounds. Alternatively, an impulse response sequence can be normalized time-domain waveform data, where each sampling point represents the sound wave energy or amplitude arriving at that time point.
[0027] The direct sound location is the time sampling point position corresponding to the direct sound signal in the impulse response sequence. It serves as the time reference point for subsequent calculations of various acoustic characteristic parameters. The direct sound is the signal that travels directly from the sound source to the receiving position without any reflection, and in the impulse response sequence, it is typically represented by the first significant energy peak. For example, the direct sound location can be the sampling point index corresponding to the first peak with the largest amplitude in the impulse response sequence; alternatively, the direct sound location can also be the starting sampling point position of the direct sound automatically identified through energy threshold detection or peak detection algorithms.
[0028] The process involves acquiring the audio to be filtered, determining the impulse response sequence of the audio to be filtered, and identifying the location of the direct sound in the impulse response sequence. Specifically, this can be achieved by extracting the impulse response sequence that characterizes the sound transmission characteristics from the audio data to be filtered, and then analyzing and processing the sequence to locate the position of the direct sound signal in the sequence.
[0029] It should be noted that the impulse response sequence of the audio to be filtered can also be obtained directly, thus saving the process of determining the impulse response sequence of the audio to be filtered.
[0030] One optional implementation involves extracting a transfer function characterizing the environmental influence on sound transmission from the audio to be screened, and then converting the transfer function from the frequency domain to the time domain to obtain an impulse response sequence. The transfer function can be obtained by deconvolving a known excitation signal and a received signal from the audio to be screened. The frequency domain transfer function is then converted to the time domain using an inverse Fourier transform to obtain the impulse response sequence. For example, a swept-frequency signal with a known spectrum can be played as an excitation in a closed room. After receiving the signal with a microphone, the received signal and the original excitation signal are deconvolved in the frequency domain to obtain the transfer function. Then, an inverse Fourier transform is used to convert the transfer function into a time-domain impulse response sequence.
[0031] One optional implementation involves searching for the first energy peak in the impulse response sequence using a peak detection algorithm after obtaining the sequence. The location of this peak is considered the direct sound location. If multiple peaks exist in the impulse response sequence, the first significant peak typically corresponds to the direct sound, while subsequent peaks correspond to early reflections and reverberation. For example, by traversing the sampling points of the impulse response sequence and calculating the absolute amplitude of each sampling point, when the amplitude of a sampling point exceeds a preset energy threshold and is a local maximum within its neighborhood, the index of that sampling point is determined as the direct sound location.
[0032] In one implementation of this specification, a near-field / far-field screening scenario for conference audio is applied. A segment of audio signal acquired using a single microphone in a conference room environment is used as the audio to be screened. The transfer function is extracted from this audio, and a frequency domain transfer function is obtained through deconvolution. This is then converted into a time-domain impulse response sequence containing 4096 sampling points using an inverse Fourier transform. A peak detection algorithm is used to search for energy peaks within the impulse response sequence. The first significant energy peak is detected at the 256th sampling point, and this sampling point index 256 is determined as the direct sound location. This direct sound location will serve as the time reference point for subsequent calculations of acoustic characteristic parameters such as direct reverberation ratio and early energy ratio.
[0033] By acquiring the impulse response sequence of the audio to be screened and determining the direct sound location, the temporal transmission characteristics of the audio are transformed into sequence data that can be quantified and analyzed. The direct sound location provides a unified time reference for the subsequent calculation of various acoustic feature parameters, enabling the calculation of indicators such as direct reverberation ratio and early energy ratio to be based on the accurate arrival time of the direct sound, thereby improving the accuracy and reliability of acoustic feature parameter extraction.
[0034] In one optional embodiment of this specification, acquiring the audio to be filtered and determining the impulse response sequence of the audio to be filtered includes: Extract the transfer function representing the influence of the environment on sound transmission from the audio samples to be screened; The transfer function is transformed from the frequency domain to the time domain to obtain the impulse response sequence.
[0035] The transfer function is a frequency-domain mathematical function that characterizes the influence of the environment on sound waves during their propagation from the sound source to the receiver. It describes the frequency domain transformation relationship between the received and source signals after factors such as wall reflection, object obstruction, and air absorption during sound wave propagation. It serves as an intermediate representation for extracting impulse response sequences from audio samples to be filtered. For example, the transfer function can be obtained by performing frequency-domain deconvolution on the received signal and a known excitation signal; its amplitude spectrum reflects the attenuation degree of each frequency component, and its phase spectrum reflects the time delay characteristics of each frequency component. Alternatively, the transfer function can also be a function calculated in acoustic measurements using a swept-frequency signal or a maximum-length sequence signal as excitation.
[0036] The frequency-domain to time-domain conversion is the process of transforming a transfer function represented in the frequency domain into a pulse response sequence represented in the time domain through mathematical transformation. This process makes the implicit time-domain reflection and attenuation information in the transfer function explicit, resulting in sequence data that can be directly analyzed at specific times and calculated for energy. For example, the frequency-domain to time-domain conversion can be achieved through the inverse Fourier transform, converting the complex values of the transfer function at each frequency point into amplitude values at each time sampling point. Alternatively, the frequency-domain to time-domain conversion can also be achieved through the inverse discrete Fourier transform or other time-frequency domain transformation methods.
[0037] Extracting the transfer function that characterizes the influence of the environment on sound transmission from the audio to be screened can be achieved by using the known excitation signal and the corresponding received signal contained in the audio to be screened, and calculating the response between the two in the frequency domain through deconvolution operation to obtain the transfer function.
[0038] One optional implementation involves playing a sweep signal or pulse signal with known spectral characteristics as an excitation when acquiring the audio to be screened. A microphone is used to receive the response signal after the signal has propagated through the environment. The received signal and the original excitation signal are then deconvolved in the frequency domain to obtain the transfer function. For example, the Fourier transform of the received signal is divided by the Fourier transform of the excitation signal to obtain the amplitude ratio and phase difference at each frequency point. This amplitude and phase information in the frequency domain constitutes the transfer function.
[0039] The transfer function is transformed from the frequency domain to the time domain to obtain the impulse response sequence. Specifically, this can be achieved by applying an inverse Fourier transform to the transfer function represented in the frequency domain, converting the complex response values at each frequency point into real amplitude values at each time sampling point, thus forming the impulse response sequence in the time domain.
[0040] One possible implementation involves performing an inverse discrete Fourier transform on the transfer function to obtain a time-domain impulse response sequence with the same number of frequency sampling points as the transfer function. Each sampling point in the sequence represents the sound wave energy or amplitude arriving at the receiving position at that time point. For example, if the transfer function defines complex response values at 512 frequency points, an impulse response sequence with 512 time-domain sampling points is obtained after the inverse Fourier transform. The earliest significant peak in the sequence corresponds to the direct sound, and the subsequent gradually decaying sequences correspond to reflected sound and reverberation.
[0041] One alternative implementation involves converting the convolutional transfer function into a time-domain room impulse response sequence using the PIM algorithm. The PIM algorithm utilizes the phase and amplitude information of the transfer function in the frequency domain and generates a time-domain impulse response sampling sequence h(n) using inverse Fourier transform or other time-frequency conversion methods. The sequence has a length of N sampling points, with each sampling point corresponding to the sound pressure amplitude arriving at the receiver at that time.
[0042] In one implementation of this specification, a near-field / far-field screening scenario for conference audio is described. A segment of audio signal collected in a conference room environment is acquired as the audio to be screened. During recording, a frequency-sweep signal with a known spectrum is used as the excitation source. The received signal is extracted from the audio to be screened. The Fourier transform of the received signal is deconvolved with the Fourier transform of the original excitation signal in the frequency domain to obtain a transfer function containing complex response values at 512 frequency points. An inverse discrete Fourier transform is applied to the transfer function, converting the 512 complex response values in the frequency domain into 512 sampling points in the time domain, resulting in an impulse response sequence. The first significant energy peak appears at the 80th sampling point in the sequence, corresponding to the arrival time of the direct sound; the amplitude of subsequent sampling points generally shows a gradually decreasing trend, corresponding to early reflections and reverberation.
[0043] By extracting the transfer function from the audio to be screened and converting it from the frequency domain to the time domain to obtain the impulse response sequence, the frequency domain characteristics of sound wave propagation in the environment are transformed into a time domain sequence that can be directly analyzed for time location and energy calculation. This provides an accurate time domain data foundation for subsequent determination of the direct sound location, calculation of acoustic characteristic parameters such as direct reverberation ratio and early energy ratio.
[0044] Step 104: Determine the direct reverberation ratio based on the set correction window time, direct sound location, and impulse response sequence; The calibration window time is a parameter used to define the time interval for calculating direct sound energy. It delineates a time window in the impulse response sequence, starting from the location of the direct sound, and extracts the signal energy within this window as the direct sound energy, ensuring that the calculation range of the direct sound energy matches the duration of the direct sound in the actual acoustic scenario. For example, the calibration window time can be set to 5 milliseconds, meaning that the signal within a 5-millisecond time range starting from the location of the direct sound is included in the direct sound energy calculation interval. Alternatively, the calibration window time can be set to different durations such as 3 milliseconds or 8 milliseconds, depending on acoustic measurement standards or empirical values.
[0045] The direct reverberation interval is a time range within an impulse response sequence determined by the direct sound location and a set correction window time, used to extract direct sound energy. The direct reverberation interval precisely defines the time period within the impulse response sequence that belongs to the direct sound signal, distinguishing it from subsequent reflected and reverberant sounds. For example, if the time corresponding to the direct sound location is 10 milliseconds and the set correction window time is 5 milliseconds, then the direct reverberation interval is the range of sampling points between 10 and 15 milliseconds. For example, the starting point of the direct reverberation interval is the direct sound location, and the ending point is the direct sound location plus the sampling point corresponding to the set correction window time.
[0046] Direct sound energy is the sum or average of the energy at each sampling point within the direct reverberation interval of an impulse response sequence. It characterizes the sound energy of a sound wave that travels directly from the sound source to the receiving position without any reflection, and is the numerator in calculating the direct reverberation ratio. For example, direct sound energy can be obtained by summing the squares of the amplitudes at each sampling point within the direct reverberation interval; alternatively, it can be obtained by summing the absolute values of the amplitudes at each sampling point within the interval; or, for example, it can be the sum of the squares of the amplitudes at all sampling points within the direct reverberation interval of the impulse response sequence. Direct sound energy characterizes the signal strength of the sound emitted from the sound source reaching the receiving end via a direct path, and is the numerator in calculating the direct reverberation ratio. For example, it is the cumulative sum of h²(n) within the direct reverberation interval, where n ranges from t0-c to t0+c.
[0047] The first reverberation energy is the sum or average of the energy of each sampling point within the time range from the end of the direct reverberation interval to the end of the impulse response sequence. It is used to characterize the total reverberant sound energy of the sound wave reaching the receiving position after environmental reflection and scattering, and is the denominator term in calculating the direct-to-reverberation ratio. For example, the first reverberation energy can be obtained by summing the squares of the amplitudes of all sampling points from the end of the direct reverberation interval to the end of the impulse response sequence; for example, the first reverberation energy can be the sum of the squares of the amplitudes of all sampling points from the end of the direct reverberation interval to the end of the sequence, characterizing the reverberation signal intensity of the sound emitted by the sound source after multiple reflections from walls, ceilings, and other reflective surfaces, and is the denominator term in calculating the direct-to-reverberation ratio, such as h²(n) being the cumulative sum from the end of the direct reverberation interval to the end of the sequence, where n ranges from t0+c+1 to N-1.
[0048] The direct-to-reverberation ratio (DRR) is the ratio of direct sound energy to the first reverberation energy. It quantifies the energy contrast between direct and reverberant sound and is one of the core acoustic indicators for determining whether an audio recording scene is in the near or far field. For example, the DR can be expressed in decibels (dB). A higher DR indicates a stronger direct sound relative to the reverberation, meaning the sound source is closer to the receiver and tends to be near-field; a lower DR indicates that the reverberation is more dominant, meaning the sound source is farther from the receiver and tends to be far-field.
[0049] The direct reverberation ratio is determined based on the set correction window time, the direct sound location, and the impulse response sequence. Specifically, it can be done by taking the direct sound location as the starting point, the set correction window time as the window length, defining the direct reverberation interval in the impulse response sequence, extracting the signal energy within this interval as the direct sound energy, and then extracting the signal energy from the direct reverberation interval to the end of the impulse response sequence as the first reverberation energy. The ratio of the two is then calculated to obtain the direct reverberation ratio.
[0050] One optional implementation involves first determining the starting and ending sampling points of the direct reverberation interval based on the sampling point index corresponding to the direct sound location and the number of sampling points corresponding to the set correction window time. Then, iterating through each sampling point within this interval in the impulse response sequence, the amplitude of each sampling point is squared and summed or averaged to obtain the direct sound energy. Next, starting from the position after the ending sampling point of the direct reverberation interval, iterating to the end of the impulse response sequence, similarly squared and summed or averaged the amplitude of each sampling point to obtain the first reverberation energy. Finally, the direct sound energy is divided by the first reverberation energy to obtain the direct reverberation ratio, which can be further converted to decibels for expression. For example, if the direct sound energy is 0.8 and the first reverberation energy is 0.2, the direct reverberation ratio is 4, which is approximately 12 decibels.
[0051] By determining the direct reverberation interval in the impulse response sequence based on the set correction window time and direct sound position, and extracting the direct sound energy and the first reverberation energy to calculate the direct reverberation ratio, the precise quantification of the comparison relationship between direct sound and reverberation sound energy is achieved, improving the accuracy of the direct reverberation ratio calculation and providing a reliable acoustic basis for near-field and far-field screening.
[0052] In one optional embodiment of this specification, the direct reverberation ratio is determined based on a set correction window time, the location of the direct sound, and an impulse response sequence, including: Based on the location of the direct sound and the set correction window time, determine the direct reverberation range corresponding to the direct sound energy; Extract the direct sound energy within the direct reverberation range from the impulse response sequence; Extract the first reverberation energy from the point directly reaching the reverberation range to the end of the impulse response sequence; The direct reverberation ratio is calculated based on the direct sound energy and the first reverberation energy.
[0053] Based on the location of the direct sound and the set correction window time, the direct reverberation interval corresponding to the direct sound energy is determined. Specifically, it can be that the sampling point index corresponding to the location of the direct sound in the impulse response sequence is used as the starting point of the interval, the number of sampling points converted according to the sampling rate based on the set correction window time is used as the length of the interval, the termination point of the interval is calculated, and the range of continuous sampling points between the starting sampling point and the termination sampling point is determined as the direct reverberation interval.
[0054] For example, taking the direct sound position t0 as the center, the number of correction sampling points c is obtained by multiplying the set correction window time by the sampling rate and rounding it. Then, c sampling points are extended forward and backward to obtain the direct reverberation interval [t0-c, t0+c].
[0055] For example, the correction window time is set to 2.5 milliseconds, multiplied by the sampling rate and rounded to obtain the number of correction sampling points c. The direct reverberation interval covers the time range of c sampling points before and after the direct sound pulse. This interval contains the main energy part of the direct sound.
[0056] Extracting direct sound energy from the direct reverberation interval of an impulse response sequence can be achieved by iterating through each sampling point in the impulse response sequence within the direct reverberation interval, squaring the amplitude value of each sampling point, summing the sums, and then using the summation result or the summation result divided by the average number of sampling points as the direct sound energy.
[0057] For example, the operation involves iterating through all sampling points within the direct reverberation interval of the impulse response sequence, calculating the square of the amplitude at each sampling point, and summing all the squares to obtain the direct sound energy. The direct sound energy E_direct is the sum of the squares of the amplitudes at each sampling point of the impulse response sequence h(n) within the range n from t0-c to t0+c, i.e., E_direct=Σh²(n), n∈[t0-c, t0+c].
[0058] Extracting the first reverberation energy from the end of the impulse response sequence after reaching the reverberation interval can be achieved by starting from the next position after the end sampling point of the reverberation interval, traversing to the end of the impulse response sequence, squaring the amplitude values of each sampling point and summing them, and then using the summed result or the summed result divided by the average number of sampling points as the first reverberation energy.
[0059] For example, starting from the next sampling point after reaching the reverberation interval, traversing to the end of the impulse response sequence N-1, calculating the square of the amplitude of each sampling point within this range and summing them up, yields the first reverberation energy. The first reverberation energy E_reverb is the sum of the squares of the amplitudes of each sampling point in the impulse response sequence h(n) within the range n from t0+c+1 to N-1, i.e., E_reverb=Σh²(n), n∈[t0+c+1, N-1].
[0060] The direct reverberation ratio is calculated based on the direct sound energy and the first reverberation energy. Specifically, this can be achieved by dividing the direct sound energy by the first reverberation energy to obtain the direct reverberation ratio in the form of a linear ratio, or by further converting the linear ratio into a decibel value.
[0061] For example, the direct sound energy is divided by the first reverberation energy to obtain a linear ratio, and then the common logarithm of the ratio is multiplied by 20 to obtain the decibel value.
[0062] For example, the direct sound energy E_direct is divided by the first reverberation energy E_reverb to obtain the ratio. This ratio is then taken as the logarithm to base 10 and multiplied by 10 to obtain the direct-reverberation ratio (DRR) expressed in decibels. DRR = 10 × lg(E_direct / E_reverb), in dB. A larger DRR value indicates a higher proportion of direct sound energy in the total energy, and a sound source closer to the near field; a smaller DRR value indicates that reverberation energy dominates, and a sound source closer to the far field.
[0063] In one implementation of this specification, in a near-field and far-field audio filtering scenario for a smart voice device, the room impulse response sequence h(n) has been extracted from the audio to be filtered, and the direct sound position t0 has been determined. A preset calibration window time of 2.5 milliseconds and a sampling rate of 16 kHz are read. The number of calibration sampling points c is calculated as 2.5 milliseconds multiplied by 16 kHz and rounded down to obtain 40 sampling points. Centered on the direct sound position t0, 40 sampling points are extended forward and backward, determining the direct reverberation interval as [t0-40, t0+40]. A total of 81 sampling points are traversed within this interval. The square of the amplitude of each sampling point is calculated and accumulated to obtain the direct sound energy E_direct. Subsequently, starting from sampling point t0+41 after the direct reverberation interval, the process is traversed to the end of the impulse response sequence N-1, calculating and accumulating the square of the amplitude of each sampling point to obtain the first reverberation energy E_reverb. The direct reverberation ratio (DRR) is calculated as 10 × lg(E_direct / E_reverb) to obtain the DRR value expressed in decibels. This DRR will serve as the primary indicator for subsequent near-field and far-field screening, and will be compared with the high and low thresholds of the DRR to determine the screening results or whether to proceed to the early energy ratio-assisted judgment stage.
[0064] By defining the direct reverberation interval centered on the direct sound location and setting a correction window time of half width, the direct sound energy within the interval and the first reverberation energy after the interval are extracted and their ratios calculated. This allows the direct-reverberation ratio to accurately quantify the energy comparison between direct and reverberant sound, providing a primary quantitative criterion for near-field and far-field screening. A larger direct-reverberation ratio indicates a higher proportion of direct sound and a closer sound source; a smaller ratio indicates a higher proportion of reverberant sound and a farther sound source. This provides an intuitive and interpretable numerical basis for subsequent stratification.
[0065] Step 106: Determine the early energy ratio based on the set early time upper limit, direct sound location, and impulse response sequence; Setting an early time upper limit is a time length parameter used to define the cutoff position of the early reflected sound energy calculation interval. A time window is defined in the impulse response sequence starting from the direct sound location. The signal energy within this window is extracted as the early reflected sound energy, allowing the energy calculation of the early reflected sound to be distinguished from the later reverberation. For example, the early time upper limit can be set to 30 milliseconds, meaning that the signal within a 30-millisecond time range starting from the direct sound location is included in the early reflected sound energy calculation interval. For example, the early time upper limit can also be set to different durations such as 20 milliseconds or 50 milliseconds based on acoustic standards or empirical values.
[0066] The early sound sampling interval is a time range within an impulse response sequence determined by the direct sound location and a set early time upper limit. It is used to extract early reflected sound energy from the impulse response sequence. This interval covers the time period of the direct sound and the early reflected sound, reflecting the energy of the sound wave reaching the receiving position after a few reflections in the early stages of propagation. For example, if the time corresponding to the direct sound location is 10 milliseconds and the set early time upper limit is 30 milliseconds, then the early sound sampling interval is the range of sampling points between 10 milliseconds and 40 milliseconds. For example, the starting point of the early sound sampling interval is the direct sound location, and the ending point is the direct sound location plus the sampling point corresponding to the set early time upper limit.
[0067] Early energy is a statistical value of the signal energy at each sampling point within the early sound sampling interval of an impulse response sequence. It is used to characterize the contribution of direct sound and early reflected sound to the total sound energy. A higher early energy indicates higher sound clarity and a more likely near-field environment for the sound source. For example, early energy can be obtained by summing the squares of the amplitudes at each sampling point within the early sound sampling interval; alternatively, early energy can be obtained by averaging the squares of the amplitudes at each sampling point within the interval.
[0068] The second reverberation energy is a statistical value of the signal energy at each sampling point within the sampling range from the end of the early sound sampling interval to the end of the impulse response sequence. The second reverberation energy characterizes the total energy of the later reverberant sound, reflecting the energy level of the diffuse sound field formed after multiple reflections of the sound wave. For example, the second reverberation energy can be obtained by summing the squares of the amplitudes of all sampling points from the end of the early sound sampling interval to the end of the impulse response sequence.
[0069] The early energy ratio is the ratio of early energy to the second reverberation energy. It quantifies the energy contrast between early reflections and later reverberation, and is a crucial acoustic indicator for determining whether an audio recording scene is in the near or far field. For example, the early energy ratio can be expressed as a linear ratio; a higher value indicates a stronger relative strength of early reflections to later reverberation, suggesting a more near-field acoustic environment. Alternatively, the early energy ratio can be converted to decibels (dB).
[0070] Based on setting an early time upper limit, the direct sound position, and the impulse response sequence, the early energy ratio is determined. Specifically, it can be done by taking the direct sound position as the starting point, using the set early time upper limit as the window length, defining an early sound sampling interval in the impulse response sequence, extracting the signal energy within this interval as the early energy, and then extracting the signal energy from the early sound sampling interval to the end of the impulse response sequence as the second reverberation energy, and calculating the ratio of the two to obtain the early energy ratio.
[0071] One optional implementation involves first determining the starting and ending sampling points of the early sound sampling interval based on the sampling point index corresponding to the direct sound location and the number of sampling points calculated from the sampling rate using a set early time upper limit. Then, iterating through each sampling point within this interval of the impulse response sequence, the amplitude of each sampling point is squared and summed or averaged to obtain the early energy. Next, starting from the position following the ending sampling point of the early sound sampling interval, iterating to the end of the impulse response sequence, similarly squared and summed or averaged the amplitude of each sampling point to obtain the second reverberation energy. Finally, the early energy is divided by the second reverberation energy to obtain the early energy ratio, which can be further converted to a decibel value. For example, if the early energy is 0.6 and the second reverberation energy is 0.4, the early energy ratio is 1.5, which is approximately 3.5 decibels.
[0072] One possible implementation is that the range from the early sound sampling interval to the end of the impulse response sequence is the extraction interval for the second reverberation energy. This interval contains only the energy of the later reverberation sound and does not contain the energy of the direct sound and the early reflected sound, so that the early energy and the second reverberation energy are completely separated in time, and the sum of the two is equal to the total energy of the impulse response sequence.
[0073] In one implementation of this specification, applied to a near-field / far-field screening scenario for conference audio, an impulse response sequence of the audio to be screened has been acquired. The sequence contains 4096 sampling points at a sampling rate of 48000 Hz, with the direct sound location determined at the 256th sampling point. The preset upper limit for the early sound time is 30 milliseconds. Based on the sampling rate, the preset upper limit for the early sound time is converted into the number of sampling points: 30 milliseconds multiplied by 48000 Hz equals 1440 sampling points. Using the 256th sampling point as the starting point and the 1695th sampling point as the ending point, the early sound sampling interval is determined to be the range between the 256th and 1695th sampling points, totaling 1440 sampling points. Traversing these 1440 sampling points within this interval, the amplitude of each sampling point is squared and summed, resulting in an early energy of 0.65. Starting from the 1696th sampling point and iterating to the 4096th sampling point, the amplitudes of 2401 sampling points were squared and summed to calculate the second reverberation energy as 0.35. Dividing the early energy (0.65) by the second reverberation energy (0.35) yields an early energy ratio of approximately 1.86. Multiplying this ratio by 20 (using the common logarithm of 20) converts it to a decibel value of approximately 5.4 dB. This early energy ratio will serve as one of the auxiliary indicators for subsequent near-field and far-field screening.
[0074] By setting an upper limit for the early time and the location of the direct sound, the sampling interval for the early sound is determined in the impulse response sequence, and the early energy and the second reverberation energy are extracted respectively to calculate the early energy ratio, thus realizing the accurate quantification of the energy comparison relationship between the early reflected sound and the later reverberation sound.
[0075] In one optional embodiment of this specification, the early energy ratio is determined based on a set early time upper limit, the direct sound location, and the impulse response sequence, including: Based on the location of the direct sound and the set upper limit of the early time, the early sound sampling interval corresponding to the early reflected sound energy is determined; Early energy within the early acoustic sampling interval is extracted from the impulse response sequence; Extract the second reverberation energy from the early acoustic sampling interval to the end of the impulse response sequence from the impulse response sequence; The early energy ratio is calculated based on the early energy and the second reverberation energy.
[0076] Setting an early time upper limit is a preset parameter that defines the time range of early reflected sound signals. It is used to delineate the cutoff position for early sound sampling in the impulse response sequence, starting from the beginning of the direct reverberation interval and ending at the time upper limit after the direct sound location. The signal within this interval includes the direct sound and the energy of subsequent early reflected sound. For example, the early time upper limit can be set to 50 milliseconds, and the corresponding number of sampling points is obtained by multiplying the early time upper limit by the sampling rate and rounding down. For example, the early time upper limit can also be adjusted according to the general rules of indoor acoustics, such as setting it to 40 milliseconds or 60 milliseconds, which typically covers the early reflection components within tens of milliseconds after the arrival of the direct sound.
[0077] The early sound sampling interval is a sub-interval of the impulse response sequence used to extract early reflected sound energy, determined based on the direct sound location and a set early time upper limit. The early sound sampling interval begins at the start of the direct-to-reverberation interval and ends at the number of sampling points corresponding to the set early time upper limit after the direct sound location. This interval is wider than the direct-to-reverberation interval, covering the direct sound and subsequent early reflected sound. The signal energy from the end of the interval to the end of the sequence is considered late-reverberation energy. For example, the direct sound location is t0, the corrected number of sampling points is c, and the number of sampling points corresponding to the set early time upper limit is T. e Then the early sound sampling interval is [t0-c, t0+T]. e This interval contains the direct sound and the subsequent early reflections.
[0078] Early energy is the sum of the squares of the amplitudes of all sampling points within the early acoustic sampling interval of an impulse response sequence. Early energy characterizes the total signal intensity of the sound emitted from the sound source reaching the receiver via the direct path and the early reflection path; it is the numerator in calculating the early energy ratio. For example, early energy E_early is the cumulative sum of the squares of the amplitudes of all sampling points of the impulse response sequence h(n) within the early acoustic sampling interval, where n ranges from t0-c to t0+T. e .
[0079] The second reverberation energy is the sum of the squares of the amplitudes of all sampling points from the early acoustic sampling interval to the end of the impulse response sequence. It characterizes the intensity of the later reverberation signal and is the denominator term in calculating the early energy ratio. For example, the second reverberation energy E_late is the cumulative sum of the squares of the amplitudes of all sampling points in the impulse response sequence h(n) from the early acoustic sampling interval to the end of the sequence, where n ranges from t0+T. e +1 to N-1.
[0080] The early energy ratio (CTE) is expressed in decibels as the ratio of early energy to the second reverberation energy. It measures the concentration of sound energy within the early time window. A larger ratio indicates more concentrated early energy, with direct sound and early reflections dominating, and more pronounced near-field characteristics. A smaller ratio indicates that late reverberation energy dominates, and more pronounced far-field characteristics. For example, the early energy ratio CTE is calculated as CTE = 10 × lg(E_early / E_late), in dB. When CTE is less than 0, it means that the early energy is less than the late reverberation energy, which is physically abnormal. In this case, the early energy ratio loses its discriminative meaning, and the early decay time needs to be introduced as a fallback indicator for supplementary judgment.
[0081] Based on the location of the direct sound and the set upper limit of the early time, the early sound sampling interval corresponding to the early reflected sound energy is determined. Specifically, it can be based on the starting position t0-c of the direct reverberation interval, and the number of sampling points T corresponding to the set upper limit of the early time is pushed forward from the direct sound position t0. e Using [t0-c, t0+T] as the endpoint, the early sound sampling interval is obtained. e The operation involves setting an early time limit of 50 milliseconds, multiplying it by the sampling rate, and rounding down to obtain the number of sampling points T. e The early sound sampling interval covers the time range from the start of direct reverberation to 50 milliseconds after the direct sound. This interval includes the energy of the direct sound and the early reflected sound energy thereafter. It is wider than the direct reverberation interval and can more comprehensively reflect the sound energy concentration characteristics of near-field sound sources.
[0082] Extracting early energy from an early acoustic sampling interval in an impulse response sequence can be achieved by iterating through all sampling points within that interval, calculating the square of the amplitude at each point, and summing all the squares to obtain the early energy. The early energy E_early represents the energy of the impulse response sequence h(n) from t0-c to t0+T. e The sum of the squares of the amplitudes at each sampling point within the range, i.e., E_early = Σh²(n), n ∈ [t0-c, t0+T]. e ].
[0083] Extracting the second reverberation energy from the early acoustic sampling interval to the end of the impulse response sequence can be achieved by starting from the next sampling point after the early acoustic sampling interval, traversing to the end of the impulse response sequence N-1, calculating the square of the amplitude at each sampling point within this range, and summing the results to obtain the second reverberation energy. The second reverberation energy E_late is the value of the impulse response sequence h(n) from t0+T. e The sum of the squares of the amplitudes at each sampling point within the range of +1 to N-1, i.e., E_late=Σh²(n), n∈[t0+T e +1, N-1].
[0084] The early energy ratio (CTE) is calculated based on the early energy and the second reverberation energy. Specifically, it can be obtained by dividing the early energy (E_early) by the second reverberation energy (E_late), taking the logarithm to base 10, and then multiplying by 10 to get the early energy ratio value expressed in decibels (dB). CTE = 10 × lg(E_early / E_late), in dB. A larger CTE value indicates that the sound energy is more concentrated in the early time window, and the sound source is closer to the near field; a smaller CTE value indicates that the late reverberation energy is dominant, and the sound source is closer to the far field. When CTE is less than 0, the early energy is less than the late reverberation energy, which is physically an abnormal situation, and the early energy ratio loses its discriminative meaning. In this case, the early decay time needs to be introduced as a fallback indicator for supplementary judgment.
[0085] This specification describes an implementation of a near-field and far-field audio filtering scenario applied to a smart voice device. The room impulse response sequence h(n) has been extracted from the audio to be filtered, and the direct sound location t0 and the number of calibration sampling points c have been determined. A preset early time limit of 50 milliseconds and a sampling rate of 16 kHz are read, and the number of sampling points T corresponding to the early time limit is calculated. e800 sampling points are obtained by multiplying 50 milliseconds by 16 kHz and rounding. Starting from the initial position t0-c of the direct reverberation interval and ending 800 sampling points after the direct sound position t0, the early sound sampling interval is defined as [t0-c, t0+800]. All sampling points within this interval are iterated through, and the square of the amplitude at each sampling point is calculated and accumulated to obtain the early energy E_early. Subsequently, starting from the sampling point t0+801 after the early sound sampling interval, the process is repeated up to the end of the impulse response sequence N-1, calculating the square of the amplitude at each sampling point and accumulating it to obtain the second reverberation energy E_late. The early energy ratio CTE is calculated as CTE = 10 × lg(E_early / E_late), yielding the early energy ratio value expressed in decibels. This early energy ratio will serve as an auxiliary indicator for subsequent near-field and far-field screening and will be used to help distinguish near-field and far-field audio when the direct reverberation ratio falls into an uncertain range. If the CTE is less than 0, the early energy ratio is an outlier and early decay time will be introduced as a fallback indicator for supplementary judgment.
[0086] By defining the early sound sampling interval starting from the direct reverberation point and ending with an upper limit of the early time beyond the direct sound position, the early energy ratio extracts the early energy within the interval and the second reverberation energy beyond the interval, calculating their ratio. This allows the early energy ratio to accurately quantify the concentration of sound energy within the early time window. Compared to the direct reverberation ratio, which only considers the comparison between direct sound and reverberation, the early energy ratio further incorporates early reflected sound. When the direct reverberation ratio is in an ambiguous range, it provides a more granular ability to distinguish sound field features, offering an effective auxiliary indicator for layered judgment. Simultaneously, a fallback judgment based on the early decay time is triggered when the early energy ratio is an outlier, ensuring the completeness and robustness of the screening process.
[0087] Step 108: Determine the near-field and far-field screening results of the audio to be screened based on the direct reverberation ratio and early energy ratio.
[0088] The near-field and far-field filtering results are classifications based on the acoustic characteristic parameters of the audio to be filtered, used to identify whether the audio acquisition scene belongs to the near-field or far-field. These results provide a basis for subsequent audio processing strategies; audio in different sound field environments may require different enhancement or noise reduction methods. For example, the near-field filtering result can be a near-field identifier, indicating that the sound source is close to the receiving position, direct sound energy dominates, and the audio quality is good. Alternatively, the near-field filtering result can be a far-field identifier, indicating that the sound source is far from the receiving position, reverberant sound energy dominates, and the audio may require further noise reduction or dereverberation processing.
[0089] The direct-to-reverberation ratio (DRR) is the ratio of direct sound energy to the first reverberation energy, used to quantify the energy contrast between direct and reverberant sound. The DRR is a key criterion in near-field and far-field selection; a higher DRR indicates a stronger direct sound relative to the reverberation, a closer sound source to the receiver, and a tendency towards the near field. For example, the DRR can be expressed in decibels (dB). A high DRR indicates a closer sound source, which can be directly identified as near-field.
[0090] The early energy ratio is the ratio of early energy to the second reverberation energy, used to quantify the energy contrast between early reflections and later reverberation. In near-field and far-field screening, the early energy ratio serves as an auxiliary criterion. When the direct reverberation ratio is in an ambiguous range and cannot be directly determined, the early energy ratio is introduced for supplementary judgment. For example, the early energy ratio can be expressed in decibels; a higher early energy ratio indicates higher sound clarity and a stronger near-field orientation.
[0091] The near-field and far-field screening results of the audio to be screened are determined based on the direct reverberation ratio and the early energy ratio. Specifically, after obtaining the two acoustic indicators, the direct reverberation ratio and the early energy ratio, the two indicators are compared with the preset screening thresholds, and the sound field category to which the audio to be screened belongs is determined based on the comparison results.
[0092] One possible implementation is to employ a hierarchical judgment strategy. First, the direct reverberation ratio is compared with a preset screening threshold: if the direct reverberation ratio is large, it falls within the first direct reverberation ratio screening range, indicating that the direct sound is significantly stronger than the reverberant sound, and the screening result can be directly determined based on the direct reverberation ratio without referring to the early energy ratio; if the direct reverberation ratio is small, it falls within the second direct reverberation ratio screening range, indicating that the energy comparison between the direct sound and the reverberant sound is not clear enough, and in this case, the early energy ratio is introduced for auxiliary judgment, comparing the early energy ratio with a set early energy ratio screening range, and determining the final near-field and far-field screening result based on the range to which the early energy ratio belongs. For example, the first direct reverberation ratio screening range is a direct reverberation ratio greater than or equal to 10 dB. If the calculated direct reverberation ratio is 12 dB, it falls into the first screening range and is directly determined to be near field. The second direct reverberation ratio screening range is a direct reverberation ratio less than 10 dB. If the direct reverberation ratio is 5 dB, it falls into the second screening range, and then the early energy ratio is further judged. If the early energy ratio is greater than or equal to 3 dB, it is determined to be near field; otherwise, it is determined to be far field.
[0093] One possible implementation involves using a weighted comprehensive judgment method. This involves multiplying the direct reverberation ratio and the early energy ratio by their respective weighting coefficients, summing the results, and then comparing the comprehensive score with a preset threshold to determine the near-field and far-field screening results. The weights of the two indicators in the judgment can be adjusted according to the needs of the actual acoustic scenario.
[0094] By jointly determining near-field and far-field screening results based on two indicators—direct reverberation ratio and early energy ratio—sound field assessment can be comprehensively evaluated from two dimensions: the energy contribution of direct sound and the energy contribution of early reflected sound. The direct reverberation ratio reflects the contrast between direct sound and overall reverberation, while the early energy ratio reflects the contrast between early reflected sound and later reverberation. These two indicators describe sound field characteristics at different time scales, and their complementary use allows for a more comprehensive and accurate assessment of the audio's sound field environment. This reduces potential misjudgments that might occur with a single indicator in complex acoustic environments, improving the accuracy and robustness of near-field and far-field screening.
[0095] In one optional embodiment of this specification, the near-field and far-field screening results of the audio to be screened are determined based on the direct reverberation ratio and the early energy ratio, including: If the direct reverberation ratio falls within the first direct reverberation ratio filtering range, then the near-field and far-field filtering results of the audio to be filtered are determined based on the direct reverberation ratio and the first direct reverberation ratio filtering range. If the direct reverberation ratio falls within the second direct reverberation ratio screening range, then the near-field and far-field screening results of the audio to be screened are determined based on the early energy ratio and the set early energy ratio screening range.
[0096] The first direct-to-reverberation ratio (DRR) screening range is a preset range of values above a high threshold for the DRR. When the DRR falls within this range, the direct sound energy is significantly higher than the reverberation energy, indicating that the sound source is clearly in the near field and can be directly identified as near-field audio without the need for other auxiliary indicators. For example, the first DRR screening range can be greater than 20 dB; when the DRR is greater than 20 dB, it is determined to be near-field audio. For example, the first DRR screening range can also be adjusted according to the acoustic characteristics of the actual application scenario, such as being greater than 18 dB or greater than 22 dB.
[0097] The second direct reverberation ratio (DRR) screening range is a preset range between a low threshold and a high threshold for the DRR. When the DRR falls within this range, the comparison between direct sound energy and reverberation energy is not clear enough, making it impossible to make a reliable near-field / far-field judgment based solely on the DRR. Therefore, an early energy ratio is needed as an auxiliary judgment indicator. For example, the second direct RRR screening range can be greater than or equal to 13dB and less than or equal to 20dB. When the DRR is within this range, the early energy ratio auxiliary judgment stage begins. The upper and lower limits of the second direct RRR screening range can also be adjusted according to the statistical laws of the sound field environment.
[0098] The early energy ratio (CTE) screening range is a numerical range above a preset early energy ratio threshold. It assists in determining near-field and far-field audio when the direct reverberation ratio (CTE) is in an uncertain range. When the early energy ratio falls within this range, the acoustic energy is highly concentrated within the early time window, exhibiting clear near-field characteristics, and can be identified as near-field audio. For example, the early energy ratio screening range can be set to a range greater than 25 dB; when the CTE is greater than 25 dB, it is determined to be near-field audio. Alternatively, the early energy ratio screening range can be set to a range greater than 20 dB or greater than 30 dB, adjusted according to the actual screening accuracy requirements.
[0099] If the direct reverberation ratio falls within the first direct reverberation ratio screening range, then based on the direct reverberation ratio and the first direct reverberation ratio screening range, the near-field and far-field screening results of the audio to be screened are determined. Specifically, when the calculated direct reverberation ratio value is greater than the preset direct reverberation ratio high threshold, it is determined that the direct sound energy is significantly higher than the reverberation energy, the sound source is close to the receiver, and the near-field audio is directly output as the screening result.
[0100] One alternative implementation is to set the direct reverberation ratio (DRR) high threshold to 20 dB. When the DRR is greater than 20 dB, there is no need to calculate or refer to the earlier energy ratio; the audio is directly identified as near-field audio, and the screening process ends. This branch corresponds to scenarios where the direct reverberation ratio can clearly distinguish between near and far fields, making the screening decision the most direct and efficient.
[0101] If the direct reverberation ratio falls within the second direct reverberation ratio screening range, the near-field and far-field screening results of the audio to be screened are determined based on the early energy ratio and the set early energy ratio screening range. Specifically, when the direct reverberation ratio value is between the preset low threshold and high threshold, the energy contrast between the direct sound and the reverberation sound is not clear enough, and the early energy ratio is introduced for auxiliary judgment.
[0102] One optional implementation sets the direct reverberation ratio (DRR) low threshold to 13dB and the high threshold to 20dB. When the DRR is between 13dB and 20dB, the early energy ratio (CTE) is further checked: if the CTE is greater than the threshold of 25dB (the set early energy ratio screening range), it indicates that the sound energy is highly concentrated in the early time window and is determined to be near-field audio; if the CTE is less than or equal to 25dB, it indicates that the sound energy is not sufficiently concentrated in the early time window and is determined to be far-field audio. This branch corresponds to scenarios where the direct reverberation ratio is in an ambiguous range, and enhances the distinguishing ability by introducing an index of the concentration of early reflected sound energy.
[0103] In one implementation of this specification, a near-field / far-field audio filtering scenario is applied to a smart voice device. The direct reverberation ratio (DRR) of a certain audio to be filtered is calculated to be 22 dB, and the early energy ratio (CTE) is 30 dB. The DRR is compared with a preset filtering range. Since 22 dB is greater than the high threshold of 20 dB for the DRR, the DRR falls within the first DRR filtering range. The direct sound energy is significantly higher than the reverberation energy, indicating the sound source is clearly in the near field. Therefore, the audio to be filtered is directly determined to be near-field audio, and the near-field filtering result is output without needing to proceed to the early energy ratio auxiliary determination stage.
[0104] In one implementation of this specification, the direct reverberation ratio (DRR) of another audio sample to be screened has been calculated to be 15dB, and the early energy ratio (CTE) to be 28dB. The DRR is compared with a preset screening range. 15dB falls between the low threshold (13dB) and high threshold (20dB) of the DRR, placing it within the second direct reverberation ratio screening range, which is in an uncertain interval. The early energy ratio is then used for auxiliary determination. The CTE is compared with the set early energy ratio screening range. 28dB is greater than the early energy ratio threshold (25dB), placing the CTE within the set early energy ratio screening range. The sound energy is highly concentrated within the early time window, exhibiting clear near-field characteristics. Therefore, the audio sample to be screened is determined to be a near-field audio, and the near-field screening result is output.
[0105] In one implementation of this specification, the direct reverberation ratio (DRR) of a candidate audio sample is calculated to be 16 dB, and the early energy ratio (CTE) is calculated to be 18 dB. The DRR is compared with a preset screening range; 16 dB falls within the second direct reverberation ratio screening range. The early energy ratio is then used for auxiliary determination. The CTE is compared with the set early energy ratio screening range; 18 dB is less than the early energy ratio threshold of 25 dB, therefore the CTE does not fall within the set early energy ratio screening range. The sound energy concentration within the early time window is insufficient, and the candidate audio sample is determined to be a far-field audio sample. The far-field screening result is then output.
[0106] By dividing the direct reverberation ratio into a first screening range and a second screening range, and introducing an early energy ratio for auxiliary judgment when the direct reverberation ratio is in an ambiguous range, it is possible to make a quick decision when the direct reverberation ratio is clear, and to distinguish it by using more granular early energy distribution characteristics when the direct reverberation ratio is uncertain. This avoids misjudgment caused by insufficient discrimination power of a single indicator in the boundary area, and improves the accuracy and robustness of near-field and far-field screening.
[0107] In one optional embodiment of this specification, after acquiring the audio to be filtered and determining the impulse response sequence of the audio to be filtered, the method further includes: The energy decay curve is determined based on the impulse response sequence, and the early decay time of the target is determined based on the energy decay curve. Accordingly, based on the early energy ratio and the set early energy ratio screening range, the near-field and far-field screening results of the audio to be screened are determined, including: If the early energy ratio falls within the set early energy ratio screening range, the near and far field screening results of the audio to be screened are determined based on the target range to which the early energy ratio belongs. If the early energy ratio is an outlier, the near-field and far-field filtering results of the audio to be filtered are determined based on the early decay time and the set decay time filtering range.
[0108] An energy decay curve, generated based on an impulse response sequence, describes the change in sound energy over time. It reflects the gradual attenuation of sound energy as it propagates through an environment. The decay rate and mode vary under different acoustic conditions, making it the data basis for extracting acoustic parameters such as early decay time. For example, an energy decay curve can be obtained by accumulating energy across the impulse response sequence from each sampling point to the end of the sequence, with time on the horizontal axis and the accumulated energy value on the vertical axis. Alternatively, a Schroeder integral curve can be obtained by inversely integrating the impulse response sequence.
[0109] The target early decay time is a parameter determined based on the energy decay curve, used to characterize the time required for sound energy to decay from its initial value to a predetermined ratio. The target early decay time quantifies the rate of sound decay in an acoustic environment and serves as a fallback acoustic indicator for near-field and far-field determination when the early energy ratio exhibits anomalies. For example, the target early decay time can be the early decay time obtained by multiplying the time difference between the points where the energy decays to -5 dB and -25 dB from the initial value on the energy decay curve by 2; alternatively, the target early decay time can also be the median or average of the early decay times of each sub-band, used to comprehensively reflect the decay characteristics across the entire frequency band.
[0110] Outliers occur when the early energy ratio exceeds a preset valid judgment range. They indicate that the early energy ratio cannot be used as a reliable judgment criterion under the current acoustic environment, possibly due to the specific characteristics of the acoustic environment or interference during the calculation process. In such cases, an alternative judgment mechanism needs to be activated. For example, an outlier in the early energy ratio could be a negative value or exceed a preset reasonable upper limit. These values are physically unreasonable and may be caused by signal processing errors or extreme acoustic conditions. Alternatively, an outlier could be an early energy ratio falling into a preset invalid range, where the early energy ratio value fluctuates significantly and lacks stable judgment capability.
[0111] Setting a decay time filtering range is a threshold interval used to classify near and far fields based on early decay times. This range serves as an alternative criterion when early energy ratios are abnormal, determining the near and far field type of the sound field based on the length of the early decay time. For example, the decay time filtering range can include a near-field range and a far-field range. The near-field range corresponds to a shorter early decay time, indicating rapid sound decay and weak reverberation; the far-field range corresponds to a longer early decay time, indicating slow sound decay and strong reverberation.
[0112] The energy decay curve is determined based on the impulse response sequence, and the early decay time of the target is determined based on the energy decay curve. Specifically, after obtaining the impulse response sequence, the energy is accumulated or inversely integrated to generate a curve describing the energy decay over time. Then, the time point when the energy decays to a specific proportion is extracted from the curve, and the early decay time of the target is calculated.
[0113] One possible implementation involves performing sub-band filtering on the impulse response sequence, generating an energy attenuation curve for each sub-band signal, calculating the attenuation rate based on the attenuation trend of each sub-band energy attenuation curve, and then determining the early attenuation time of each sub-band. The statistical value of the early attenuation time of each sub-band is then used as the target early attenuation time.
[0114] If the early energy ratio falls within the set early energy ratio screening range, the near and far field screening results of the audio to be screened are determined based on the target range to which the early energy ratio belongs. Specifically, when the value of the early energy ratio is within the preset valid judgment range, the near and far field screening results can be determined directly based on the comparison result between the early energy ratio and the set threshold.
[0115] One possible implementation is to set the early energy ratio screening range to include a near-field range and a far-field range, determine which sub-range the early energy ratio falls into, and determine the screening result accordingly.
[0116] If the early energy ratio is an outlier, the near and far field screening results of the audio to be screened are determined based on the early decay time and the set decay time screening range. Specifically, when the value of the early energy ratio exceeds the preset effective judgment range and cannot be used as a reliable judgment basis, a fallback judgment mechanism is activated to compare the early decay time with the threshold of the set decay time screening range and determine the final near and far field screening results based on the length of the early decay time.
[0117] One possible implementation is to set the decay time filtering range with a certain time as the boundary. Early decay times less than the threshold are determined to be near field, and those greater than or equal to the threshold are determined to be far field. For example, if the decay time threshold is set to 0.5 seconds, early decay times of 0.3 seconds or less are determined to be near field.
[0118] In one implementation of this specification, applied to a near-field / far-field screening scenario for conference audio, the calculated direct reverberation ratio (RRR) of the audio to be screened is 6 dB, falling within the second direct RRR screening range. An early energy ratio is needed for auxiliary judgment. However, the calculated early energy ratio is negative, an outlier, and cannot be used for judgment. A fallback judgment mechanism is activated, determining the energy decay curve based on the impulse response sequence. The impulse response sequence is divided into multiple sub-bands, and an energy decay curve is generated for each sub-band. The decay rate of each sub-band is calculated, resulting in early decay times of 0.25 seconds, 0.30 seconds, 0.28 seconds, and 0.35 seconds, respectively. The median of 0.29 seconds is taken as the target early decay time. The target early decay time of 0.29 seconds is compared to the threshold of 0.5 seconds for the set decay time screening range. Since 0.29 seconds is less than 0.5 seconds, it falls within the near-field range. Therefore, the near-field / far-field screening result for the audio to be screened is determined to be near-field.
[0119] This specification describes an implementation of a near-field and far-field audio screening scenario for intelligent voice devices. After acquiring the impulse response sequence, the sequence is filtered by octave bands to obtain the impulse response signals of each octave band's sub-band. For the 500 Hz sub-band signal, starting from the direct sound position t0 to the end of the sequence, the backward cumulative energy is calculated point by point, converted to decibels, and normalized to obtain the normalized attenuation curve for that sub-band. A linear fit is performed on the curve in the range of 0 dB to -10 dB to calculate the number of sampling points required for 10 dB attenuation, and the early attenuation time of that sub-band is obtained proportionally. The same operation is repeated for the 1000 Hz sub-band signal, and the average of the early attenuation times of the two sub-bands is taken as the target early attenuation time, resulting in an EDT of 8 milliseconds. Simultaneously, the direct reverberation ratio and early energy ratio have been calculated, and the DRR of a certain audio to be screened is 15 dB, and the CTE is -3 dB. The DRR is compared with the preset screening range. 15dB falls between 13dB and 20dB, which is within the second direct reverberation ratio screening range, and enters the early energy ratio auxiliary judgment stage. A CTE of -3dB is detected, which is less than 0, indicating an outlier in the early energy ratio. Since the early energy is less than the late reverberation energy, the CTE loses its discriminative significance. Switching to the early decay time fallback judgment, the target early decay time EDT is read as 8 milliseconds. The EDT is compared with the set decay time screening range. 8 milliseconds is less than the 10 millisecond threshold, so the audio to be screened is determined to be near-field audio, and the near-field screening result is output.
[0120] By introducing early decay time as a fallback criterion when anomalies occur in the early energy ratio, near-field and far-field screening can continue even when the second-level criterion fails. Early decay time describes the sound field characteristics from the perspective of the overall trend of energy decay, complementing the direct reverberation ratio and early energy ratio. Together, these three constitute a multi-layered, progressive criterion system, avoiding screening interruptions or misjudgments caused by anomalies in a single criterion, and improving the robustness and reliability of near-field and far-field screening in complex acoustic environments.
[0121] In one optional embodiment of this specification, determining the energy decay curve based on the impulse response sequence includes: The impulse response sequence is filtered to obtain multiple sub-band impulse response signals after filtering. Based on each signal sampling point from the direct sound position corresponding to the first sub-band pulse response signal to the end of the signal sequence, energy accumulation is performed sequentially from the signal sampling point to the end of the signal sequence. Based on the energy accumulation results of each signal sampling point, the sub-band energy attenuation curve corresponding to the first sub-band pulse response signal is determined. The first sub-band pulse response signal is any one of multiple sub-band pulse response signals. The obtained energy decay curves of each sub-band are used as the energy decay curves corresponding to the impulse response sequence.
[0122] Sub-band impulse response signals are impulse response sub-signals corresponding to specific frequency ranges obtained by filtering an impulse response sequence. They are used to analyze the attenuation characteristics of sound field energy in different frequency bands. The attenuation rate may differ between different frequency bands, and processing them separately can more comprehensively reflect the acoustic characteristics of the sound field. For example, sub-band impulse response signals can be signals obtained by filtering the impulse response sequence according to octave bands, such as sub-signals with center frequencies of 500 Hz, 1000 Hz, 2000 Hz, etc. For example, sub-band impulse response signals can also be narrowband signals obtained by further dividing the impulse response sequence into one-third octave bands.
[0123] Backward energy accumulation is an operation that sums the squared amplitudes of all sampling points in a sub-band impulse response signal from a certain sampling point to the end of the signal sequence. Backward energy accumulation is used to generate a cumulative energy curve, which traces backward from the end of the sequence, reflecting the cumulative distribution of signal energy over time. The trend of the cumulative energy curve corresponds to the attenuation law of the sound field energy. For example, backward energy accumulation can start from the direct sound position t0, and for each sampling point n, calculate the sum of the squared amplitudes of all sampling points from n to the end of the sequence N-1, obtaining the cumulative energy value Z(n) corresponding to that sampling point. Alternatively, backward energy accumulation can also start from any specified starting position in the sequence and proceed towards the end.
[0124] The sub-band energy decay curve is generated based on the backward energy accumulation of a single sub-band impulse response signal and is used to describe the decay law of the sound field energy over time within that frequency band. The sub-band energy decay curve is used to extract the early decay time of the sub-band through linear fitting. The decay curves of each sub-band are summarized to form the overall energy decay curve of the impulse response sequence. For example, the sub-band energy decay curve can be a normalized decay curve D(n) that monotonically decreases from 0 dB after converting the accumulated energy value Z(n) to decibels and normalizing it based on the maximum value; alternatively, the sub-band energy decay curve can be a curve obtained by smoothing the normalized decay curve.
[0125] The impulse response sequence is filtered to obtain multiple sub-band impulse response signals. Specifically, a set of preset bandpass filters can be used to filter the impulse response sequence h(n), decomposing the original signal into multiple sub-band impulse response signals with different center frequencies.
[0126] One optional implementation involves using an octave band filter bank to filter the impulse response sequence at standard octave center frequencies such as 500 Hz, 1000 Hz, and 2000 Hz, obtaining sub-signals y(n) for each octave band. Each sub-signal retains the energy distribution characteristics of the original impulse response within its corresponding frequency band. The sub-signals of different frequency bands can independently reflect the attenuation characteristics of direct sound and reverberation within that band.
[0127] Based on each signal sampling point from the direct sound position to the end of the signal sequence corresponding to the first sub-band pulse response signal, backward energy accumulation is performed sequentially from the signal sampling point to the end of the signal sequence. Based on the energy accumulation results of each signal sampling point, the sub-band energy attenuation curve corresponding to the first sub-band pulse response signal is determined. Specifically, for each sub-band pulse response signal, starting from the sampling point corresponding to the direct sound position, the calculation is performed point by point backward. For each sampling point, the squares of the amplitudes of all sampling points from that sampling point to the end of the signal sequence are summed, and the summation result is used as the cumulative energy value corresponding to that sampling point. The cumulative energy values of all sampling points are arranged in chronological order to form the energy attenuation curve of that sub-band.
[0128] For example, for any sub-band impulse response signal after filtering, starting from the direct sound position t0, traverse each sampling point n from t0 to the end of the sequence N-1, calculate the cumulative sum Z(n)=Σy²(k) of the squares of the amplitudes of all sampling points from that position to the end of the sequence for each n, where k ranges from n to N-1, to obtain the cumulative energy sequence, and then convert the cumulative energy sequence into decibel representation and normalize it to obtain the energy attenuation curve of that sub-band.
[0129] For example, the cumulative energy Z(n) is taken as the logarithm to the base 10 and multiplied by 10 to obtain the cumulative energy curve in decibels. Then, the maximum decibel value among all sampling points is used as the reference for normalization, and the maximum value is set to 0dB. The other values are shifted accordingly to obtain the normalized attenuation curve D(n)=10×lgZ(n)-max{10×lgZ(n)}. This curve decreases monotonically from 0dB, reflecting the attenuation process of the sound field energy in this sub-band from the direct sound position.
[0130] The obtained energy attenuation curves of each sub-band are used as the energy attenuation curves corresponding to the impulse response sequence. Specifically, the backward energy accumulation and normalization processing described above can be performed on the impulse response signal of each sub-band obtained by filtering to obtain the normalized attenuation curve corresponding to each sub-band. The attenuation curves of each sub-band are then summarized to form a complete set of energy attenuation curves for the impulse response sequence. This set of energy attenuation curves will be used for subsequent linear fitting on each sub-band to extract the early attenuation time.
[0131] In one implementation of this specification, applied to a near-field and far-field audio screening scenario in an intelligent voice device, an impulse response sequence h(n) has been acquired and the direct sound position t0 has been determined. An octave band filter bank is used to filter the impulse response sequence, resulting in three sub-band impulse response signals with center frequencies of 500 Hz, 1000 Hz, and 2000 Hz. Taking the 500 Hz sub-band signal as an example, starting from the direct sound position t0, the sequence is traversed to the end N-1. For each sampling point n, the cumulative sum of the squares of the amplitudes of all sampling points from n to N-1 is calculated to obtain the cumulative energy value Z(n). The cumulative energy value of each sampling point is converted to decibels, and the maximum value is taken as the 0 dB reference for normalization, resulting in the normalized attenuation curve D(n) of the 500 Hz sub-band, which monotonically decreases from 0 dB. The same backward energy accumulation and normalization processing is performed on the 1000 Hz and 2000 Hz sub-band signals respectively to obtain the corresponding normalized attenuation curves. The normalized attenuation curves of the three sub-bands are used together as the energy attenuation curves corresponding to the impulse response sequence, which can then be used for subsequent linear fitting on each sub-band to extract the early attenuation time.
[0132] By performing sub-band filtering on the impulse response sequence and backward energy accumulation at each sampling point, normalized attenuation curves for each sub-band are generated. This allows the sound field energy attenuation characteristics of different frequency ranges to be analyzed and quantified independently, avoiding mutual interference between attenuation characteristics of different bands during full-band processing. The backward energy accumulation method ensures that the attenuation curves accurately reflect the accumulation pattern of energy from each sampling point to the end of the sequence, providing a precise curve basis for subsequent accurate calculation of the early attenuation time of each sub-band through linear fitting.
[0133] In one optional embodiment of this specification, determining the early decay time of the target based on the energy decay curve includes: Based on the energy attenuation curves of each sub-band, the energy attenuation trend of each sub-band is determined, and based on the energy attenuation trend of each sub-band, the attenuation rate corresponding to the impulse response signal of each sub-band is calculated. Based on the attenuation rate corresponding to the pulse response signal of each sub-band, the early attenuation time of the sub-band corresponding to the pulse response signal of each sub-band is determined. The target early decay time is determined based on the early decay time of each sub-band.
[0134] The sub-band energy attenuation trend is based on the overall trend and pattern of energy change with sampling time in the energy attenuation curves of each sub-band. The sub-band energy attenuation trend reflects the rate at which the sound field energy gradually attenuates after the arrival of the direct sound within that band. A steeper energy attenuation indicates faster dissipation of sound field energy and a more pronounced near-field characteristic. For example, the sub-band energy attenuation trend can be the slope of a fitted straight line obtained by fitting a normalized attenuation curve within a specified decibel range. A negative slope indicates a faster attenuation.
[0135] The decay rate is a numerical indicator used to characterize the amount of sound field energy attenuating per unit time within a sub-band, based on the quantified energy decay trend of that sub-band. The decay rate is used to transform the decay trend from a curve shape into a calculable value, thereby estimating the early decay time of that sub-band. For example, the decay rate can be calculated by fitting a straight line to a normalized decay curve within the range of 0dB to -10dB, and then calculating the number of sampling points the fitted line passes through within that range. The decay rate is then expressed as the decibels attenuated per sampling point or the decibels attenuated per millisecond.
[0136] Sub-band early decay time is an acoustic parameter calculated based on the decay rate of a single sub-band. It characterizes the time required for the sound field energy within that sub-band to decay from its initial value to a specified proportion. The sub-band early decay time reflects the rate of decay of early reflected sound within that band, and the decay time may differ between different bands. For example, the sub-band early decay time can be calculated by taking the range from 0dB to -10dB on a normalized decay curve, calculating the number of sampling points required for a 10dB decay, and then proportionally converting this to the time required for a 60dB decay, expressed in milliseconds.
[0137] The target early decay time is a comprehensive acoustic parameter characterizing the energy decay rate of the entire sound field, obtained by summing the early decay times of each sub-band. It serves as a fallback indicator to supplement judgment when the early energy ratio is an outlier; a shorter decay time indicates faster sound field energy decay and more pronounced near-field characteristics. For example, the target early decay time can be the arithmetic mean of the early decay times of the 500 Hz and 1000 Hz octave bands, expressed in milliseconds.
[0138] Based on the energy attenuation curves of each sub-band, the energy attenuation trend of each sub-band is determined, and based on the energy attenuation trend of each sub-band, the attenuation rate corresponding to the impulse response signal of each sub-band is calculated. Specifically, this can be done by fitting a straight line to the normalized attenuation curve of each sub-band within a preset decibel range, and using the slope of the fitted line or the number of sampling points through which the fitted line passes as a quantitative indicator of the attenuation rate of that sub-band.
[0139] One optional implementation involves performing least-squares linear fitting on the normalized attenuation curve D(n) of each sub-band within the 0dB to -10dB range to obtain the fitted straight line within this range. The number of sampling points m that the fitted straight line passes through to attenuate from 0dB to -10dB is then calculated. The attenuation rate can be expressed as the time required for 10dB attenuation, i.e., m divided by the sampling rate f. s The unit is seconds.
[0140] Based on the attenuation rate corresponding to the pulse response signal of each sub-band, the early attenuation time of the sub-band corresponding to the pulse response signal of each sub-band is determined. Specifically, this can be done by proportionally converting the attenuation rate of each sub-band into the time required for 60dB attenuation, thus obtaining the early attenuation time of each sub-band.
[0141] One alternative implementation is to define, for each sub-band, the time required for the fitted straight line to decay from 0 dB to -10 dB as t. 10 =m / f s The time required for a 60dB attenuation, calculated proportionally, is T = (60 / 10) × t. 10 =6×t 10 The unit is seconds, which is then converted to milliseconds. This value is the early decay time of the sub-band.
[0142] The target early attenuation time is determined based on the early attenuation time of each sub-band. Specifically, this can be achieved by selecting the attenuation times of several representative frequency bands from the early attenuation times of each sub-band and calculating their average value as the target early attenuation time.
[0143] One possible implementation is to take the arithmetic mean of the early decay times of the two octave bands at 500 Hz and 1000 Hz as the final target early decay time, in milliseconds. These two frequency bands cover the main energy distribution range of the speech signal, and their attenuation characteristics can well represent the energy attenuation characteristics of the entire sound field; alternatively, the median or weighted average of the early decay times of multiple sub-frequency bands can also be taken as the target early decay time.
[0144] In one implementation of this specification, applied to near-field and far-field audio screening scenarios in intelligent voice devices, normalized attenuation curves for three sub-bands—500 Hz, 1000 Hz, and 2000 Hz—have been generated. For the normalized attenuation curve of the 500 Hz sub-band, least-squares linear fitting is performed within the 0 dB to -10 dB range, resulting in a fitted line passing through 120 sampling points within this range. With a sampling rate of 16 kHz, the time required for 10 dB attenuation is 120 divided by 16 kHz, which equals 7.5 milliseconds. Proportionally, the time required for 60 dB attenuation is 6 multiplied by 7.5 milliseconds, which equals 45 milliseconds. This value represents the early attenuation time of the 500 Hz sub-band. The same operation is performed on the 1000 Hz sub-band, calculating its early attenuation time to be 35 milliseconds. Taking the arithmetic mean of the early decay times of the two sub-bands at 500 Hz and 1000 Hz, the target's early decay time is (45+35) / 2=40 milliseconds. This target's early decay time will be used as a fallback indicator in the final determination of near-field and far-field screening when the early energy ratio is an outlier.
[0145] By fitting linear values across decibel intervals to the energy attenuation curves of each sub-band, the attenuation trend is quantified into attenuation rate and early attenuation time, transforming the attenuation characteristics of the sound field energy from a curve-like shape into comparable numerical indicators. The average early attenuation time of multiple sub-bands is taken as the target early attenuation time, comprehensively reflecting the attenuation characteristics of different frequency bands. This avoids deviations caused by noise interference at specific frequencies affecting a single frequency band, providing a stable and reliable quantitative basis for baseline determination.
[0146] Corresponding to the above method embodiments, this specification also provides embodiments of an audio filtering device. Figure 2 This is a schematic diagram of the structure of an audio filtering device provided in one embodiment of this specification. Figure 2 As shown, the device includes: The acquisition module 202 is configured to acquire the audio to be filtered, determine the impulse response sequence of the audio to be filtered, and determine the position of the direct sound in the impulse response sequence; The first determining module 204 is configured to determine the direct reverberation ratio based on a set correction window time, the direct sound location, and the impulse response sequence. The second determining module 206 is configured to determine the early energy ratio based on a set early time upper limit, the direct sound position, and the impulse response sequence; The filtering module 208 is configured to determine the near-field and far-field filtering results of the audio to be filtered based on the direct reverberation ratio and the early energy ratio.
[0147] Optionally, the acquisition module is further configured to extract a transfer function characterizing the influence of the environment on sound transmission from the audio to be screened; and to convert the transfer function from the frequency domain to the time domain to obtain an impulse response sequence.
[0148] Optionally, the first determining module is further configured to determine the direct reverberation interval corresponding to the direct sound energy based on the direct sound location and a set correction window time; extract the direct sound energy within the direct reverberation interval from the impulse response sequence; extract the first reverberation energy from the direct reverberation interval to the end of the impulse response sequence from the impulse response sequence; and calculate the direct reverberation ratio based on the direct sound energy and the first reverberation energy.
[0149] Optionally, the second determining module is further configured to determine the early sound sampling interval corresponding to the early reflected sound energy based on the direct sound location and a set early time upper limit; extract the early energy within the early sound sampling interval from the impulse response sequence; extract the second reverberation energy from the early sound sampling interval to the end of the impulse response sequence from the impulse response sequence; and calculate the early energy ratio based on the early energy and the second reverberation energy.
[0150] Optionally, the filtering module is further configured to determine the near-field and far-field filtering results of the audio to be filtered based on the direct reverberation ratio and the first direct reverberation ratio filtering range if the direct reverberation ratio belongs to the first direct reverberation ratio filtering range; and to determine the near-field and far-field filtering results of the audio to be filtered based on the early energy ratio and the set early energy ratio filtering range if the direct reverberation ratio belongs to the second direct reverberation ratio filtering range.
[0151] Optionally, the audio filtering device further includes a third determining module, configured to determine an energy decay curve based on an impulse response sequence, and to determine a target early decay time based on the energy decay curve; correspondingly, the filtering module is further configured to determine the near-field and far-field filtering results of the audio to be filtered based on the target range to which the early energy ratio belongs if the early energy ratio belongs to a set early energy ratio filtering range; if the early energy ratio is an outlier, determine the near-field and far-field filtering results of the audio to be filtered based on the early decay time and the set decay time filtering range.
[0152] Optionally, the third determining module is further configured to filter the impulse response sequence to obtain multiple sub-band impulse response signals after filtering; based on each signal sampling point from the direct sound position corresponding to the first sub-band impulse response signal to the end of the signal sequence, energy accumulation is performed sequentially from the signal sampling point to the end of the signal sequence, and based on the energy accumulation results of each signal sampling point, the sub-band energy attenuation curve corresponding to the first sub-band impulse response signal is determined, wherein the first sub-band impulse response signal is any one of the multiple sub-band impulse response signals; and the obtained sub-band energy attenuation curves are used as the energy attenuation curves corresponding to the impulse response sequence.
[0153] Optionally, the third determining module is further configured to determine the energy attenuation trend of each sub-band based on the energy attenuation curve of each sub-band, and calculate the attenuation rate corresponding to the pulse response signal of each sub-band based on the energy attenuation trend of each sub-band; determine the early attenuation time of each sub-band pulse response signal based on the attenuation rate of each sub-band pulse response signal; and determine the target early attenuation time based on the early attenuation time of each sub-band.
[0154] The above is a schematic representation of an audio filtering device according to this embodiment. It should be noted that the technical solution of this audio filtering device and the technical solution of the aforementioned audio filtering method belong to the same concept. Details not described in detail in the technical solution of the audio filtering device can be found in the description of the technical solution of the aforementioned audio filtering method.
[0155] Figure 3 This is a structural block diagram of a computing device 300 according to one embodiment of this specification. The components of the computing device 300 include, but are not limited to, a memory 310 and a processor 320. The processor 320 is connected to the memory 310 via a bus 330, and a database 350 is used to store data.
[0156] The computing device 300 also includes an access device 340, which enables the computing device 300 to communicate via one or more networks 360. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 340 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.
[0157] In one embodiment of this specification, the aforementioned components of the computing device 300 and Figure 3 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 3 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0158] The computing device 300 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 300 can also be a mobile or stationary server.
[0159] The processor 320 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the audio filtering method described above.
[0160] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the audio filtering method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the audio filtering method described above.
[0161] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described audio filtering method.
[0162] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the audio filtering method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the audio filtering method described above.
[0163] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described audio filtering method.
[0164] The above is an illustrative example of a computer program according to this embodiment. It should be noted that the technical solution of this computer program and the technical solution of the aforementioned audio filtering method belong to the same concept. Details not described in detail in the computer program's technical solution can be found in the description of the technical solution of the aforementioned audio filtering method.
[0165] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0166] Computer instructions include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in computer-readable media can be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0167] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0168] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0169] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to specific implementations. Clearly, many modifications and variations can be made based on the embodiments described in this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. An audio filtering method, characterized in that, include: Acquire the audio to be screened, determine the impulse response sequence of the audio to be screened, and determine the location of the direct sound in the impulse response sequence; The direct reverberation ratio is determined based on the set correction window time, the direct sound location, and the impulse response sequence. The early energy ratio is determined based on the set early time limit, the direct sound location, and the impulse response sequence; The near-field and far-field screening results of the audio to be screened are determined based on the direct reverberation ratio and the early energy ratio.
2. The method according to claim 1, characterized in that, The step of acquiring the audio to be filtered and determining the impulse response sequence of the audio to be filtered includes: Extract the transfer function representing the influence of the environment on sound transmission from the audio samples to be screened; The transfer function is converted from the frequency domain to the time domain to obtain the impulse response sequence.
3. The method according to claim 1, characterized in that, The determination of the direct reverberation ratio based on the set correction window time, the direct sound location, and the impulse response sequence includes: Based on the direct sound location and the set correction window time, determine the direct reverberation range corresponding to the direct sound energy; Extract the direct sound energy within the direct reverberation range from the impulse response sequence; Extract the first reverberation energy from the end of the direct reverberation interval to the end of the impulse response sequence from the impulse response sequence; The direct reverberation ratio is calculated based on the direct sound energy and the first reverberation energy.
4. The method according to claim 1, characterized in that, The determination of the early energy ratio based on the set early time upper limit, the direct sound location, and the impulse response sequence includes: Based on the location of the direct sound and the set upper limit of the early time, the early sound sampling interval corresponding to the early reflected sound energy is determined; The early energy within the early acoustic sampling interval is extracted from the impulse response sequence; Extract the second reverberation energy from the early sound sampling interval to the end of the impulse response sequence; The early energy ratio is calculated based on the early energy and the second reverberation energy.
5. The method according to claim 1, characterized in that, The determination of the near-field and far-field screening results of the audio to be screened based on the direct reverberation ratio and the early energy ratio includes: If the direct reverberation ratio falls within the first direct reverberation ratio filtering range, then the near-field and far-field filtering results of the audio to be filtered are determined based on the direct reverberation ratio and the first direct reverberation ratio filtering range. If the direct reverberation ratio falls within the second direct reverberation ratio screening range, then the near-field and far-field screening results of the audio to be screened are determined based on the early energy ratio and the set early energy ratio screening range.
6. The method according to claim 5, characterized in that, After acquiring the audio to be filtered and determining the impulse response sequence of the audio to be filtered, the method further includes: The energy decay curve is determined based on the impulse response sequence, and the early decay time of the target is determined based on the energy decay curve. Accordingly, determining the near-field and far-field screening results of the audio to be screened based on the early energy ratio and the set early energy ratio screening range includes: If the early energy ratio falls within the set early energy ratio screening range, the near-field and far-field screening results of the audio to be screened are determined based on the target range to which the early energy ratio belongs. If the early energy ratio is an outlier, the near-field and far-field filtering results of the audio to be filtered are determined based on the early decay time and the set decay time filtering range.
7. The method according to claim 6, characterized in that, The determination of the energy decay curve based on the impulse response sequence includes: The impulse response sequence is filtered to obtain multiple sub-band impulse response signals; Based on each signal sampling point from the direct sound position corresponding to the first sub-band pulse response signal to the end of the signal sequence, energy accumulation is performed sequentially from the signal sampling point to the end of the signal sequence, and based on the energy accumulation results of each signal sampling point, the sub-band energy attenuation curve corresponding to the first sub-band pulse response signal is determined, wherein the first sub-band pulse response signal is any one of the plurality of sub-band pulse response signals; The obtained energy decay curves of each sub-band are used as the energy decay curves corresponding to the impulse response sequence.
8. The method according to claim 7, characterized in that, Determining the early decay time of the target based on the energy decay curve includes: Based on the energy attenuation curves of each sub-band, the energy attenuation trend of each sub-band is determined, and based on the energy attenuation trend of each sub-band, the attenuation rate corresponding to the impulse response signal of each sub-band is calculated. Based on the attenuation rate corresponding to each sub-band pulse response signal, the early attenuation time of each sub-band pulse response signal is determined. The target early decay time is determined based on the early decay time of each sub-band.
9. An audio filtering device, characterized in that, include: The acquisition module is configured to acquire the audio to be screened, determine the impulse response sequence of the audio to be screened, and determine the direct sound position in the impulse response sequence; The first determining module is configured to determine the direct reverberation ratio based on a set correction window time, the direct sound location, and the impulse response sequence. The second determining module is configured to determine the early energy ratio based on a set early time upper limit, the direct sound location, and the impulse response sequence; The filtering module is configured to determine the near-field and far-field filtering results of the audio to be filtered based on the direct reverberation ratio and the early energy ratio.
10. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the audio screening method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, It stores computer-executable instructions that, when executed by a processor, implement the steps of the audio filtering method according to any one of claims 1-8.
12. A computer program product, characterized in that, Includes a computer program / instructions that, when executed by a processor, implement the steps of the audio screening method according to any one of claims 1-8.