Earphone adaptive active noise reduction method based on real-time analysis of environmental sound waves
By collecting multi-channel ambient sound waves for acoustic scene classification and spatiotemporal synchronization processing, analyzing noise characteristics, performing adaptive noise reduction filtering, and monitoring energy consumption, the problem of performance degradation of traditional headphones in variable noise environments is solved, achieving adaptive active noise reduction and energy saving effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN HUANGMAI TECH CO LTD
- Filing Date
- 2025-05-10
- Publication Date
- 2026-07-10
Smart Images

Figure CN120455893B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of headphone noise reduction, and in particular to an adaptive active noise reduction method for headphones based on real-time analysis of ambient sound waves. Background Technology
[0002] The purpose of adaptive active noise cancellation in headphones is to improve the user's auditory experience in complex environments through intelligent real-time noise processing technology. The core objective is to automatically adjust noise cancellation parameters by analyzing environmental sound wave characteristics (frequency, intensity, directionality) in real time. This addresses the performance degradation issue of traditional fixed-parameter active noise cancellation in variable noise environments and identifies different scenarios (such as airplane cabins, subways, and offices) to match the optimal noise cancellation strategy, balancing noise suppression with the audibility of voice / warning sounds.
[0003] If headphones don't employ adaptive active noise cancellation and instead only perform continuous noise cancellation, it can lead to auditory safety hazards outdoors, such as masking traffic warning sounds and increasing the risk of accidents during outdoor use. Simultaneously, the constant out-of-phase sound waves generated by static noise cancellation can easily cause a feeling of ear stuffiness, reducing comfort over long-term use. Adaptive active noise cancellation overcomes the limitations of traditional "one-size-fits-all" solutions through a closed-loop control system of environmental perception, intelligent decision-making, and dynamic execution. Essentially, it represents an upgrade in noise management from static defense to dynamic game theory, achieving an intelligent auditory experience of "quiet when necessary, and listening when needed" while ensuring safety. Therefore, a headphone adaptive active noise cancellation method based on real-time analysis of ambient sound waves is proposed. Summary of the Invention
[0004] This invention overcomes the shortcomings of the prior art and provides an adaptive active noise cancellation method for headphones based on real-time analysis of ambient sound waves.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] The first aspect of this invention provides an adaptive active noise cancellation method for headphones based on real-time analysis of ambient sound waves, comprising the following steps:
[0007] Multi-channel ambient sound waves are collected, and acoustic scene classification and spatiotemporal synchronization processing are performed on the multi-channel ambient sound waves to obtain spatiotemporally synchronized multi-channel ambient sound waves.
[0008] Noise characteristics were analyzed on spatiotemporally synchronized multi-channel ambient sound waves, and the location of short-time energy change sound waves was detected on the spatiotemporally synchronized multi-channel ambient sound waves.
[0009] Based on the location of the sound wave with short-term energy change, adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are performed on the environmental sound wave to be analyzed.
[0010] During real-time noise cancellation ambient sound wave output, energy consumption monitoring and energy consumption optimization control are performed on the target headphones.
[0011] Furthermore, in a preferred embodiment of the present invention, the step of acquiring multi-channel ambient sound waves and performing acoustic scene classification and spatiotemporal synchronization processing on the multi-channel ambient sound waves to obtain spatiotemporally synchronized multi-channel ambient sound waves specifically involves:
[0012] Acquire the headphones that require adaptive active noise cancellation, designate them as target headphones, and install a microphone on the target headphones;
[0013] Among them, the microphones on the target earphone include a microphone for collecting ambient sound waves outside the target earphone and a microphone for collecting ambient sound waves inside the ear canal.
[0014] Ambient sound waves are collected in real time through the microphone of the target earphone. The ambient sound waves include ambient sound waves outside the target earphone and ambient sound waves inside the ear canal. The collected ambient sound waves are calibrated as multi-channel ambient sound waves.
[0015] Calculate the Mel-spectral coherence coefficient of multi-channel ambient sound waves, and combine the Mel-spectral coherence coefficient of multi-channel ambient sound waves to calculate the spatial and temporal characteristics of multi-channel ambient sound waves.
[0016] The spatial and temporal characteristics of multi-channel ambient sound waves are aligned in real time to ensure that the multi-channel ambient sound waves are spatiotemporally synchronized in different times and spaces, thus obtaining spatiotemporally synchronized multi-channel ambient sound waves.
[0017] Furthermore, in a preferred embodiment of the present invention, the step of performing noise feature analysis on spatiotemporally synchronized multi-channel ambient sound waves and detecting the location of short-time energy change sound waves on the spatiotemporally synchronized multi-channel ambient sound waves specifically includes:
[0018] The Hanning window algorithm is introduced to perform frame-by-frame windowing processing on the spatiotemporally synchronized multi-channel ambient sound waves, and the windowed spatiotemporally synchronized multi-channel ambient sound waves are obtained and calibrated as the ambient sound waves to be analyzed.
[0019] Determine the signal-to-noise ratio (SNR) of the ambient sound wave to be analyzed, determine the weighted average weight of the ambient sound wave to be analyzed based on the SNR, perform weighted averaging, construct the multi-window spectrum of the ambient sound wave to be analyzed, and calibrate it as the target spectrum.
[0020] The harmonic consistency of the target spectrum is verified, and the frequency group with the highest energy that satisfies the harmonic consistency in the target spectrum is selected to obtain the main frequency of the ambient sound wave to be analyzed, which is then calibrated as the target main frequency.
[0021] By combining the target main frequency and the target spectrum, the energy of the ambient sound wave to be analyzed is calculated, and an energy threshold is preset. The location in the ambient sound wave to be analyzed where the energy is greater than the energy threshold is determined and marked as the location of the energy change to be analyzed.
[0022] The mutation difference is calculated for all energy mutation locations to be analyzed, and the locations with mutation differences greater than a preset value are retrieved from all energy mutation locations to be analyzed and marked as short-time energy mutation sound wave locations.
[0023] Furthermore, in a preferred embodiment of the present invention, the adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering of the ambient sound wave to be analyzed, based on the location of the short-time energy change sound wave, specifically includes:
[0024] A dynamic filter module is acquired and connected to the target earphone, enabling the dynamic filter module to perform filtering on the target earphone.
[0025] The location distribution of short-time energy change sound wave locations in the environmental sound wave to be analyzed is performed, the distribution interval between different short-time energy change sound wave locations is calculated, and the minimum distribution interval is preset.
[0026] If the distribution interval between different short-time energy change sound wave locations is not less than the minimum distribution interval, then adaptive steady-state noise reduction filtering is required for the environmental sound wave to be analyzed. If the distribution interval between different short-time energy change sound wave locations is greater than the minimum distribution interval, then adaptive transient noise reduction filtering is required for the environmental sound wave to be analyzed.
[0027] If adaptive transient noise reduction filtering is required for the ambient sound wave to be analyzed, the main frequency and target spectrum of the ambient sound wave to be analyzed are imported into the dynamic filtering module in real time for nonlinear phase compensation.
[0028] The nonlinear phase compensation involves pre-distorting the ambient sound wave to be analyzed, calculating the phase compensation value of the ambient sound wave to be analyzed, and applying the phase compensation value of the ambient sound wave to be analyzed to the target earphone in real time through a dynamic filtering module, thereby realizing adaptive transient noise reduction filtering of the ambient sound wave to be analyzed.
[0029] If adaptive steady-state noise reduction filtering is required for the ambient sound waves to be analyzed, then adaptive steady-state noise reduction filtering is applied to the ambient sound waves to be analyzed, and adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are mixed.
[0030] Furthermore, in a preferred embodiment of the present invention, the adaptive steady-state noise reduction filtering is applied to the ambient sound wave to be analyzed, and the adaptive transient noise reduction filtering and the adaptive steady-state noise reduction filtering are mixed and processed, specifically as follows:
[0031] An improved FxLMS algorithm is introduced into the dynamic filtering module. Through the improved FxLMS algorithm, the target spectrum step size of the ambient sound wave to be analyzed is updated within the dynamic filtering module, and energy leakage control is performed on the ambient sound wave to be analyzed during the target spectrum compensation update process.
[0032] The energy leakage control of the ambient sound wave to be analyzed is to control the energy of the target spectrum of the ambient sound wave to be analyzed to always keep it within the energy threshold.
[0033] In the dynamic filtering module, the distribution interval between the locations of different short-time energy change sound waves is analyzed in real time, and adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are switched in real time based on the distribution interval.
[0034] The ambient sound waves to be analyzed, after being filtered by adaptive transient noise reduction and adaptive steady-state noise reduction respectively, are multi-band synthesized, and the multi-band synthesized ambient sound waves to be analyzed are calibrated as real-time noise-reduced ambient sound waves.
[0035] Furthermore, in a preferred embodiment of the present invention, the step of monitoring and optimizing the energy consumption of the target headphones during real-time noise reduction ambient sound wave output specifically includes:
[0036] By introducing spectral subtraction, residual noise is eliminated from the ambient sound waves in real-time noise reduction, while simultaneously acquiring the surrounding environmental parameters of the target earphone.
[0037] Calculate the real-time energy consumption change data of the target headphones when processing real-time noise-canceling ambient sound waves, and construct a real-time energy consumption change curve;
[0038] A preset standard energy consumption threshold is set, and the real-time energy consumption change curve is analyzed to determine whether the real-time energy consumption of the target earphone is always maintained within the standard energy consumption threshold.
[0039] If so, the target earphone is calibrated as a qualified energy consumption target earphone and maintained in operation as a qualified energy consumption target earphone to achieve adaptive active noise cancellation to ambient sound waves;
[0040] If not, the target earphone is marked as an unqualified energy consumption target earphone, and the grey relational method is introduced to calculate the grey relational value between the real-time energy consumption of the unqualified energy consumption target earphone and the corresponding surrounding environmental parameters, which is marked as the first grey relational value.
[0041] A gray correlation threshold is preset. If the first gray correlation value remains within the gray correlation threshold, it is determined that the real-time energy consumption of the unqualified energy consumption target headphones is affected by the corresponding surrounding environmental parameters. A scheme to protect the unqualified energy consumption target headphones from the corresponding surrounding environmental parameters is introduced and output.
[0042] If the first gray correlation value is not maintained within the gray correlation threshold, the unqualified energy consumption target headphones are controlled to perform real-time decibel calculation on the ambient sound wave to be analyzed, and the real-time decibel value of the ambient sound wave to be analyzed is determined.
[0043] If the real-time decibel threshold of the hazard is preset, and the real-time decibel value of the ambient sound wave to be analyzed is not greater than the real-time decibel threshold of the hazard, then it is not necessary to make the unqualified power consumption target headphones perform adaptive active noise cancellation.
[0044] If the real-time decibel value of the ambient sound wave to be analyzed is greater than the real-time decibel threshold of harm, then the unqualified power consumption target headphones will be controlled to perform adaptive active noise cancellation and output real-time noise-canceling ambient sound waves.
[0045] A second aspect of the present invention also provides an adaptive active noise cancellation system for headphones based on real-time analysis of ambient sound waves. The adaptive active noise cancellation system includes a memory and a processor. The memory stores an adaptive active noise cancellation method for headphones. When the processor executes the adaptive active noise cancellation method for headphones, it performs the following steps:
[0046] Multi-channel ambient sound waves are collected, and acoustic scene classification and spatiotemporal synchronization processing are performed on the multi-channel ambient sound waves to obtain spatiotemporally synchronized multi-channel ambient sound waves.
[0047] Noise characteristics were analyzed on spatiotemporally synchronized multi-channel ambient sound waves, and the location of short-time energy change sound waves was detected on the spatiotemporally synchronized multi-channel ambient sound waves.
[0048] Based on the location of the sound wave with short-term energy change, adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are performed on the environmental sound wave to be analyzed.
[0049] During real-time noise cancellation ambient sound wave output, energy consumption monitoring and energy consumption optimization control are performed on the target headphones.
[0050] This invention addresses the technical deficiencies in the prior art and offers the following advantages: It collects ambient sound waves from inside and outside the headphones and preprocesses them to obtain spatiotemporally synchronized multi-channel ambient sound waves; it performs noise characteristic analysis on these waves, locates the positions of short-term energy-fluctuation sound waves, and performs adaptive active noise cancellation filtering; finally, it monitors and optimizes headphone energy consumption. This invention enables adaptive active noise cancellation in headphones, preventing auditory safety hazards and energy waste, thus achieving energy saving and user comfort. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained from these drawings without creative effort.
[0052] Figure 1 A flowchart of an adaptive active noise cancellation method for headphones based on real-time analysis of ambient sound waves is shown.
[0053] Figure 2 A flowchart of the method for adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering of the ambient sound wave to be analyzed is shown.
[0054] Figure 3 A program view of an adaptive active noise cancellation system for headphones based on real-time analysis of ambient sound waves is shown. Detailed Implementation
[0055] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0056] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0057] Figure 1 A flowchart illustrating an adaptive active noise cancellation method for headphones based on real-time analysis of ambient sound waves is shown, including the following steps:
[0058] Multi-channel ambient sound waves are collected, and acoustic scene classification and spatiotemporal synchronization processing are performed on the multi-channel ambient sound waves to obtain spatiotemporally synchronized multi-channel ambient sound waves.
[0059] Noise characteristics were analyzed on spatiotemporally synchronized multi-channel ambient sound waves, and the location of short-time energy change sound waves was detected on the spatiotemporally synchronized multi-channel ambient sound waves.
[0060] Based on the location of the sound wave with short-term energy change, adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are performed on the environmental sound wave to be analyzed.
[0061] During real-time noise cancellation ambient sound wave output, energy consumption monitoring and energy consumption optimization control are performed on the target headphones.
[0062] Furthermore, in a preferred embodiment of the present invention, the step of acquiring multi-channel ambient sound waves and performing acoustic scene classification and spatiotemporal synchronization processing on the multi-channel ambient sound waves to obtain spatiotemporally synchronized multi-channel ambient sound waves specifically involves:
[0063] Acquire the headphones that require adaptive active noise cancellation, designate them as target headphones, and install a microphone on the target headphones;
[0064] Among them, the microphones on the target earphone include a microphone for collecting ambient sound waves outside the target earphone and a microphone for collecting ambient sound waves inside the ear canal.
[0065] Ambient sound waves are collected in real time through the microphone of the target earphone. The ambient sound waves include ambient sound waves outside the target earphone and ambient sound waves inside the ear canal. The collected ambient sound waves are calibrated as multi-channel ambient sound waves.
[0066] Calculate the Mel-spectral coherence coefficient of multi-channel ambient sound waves, and combine the Mel-spectral coherence coefficient of multi-channel ambient sound waves to calculate the spatial and temporal characteristics of multi-channel ambient sound waves.
[0067] The spatial and temporal characteristics of multi-channel ambient sound waves are aligned in real time to ensure that the multi-channel ambient sound waves are spatiotemporally synchronized in different times and spaces, thus obtaining spatiotemporally synchronized multi-channel ambient sound waves.
[0068] It should be noted that ambient sound waves include both those outside and inside the headphones. The ambient sound waves inside the headphones refer to the sound within the ear canal after the headphones are worn. Therefore, it is necessary to collect both the external and internal sounds using different microphones. Because both external and internal sounds are collected, the ambient sound waves are multi-channel. Preprocessing of these multi-channel ambient sound waves is required, including spatiotemporal synchronization. This aims to synchronize the arrival time differences of the sound waves, ensuring synchronization rate and accuracy during noise reduction. The Mel-spectral coherence coefficients of the multi-channel ambient sound waves are calculated to enhance temporal and spatial characteristics and are used to construct a feature matrix. Spatiotemporal synchronization can only be performed after the feature matrix is constructed. The spatiotemporal synchronization method involves fusing the features to obtain spatiotemporally synchronized multi-channel ambient sound waves.
[0069] Furthermore, in a preferred embodiment of the present invention, the step of performing noise feature analysis on spatiotemporally synchronized multi-channel ambient sound waves and detecting the location of short-time energy change sound waves on the spatiotemporally synchronized multi-channel ambient sound waves specifically includes:
[0070] The Hanning window algorithm is introduced to perform frame-by-frame windowing processing on the spatiotemporally synchronized multi-channel ambient sound waves, and the windowed spatiotemporally synchronized multi-channel ambient sound waves are obtained and calibrated as the ambient sound waves to be analyzed.
[0071] Determine the signal-to-noise ratio (SNR) of the ambient sound wave to be analyzed, determine the weighted average weight of the ambient sound wave to be analyzed based on the SNR, perform weighted averaging, construct the multi-window spectrum of the ambient sound wave to be analyzed, and calibrate it as the target spectrum.
[0072] The harmonic consistency of the target spectrum is verified, and the frequency group with the highest energy that satisfies the harmonic consistency in the target spectrum is selected to obtain the main frequency of the ambient sound wave to be analyzed, which is then calibrated as the target main frequency.
[0073] By combining the target main frequency and the target spectrum, the energy of the ambient sound wave to be analyzed is calculated, and an energy threshold is preset. The location in the ambient sound wave to be analyzed where the energy is greater than the energy threshold is determined and marked as the location of the energy change to be analyzed.
[0074] The mutation difference is calculated for all energy mutation locations to be analyzed, and the locations with mutation differences greater than a preset value are retrieved from all energy mutation locations to be analyzed and marked as short-time energy mutation sound wave locations.
[0075] It should be noted that the Hanning window is a cosine squared window function used to process continuous audio signals. Its function is to suppress spectral leakage of sound waves, maintain frequency resolution, and achieve smooth transitions between audio frames. In this application, Hanning windowing is used for frame-by-frame windowing to make the ambient sound waves smoother during noise reduction and avoid splicing noise generation. The method for determining the signal-to-noise ratio (SNR) of the ambient sound wave to be analyzed is to calculate the time domain of the sound wave signal, which is the ratio of signal to noise. The weighted average processing of the sound waves after determining the SNR is used to construct the spectrum for extracting the frequency signals of the sound waves. Harmonic consistency verification is performed on the target spectrum. Harmonics are considered noise. By checking the peak positions of the sound wave frequencies in the target spectrum and combining them with the fundamental frequency, the harmonics are immediately calculated. After multiple checks, if the harmonics maintain a certain value, harmonic consistency is satisfied. At this point, the energy of the ambient sound wave needs to be calculated; that is, the energy will be higher if noise is present during the output process. If the energy is higher at certain locations, it indicates that there is more noise at those locations, and noise reduction processing needs to be performed on the corresponding locations of the sound wave. The location of the short-term energy mutation sound wave is indicated by a sudden and significant change in energy at that location, suggesting a large amount of sudden noise. This location is the location of the short-term energy mutation sound wave and requires special attention for noise reduction, as suddenly generated noise can easily affect the user experience or even cause danger.
[0076] Furthermore, in a preferred embodiment of the present invention, the step of monitoring and optimizing the energy consumption of the target headphones during real-time noise reduction ambient sound wave output specifically includes:
[0077] By introducing spectral subtraction, residual noise is eliminated from the ambient sound waves in real-time noise reduction, while simultaneously acquiring the surrounding environmental parameters of the target earphone.
[0078] Calculate the real-time energy consumption change data of the target headphones when processing real-time noise-canceling ambient sound waves, and construct a real-time energy consumption change curve;
[0079] A preset standard energy consumption threshold is set, and the real-time energy consumption change curve is analyzed to determine whether the real-time energy consumption of the target earphone is always maintained within the standard energy consumption threshold.
[0080] If so, the target earphone is calibrated as a qualified energy consumption target earphone and maintained in operation as a qualified energy consumption target earphone to achieve adaptive active noise cancellation to ambient sound waves;
[0081] If not, the target earphone is marked as an unqualified energy consumption target earphone, and the grey relational method is introduced to calculate the grey relational value between the real-time energy consumption of the unqualified energy consumption target earphone and the corresponding surrounding environmental parameters, which is marked as the first grey relational value.
[0082] A gray correlation threshold is preset. If the first gray correlation value remains within the gray correlation threshold, it is determined that the real-time energy consumption of the unqualified energy consumption target headphones is affected by the corresponding surrounding environmental parameters. A scheme to protect the unqualified energy consumption target headphones from the corresponding surrounding environmental parameters is introduced and output.
[0083] If the first gray correlation value is not maintained within the gray correlation threshold, the unqualified energy consumption target headphones are controlled to perform real-time decibel calculation on the ambient sound wave to be analyzed, and the real-time decibel value of the ambient sound wave to be analyzed is determined.
[0084] If the real-time decibel threshold of the hazard is preset, and the real-time decibel value of the ambient sound wave to be analyzed is not greater than the real-time decibel threshold of the hazard, then it is not necessary to make the unqualified power consumption target headphones perform adaptive active noise cancellation.
[0085] If the real-time decibel value of the ambient sound wave to be analyzed is greater than the real-time decibel threshold of harm, then the unqualified power consumption target headphones will be controlled to perform adaptive active noise cancellation and output real-time noise-canceling ambient sound waves.
[0086] It's important to note that spectral subtraction can remove residual noise from the ambient sound waves in real-time noise cancellation, ensuring a clearer, noise-free environment. Headphone power consumption also needs to be calculated. Higher power consumption leads to faster battery drain, which is detrimental to energy conservation. Furthermore, higher power consumption indicates the headphones are constantly in noise cancellation mode and not adaptively noise-canceling. Headphones with adaptive noise cancellation should have lower power consumption. After calculating the target headphone's power consumption, the relationship between power consumption and a standard threshold is determined. If the power consumption is within the threshold, it indicates normal power consumption, and the headphones are considered to have acceptable power consumption. Headphone power consumption may be related to ambient environmental parameters. For example, higher ambient temperatures can cause the headphones to generate more heat, increasing power consumption and speeding up battery drain. Grey relational analysis can calculate the correlation between headphone power consumption and environmental parameters. A correlation greater than a preset value indicates abnormal headphone power consumption related to environmental parameters, requiring measures to mitigate the influence of environmental parameters and ensure the headphone power consumption returns to normal. If the correlation is less than a preset value, the decibel level of the ambient sound wave needs to be determined to decide whether noise cancellation is necessary. If the decibel value is high, noise reduction processing must be performed, otherwise it will damage the user's hearing; otherwise, it is not necessary, which can achieve the goal of reducing energy consumption.
[0087] Figure 2 The flowchart illustrates a method for adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering of the ambient sound wave to be analyzed, including the following steps:
[0088] S202: Combining the location of short-time energy change sound waves, adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are performed on the environmental sound waves to be analyzed.
[0089] S204: Adaptive steady-state noise reduction filtering is applied to the ambient sound waves to be analyzed, while adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are mixed.
[0090] Furthermore, in a preferred embodiment of the present invention, the adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering of the ambient sound wave to be analyzed, based on the location of the short-time energy change sound wave, specifically includes:
[0091] A dynamic filter module is acquired and connected to the target earphone, enabling the dynamic filter module to perform filtering on the target earphone.
[0092] The location distribution of short-time energy change sound wave locations in the environmental sound wave to be analyzed is performed, the distribution interval between different short-time energy change sound wave locations is calculated, and the minimum distribution interval is preset.
[0093] If the distribution interval between different short-time energy change sound wave locations is not less than the minimum distribution interval, then adaptive steady-state noise reduction filtering is required for the environmental sound wave to be analyzed. If the distribution interval between different short-time energy change sound wave locations is greater than the minimum distribution interval, then adaptive transient noise reduction filtering is required for the environmental sound wave to be analyzed.
[0094] If adaptive transient noise reduction filtering is required for the ambient sound wave to be analyzed, the main frequency and target spectrum of the ambient sound wave to be analyzed are imported into the dynamic filtering module in real time for nonlinear phase compensation.
[0095] The nonlinear phase compensation involves pre-distorting the ambient sound wave to be analyzed, calculating the phase compensation value of the ambient sound wave to be analyzed, and applying the phase compensation value of the ambient sound wave to be analyzed to the target earphone in real time through a dynamic filtering module, thereby realizing adaptive transient noise reduction filtering of the ambient sound wave to be analyzed.
[0096] If adaptive steady-state noise reduction filtering is required for the ambient sound waves to be analyzed, then adaptive steady-state noise reduction filtering is applied to the ambient sound waves to be analyzed, and adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are mixed.
[0097] It should be noted that adaptive noise reduction processing of the ambient sound wave under analysis needs to be performed in conjunction with the location of short-term energy mutations in the sound wave. The choice between adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering is determined based on the distribution interval between the locations of different short-term energy mutations. If the distribution interval is small, steady-state filtering is used because it indicates frequent noise mutations, requiring smooth and continuous noise reduction filtering. Conversely, if the distribution interval is large, it indicates that the noise usually appears suddenly and has low continuity; in this case, transient noise reduction filtering can achieve the purpose of adaptive noise reduction while also saving energy. Adaptive transient noise reduction filtering involves real-time phase compensation of the sound wave signal. The real-time phase and the phase difference to be compensated can be determined based on the dominant frequency of the ambient sound wave under analysis and the target spectrum. Pre-distortion processing is used to calculate the nonlinear phase compensation value, and the dynamic filtering module can filter high-frequency, high-energy sound waves.
[0098] Furthermore, in a preferred embodiment of the present invention, the adaptive steady-state noise reduction filtering is applied to the ambient sound wave to be analyzed, and the adaptive transient noise reduction filtering and the adaptive steady-state noise reduction filtering are mixed and processed, specifically as follows:
[0099] An improved FxLMS algorithm is introduced into the dynamic filtering module. Through the improved FxLMS algorithm, the target spectrum step size of the ambient sound wave to be analyzed is updated within the dynamic filtering module, and energy leakage control is performed on the ambient sound wave to be analyzed during the target spectrum compensation update process.
[0100] The energy leakage control of the ambient sound wave to be analyzed is to control the energy of the target spectrum of the ambient sound wave to be analyzed to always keep it within the energy threshold.
[0101] In the dynamic filtering module, the distribution interval between the locations of different short-time energy change sound waves is analyzed in real time, and adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are switched in real time based on the distribution interval.
[0102] The ambient sound waves to be analyzed, after being filtered by adaptive transient noise reduction and adaptive steady-state noise reduction respectively, are multi-band synthesized, and the multi-band synthesized ambient sound waves to be analyzed are calibrated as real-time noise-reduced ambient sound waves.
[0103] It should be noted that for adaptive steady-state noise reduction filtering, the improved FxLMS algorithm involves updating the sound wave with a variable step size. By changing the step size of the sound wave, energy leakage control is achieved, preventing sudden energy overflow during transmission. Continuously controlling leakage enables adaptive steady-state noise reduction filtering. Real-time analysis of the distribution interval is needed to switch between different filtering methods, as the sound wave will not always be in a state of small or large distribution intervals. If there are occasional small distribution intervals, and energy leakage control has been applied continuously, a steady-state to transient noise reduction filtering process is required to achieve adaptive noise reduction and reduce energy consumption. The sound waves obtained from different noise reduction filtering methods need to be synthesized into a single sound wave. Multi-band synthesis can achieve this. Finally, the sound waves obtained from different noise reduction filtering methods are combined to output a real-time noise-reduced ambient sound wave.
[0104] like Figure 3 As shown, the second aspect of the present invention also provides an adaptive active noise cancellation system for headphones based on real-time analysis of ambient sound waves. The adaptive active noise cancellation system for headphones includes a memory 31 and a processor 32. The memory 31 stores an adaptive active noise cancellation method for headphones. When the adaptive active noise cancellation method for headphones is executed by the processor 32, it implements the following steps:
[0105] Multi-channel ambient sound waves are collected, and acoustic scene classification and spatiotemporal synchronization processing are performed on the multi-channel ambient sound waves to obtain spatiotemporally synchronized multi-channel ambient sound waves.
[0106] Noise characteristics were analyzed on spatiotemporally synchronized multi-channel ambient sound waves, and the location of short-time energy change sound waves was detected on the spatiotemporally synchronized multi-channel ambient sound waves.
[0107] Based on the location of the sound wave with short-term energy change, adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are performed on the environmental sound wave to be analyzed.
[0108] During real-time noise cancellation ambient sound wave output, energy consumption monitoring and energy consumption optimization control are performed on the target headphones.
[0109] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A headphone adaptive active noise cancellation method based on real-time analysis of ambient sound waves, characterized in that, Includes the following steps: Multi-channel ambient sound waves are collected, and acoustic scene classification and spatiotemporal synchronization processing are performed on the multi-channel ambient sound waves to obtain spatiotemporally synchronized multi-channel ambient sound waves, specifically: Acquire the headphones that require adaptive active noise cancellation, designate them as target headphones, and install a microphone on the target headphones; Among them, the microphones on the target earphone include a microphone for collecting ambient sound waves outside the target earphone and a microphone for collecting ambient sound waves inside the ear canal. Ambient sound waves are collected in real time through the microphone of the target earphone. The ambient sound waves include ambient sound waves outside the target earphone and ambient sound waves inside the ear canal. The collected ambient sound waves are calibrated as multi-channel ambient sound waves. Calculate the Mel-spectral coherence coefficient of multi-channel ambient sound waves, and combine the Mel-spectral coherence coefficient of multi-channel ambient sound waves to calculate the spatial and temporal characteristics of multi-channel ambient sound waves. Real-time alignment of the spatial and temporal characteristics of multi-channel ambient sound waves ensures that the multi-channel ambient sound waves are spatiotemporally synchronized in different times and spaces, resulting in spatiotemporally synchronized multi-channel ambient sound waves. Noise characteristic analysis was performed on spatiotemporally synchronized multi-channel ambient sound waves, and the locations of short-time energy change sound waves were detected on the spatiotemporally synchronized multi-channel ambient sound waves. Specifically: The Hanning window algorithm is introduced to perform frame-by-frame windowing processing on spatiotemporally synchronized multi-channel ambient sound waves, resulting in windowed spatiotemporally synchronized multi-channel ambient sound waves, which are then calibrated as the ambient sound waves to be analyzed. Determine the signal-to-noise ratio (SNR) of the ambient sound wave to be analyzed, determine the weighted average weight of the ambient sound wave to be analyzed based on the SNR, perform weighted averaging, construct the multi-window spectrum of the ambient sound wave to be analyzed, and calibrate it as the target spectrum. The harmonic consistency of the target spectrum is verified, and the frequency group with the highest energy that satisfies the harmonic consistency in the target spectrum is selected to obtain the main frequency of the ambient sound wave to be analyzed, which is then calibrated as the target main frequency. By combining the target main frequency and the target spectrum, the energy of the ambient sound wave to be analyzed is calculated, and an energy threshold is preset. The location in the ambient sound wave to be analyzed where the energy is greater than the energy threshold is determined and marked as the location of the energy change to be analyzed. The mutation difference is calculated for all energy mutation locations to be analyzed, and the locations with mutation differences greater than a preset value are retrieved from all energy mutation locations to be analyzed and marked as short-time energy mutation sound wave locations; Based on the location of the sound wave with short-term energy mutation, adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are performed on the environmental sound wave to be analyzed, specifically as follows: A dynamic filter module is acquired and connected to the target earphone, enabling the dynamic filter module to perform filtering on the target earphone. The location distribution of short-time energy change sound wave locations in the environmental sound wave to be analyzed is performed, the distribution interval between different short-time energy change sound wave locations is calculated, and the minimum distribution interval is preset. If the distribution interval between different short-time energy change sound wave locations is not less than the minimum distribution interval, then adaptive transient noise reduction filtering is required for the environmental sound wave to be analyzed. If the distribution interval between different short-time energy change sound wave locations is less than the minimum distribution interval, then adaptive steady-state noise reduction filtering is required for the environmental sound wave to be analyzed. During real-time noise cancellation ambient sound wave output, energy consumption monitoring and energy consumption optimization control are performed on the target headphones.
2. The adaptive active noise cancellation method for headphones based on real-time analysis of ambient sound waves as described in claim 1, characterized in that, The adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering of the ambient sound wave to be analyzed, based on the location of the short-time energy change sound wave, also includes: If adaptive transient noise reduction filtering is required for the ambient sound wave to be analyzed, the main frequency and target spectrum of the ambient sound wave to be analyzed are imported into the dynamic filter module in real time for nonlinear phase compensation. The nonlinear phase compensation involves pre-distorting the ambient sound wave to be analyzed, calculating the phase compensation value of the ambient sound wave to be analyzed, and applying the phase compensation value of the ambient sound wave to be analyzed to the target earphone in real time through a dynamic filter module, thereby realizing adaptive transient noise reduction filtering of the ambient sound wave to be analyzed. If adaptive steady-state noise reduction filtering is required for the ambient sound waves to be analyzed, then adaptive steady-state noise reduction filtering is applied to the ambient sound waves to be analyzed, and adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are mixed.
3. The adaptive active noise cancellation method for headphones based on real-time analysis of ambient sound waves as described in claim 2, characterized in that, The environmental sound waves to be analyzed are subjected to adaptive steady-state noise reduction filtering, and the adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are mixed and processed, specifically as follows: An improved FxLMS algorithm is introduced into the dynamic filter module. Through the improved FxLMS algorithm, the target spectrum of the ambient sound wave to be analyzed is updated with a variable step size within the dynamic filter module. During the target spectrum update process, energy leakage control is performed on the ambient sound wave to be analyzed. The energy leakage control of the ambient sound wave to be analyzed is to control the energy of the target spectrum of the ambient sound wave to be analyzed to always keep it within the energy threshold. In the dynamic filter module, the distribution interval between the locations of different short-time energy change sound waves is analyzed in real time, and adaptive transient noise reduction filtering and adaptive steady-state noise reduction filtering are switched in real time based on the distribution interval. The ambient sound waves to be analyzed, after being filtered by adaptive transient noise reduction and adaptive steady-state noise reduction respectively, are multi-band synthesized, and the multi-band synthesized ambient sound waves to be analyzed are calibrated as real-time noise-reduced ambient sound waves.
4. The adaptive active noise cancellation method for headphones based on real-time analysis of ambient sound waves as described in claim 1, characterized in that, The process of monitoring and optimizing the energy consumption of the target headphones during real-time noise reduction ambient sound wave output specifically involves: By introducing spectral subtraction, residual noise is eliminated from the ambient sound waves in real-time noise reduction, while simultaneously acquiring the surrounding environmental parameters of the target earphone. Calculate the real-time energy consumption change data of the target headphones when processing real-time noise-canceling ambient sound waves, and construct a real-time energy consumption change curve; A preset standard energy consumption threshold is set, and the real-time energy consumption change curve is analyzed to determine whether the real-time energy consumption of the target earphone is always maintained within the standard energy consumption threshold. If so, the target earphone is calibrated as a qualified energy consumption target earphone and maintained in operation as a qualified energy consumption target earphone to achieve adaptive active noise cancellation to ambient sound waves; If not, the target earphone is marked as an unqualified energy consumption target earphone, and the grey relational method is introduced to calculate the grey relational value between the real-time energy consumption of the unqualified energy consumption target earphone and the corresponding surrounding environmental parameters, which is marked as the first grey relational value. A gray correlation threshold is preset. If the first gray correlation value remains within the gray correlation threshold, it is determined that the real-time energy consumption of the unqualified energy consumption target headphones is affected by the corresponding surrounding environmental parameters. A scheme to protect the unqualified energy consumption target headphones from the corresponding surrounding environmental parameters is introduced and output. If the first gray correlation value is not maintained within the gray correlation threshold, the unqualified energy consumption target headphones are controlled to perform real-time decibel calculation on the ambient sound wave to be analyzed, and the real-time decibel value of the ambient sound wave to be analyzed is determined. If the real-time decibel threshold of the hazard is preset, and the real-time decibel value of the ambient sound wave to be analyzed is not greater than the real-time decibel threshold of the hazard, then it is not necessary to make the unqualified power consumption target headphones perform adaptive active noise cancellation. If the real-time decibel value of the ambient sound wave to be analyzed is greater than the real-time decibel threshold of harm, then the unqualified power consumption target headphones will be controlled to perform adaptive active noise cancellation and output real-time noise-canceling ambient sound waves.
5. An adaptive active noise cancellation system for headphones based on real-time analysis of ambient sound waves, characterized in that, The headphone adaptive active noise cancellation system includes a memory and a processor. The memory stores a headphone adaptive active noise cancellation method program. When the headphone adaptive active noise cancellation method program is executed by the processor, the headphone adaptive active noise cancellation method steps as described in any one of claims 1-4 are implemented.