A deep learning-based active noise reduction earphone environment adaptive control method and system
Patent Information
- Application Number
- CN202611149448.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-10-16
AI Technical Summary
这种处理方式导致系统对噪声所处环境的类型切换感知不敏锐,进而影响后续参数调整的准确性
[0024] By applying a stepped attenuation to frequency bands on the same side of the deviation direction and distance from the centroid, while maintaining the original weights on the opposite side to generate feature tensors, the problem of fixed-band features being unable to perceive spectral centroid drift is overcome, achieving adaptive correlation between feature and noise distribution shift. By inputting the feature tensor into a lightweight network after pruning and 8-bit integer quantization, the time consumption of a single inference is made less than the feedback control interruption cycle, overcoming the problem that full-precision models cannot be deployed in real time on low-power chips, and achieving timing matching between network inference and control cycles. By accumulating the offset values of the network output point by point and updating the filter coefficients with amplitude limiting, followed by convolution filtering to generate anti-noise waves, the problem that fixed coefficients cannot track rapid changes in noise is overcome, achieving real-time coefficient updates and low-latency noise reduction output driven by deep models.
Smart Images

Figure CN122930003A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to an active noise-canceling headphone environment adaptive control method and system based on deep learning. Background Technology
[0002] Currently, most active noise-canceling headphones on the market use fixed-parameter filters to generate anti-noise waves. The parameters of these filters are typically determined in a laboratory setting for specific steady-state noise environments. Taking subway commuting as an example, the ambient noise inside the carriage is mainly low-frequency rumbling, with a relatively stable spectral distribution, allowing fixed-parameter filters to provide a good noise-canceling experience. However, when users exit the subway station and enter the street, the sound environment transforms into a complex noise source including vehicle noise, horns, and pedestrian conversations, resulting in a significant change in the spectral distribution. Because the frequency response characteristics of fixed-parameter filters cannot automatically adjust to changes in the noise environment, their noise-canceling effect will show a noticeable drop.
[0003] Some existing solutions attempt to introduce environmental feature recognition mechanisms, that is, to collect noise energy values of each frequency band as environmental features and then adjust filter parameters accordingly. However, these solutions directly input the energy values of each frequency band into the decision model without modification. The system only sees a series of isolated values, rather than the crucial information of whether the noise energy is biased towards low or high frequencies in the spectrum. This processing method makes the system less sensitive to changes in the type of noise environment, thus affecting the accuracy of subsequent parameter adjustments. Summary of the Invention
[0004] This invention provides a deep learning-based active noise-canceling headphone environment adaptive control method and system, which can realize real-time adaptive updating of filter coefficients under the limited computing power of headphone chips and maintain a stable noise reduction effect when switching between different noise scenarios.
[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0006] Firstly, a deep learning-based active noise-canceling headphone environment adaptive control method, the method comprising:
[0007] Ambient noise sound waves are picked up by a microphone located on the outside of the active noise-canceling headphones and converted into digital input signals; the digital input signals are preprocessed to obtain normalized frequency band energy values.
[0008] Based on the direction and distance of the distribution centroid of the normalized frequency band energy value in the frequency domain coordinates from the preset reference position, attenuation weights are applied to the frequency band energy values on the same side of the deviation direction and far from the distribution centroid, while the original weights are maintained for the frequency band energy values on the opposite side of the deviation direction, thus generating an environmental feature tensor.
[0009] The environmental feature tensor is input into a pre-constructed lightweight deep neural network, wherein the lightweight deep neural network is a compressed model obtained by pruning and parameter quantization of the original network to an eight-bit integer, and the compressed model has a single forward inference time on the chip that is less than a preset feedback control interruption cycle.
[0010] A lightweight deep neural network performs forward operations on the environmental feature tensor and outputs digital filter coefficient offset values.
[0011] The current tap coefficients of the finite impulse response filter, which are pre-stored in the random access memory of the audio processing chip, are retrieved and then accumulated point by point according to the digital filter coefficient offset value and the current tap coefficients to obtain the updated tap coefficients.
[0012] The digital input signal is convolutionally filtered by the updated tap coefficients to generate a digital noise-resistant wave signal. After digital-to-analog conversion and power amplification, the signal is radiated outward through the headphone speaker to cancel out the ambient noise picked up by the microphone.
[0013] Secondly, a deep learning-based active noise-canceling headphone environmental adaptive control system includes:
[0014] The conversion module is used to pick up ambient noise sound waves through a microphone located on the outside of the active noise-canceling headphones and convert them into digital input signals; the digital input signals are preprocessed to obtain normalized frequency band energy values;
[0015] The calculation module is used to apply attenuation weights to the frequency band energy values that are on the same side of the deviation direction and far from the distribution centroid of the normalized frequency band energy values in the frequency domain coordinates, based on the direction and distance of the centroid of the distribution deviation from the preset reference position, while maintaining the original weights for the frequency band energy values on the opposite side of the deviation direction, and generating an environmental feature tensor.
[0016] The input module is used to input environmental feature tensors into a pre-built lightweight deep neural network, wherein the lightweight deep neural network is a compressed model obtained by pruning and parameter quantization of the original network to an eight-bit integer, and the compressed model has a single forward inference time on the chip that is less than a preset feedback control interruption cycle.
[0017] The accumulation module is used to perform forward operations on the environmental feature tensor by a lightweight deep neural network and output the digital filter coefficient offset value; it retrieves the current tap coefficient of the finite impulse response filter pre-stored in the random access memory of the audio processing chip, and accumulates it point by point according to the digital filter coefficient offset value and the current tap coefficient to obtain the updated tap coefficient;
[0018] The update module is used to perform convolution filtering on the digital input signal with the updated tap coefficients to generate a digital noise-resistant wave signal. After digital-to-analog conversion and power amplification, the signal is radiated outward through the headphone speaker to cancel out the ambient noise picked up by the microphone.
[0019] Thirdly, a computing device, comprising:
[0020] One or more processors;
[0021] A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method.
[0022] Fourthly, a computer-readable storage medium storing a program that, when executed by a processor, implements the method.
[0023] The above-described solution of the present invention has at least the following beneficial effects:
[0024] By applying a stepped attenuation to frequency bands on the same side of the deviation direction and distance from the centroid, while maintaining the original weights on the opposite side to generate feature tensors, the problem of fixed-band features being unable to perceive spectral centroid drift is overcome, achieving adaptive correlation between feature and noise distribution shift. By inputting the feature tensor into a lightweight network after pruning and 8-bit integer quantization, the time consumption of a single inference is made less than the feedback control interruption cycle, overcoming the problem that full-precision models cannot be deployed in real time on low-power chips, and achieving timing matching between network inference and control cycles. By accumulating the offset values of the network output point by point and updating the filter coefficients with amplitude limiting, followed by convolution filtering to generate anti-noise waves, the problem that fixed coefficients cannot track rapid changes in noise is overcome, achieving real-time coefficient updates and low-latency noise reduction output driven by deep models. Attached Figure Description
[0025] Figure 1 This is a flowchart illustrating an active noise-canceling headphone environment adaptive control method based on deep learning, provided by an embodiment of the present invention.
[0026] Figure 2 This is a schematic diagram of an active noise-canceling headphone environment adaptive control system based on deep learning, provided by an embodiment of the present invention.
[0027] Figure 3 This is a schematic diagram of the process by which the lightweight deep neural network performs forward operations on the environmental feature tensor and outputs digital filter coefficient offset values, according to an embodiment of the present invention. Detailed Implementation
[0028] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0029] like Figures 1 to 3 As shown, an embodiment of the present invention proposes a deep learning-based active noise-canceling headphone environment adaptive control method, applied to the left ear unit of an in-ear active noise-canceling wireless headphone. An acoustic duct is provided on the outer shell of the left ear unit, and a microelectromechanical system (MEMS) microphone is embedded inside the duct, connecting to the analog input channel of the audio codec chip in the headphone's main control unit.
[0030] The audio codec chip is a low-power audio codec integrating a 24-bit analog-to-digital converter and a digital-to-analog converter. Its internal analog-to-digital converter supports a maximum sampling rate of 96,000 Hz, and in this embodiment, it is configured with a first sampling rate of 48,000 Hz. The digital audio interface of the audio codec chip is connected to a Bluetooth audio system-on-a-chip via the integrated circuit's built-in audio bus (i.e., a serial bus protocol for inter-chip digital audio data transmission, hereinafter referred to as the I²S bus).
[0031] This Bluetooth audio system-on-a-chip integrates a 32-bit RISC processor core, a digital signal processor core, a neural network accelerator engine, and 512 kilobytes of on-chip static random access memory (SRAM, also known as on-chip SRAM, which is a high-speed memory directly integrated inside the chip and can be read and written by the processor in one clock cycle). In this embodiment, the operating frequency of the digital signal processor core is set to 240 MHz.
[0032] The following content has been pre-loaded from external flash memory into the on-chip SRAM of the Bluetooth audio system-on-a-chip:
[0033] A lightweight deep neural network model has been trained and pruned, and its parameters have been quantized. This model is a feedforward fully connected network, consisting of one input layer, three hidden layers, and one output layer. The input layer has 24 nodes, corresponding to the dimensions of the 24-dimensional environment feature tensor generated in subsequent steps. The three hidden layers have 48, 32, and 32 nodes respectively, and a linear rectified function is used as the activation function between each hidden layer; that is, a non-linear transformation where the output is 0 when the input value is less than zero and the original value when the input value is greater than zero. The output layer has 128 nodes, corresponding to the number of taps in the finite impulse response filter used in subsequent steps, and each output node outputs a coefficient offset corresponding to the tap position. The training process of this model is as follows:
[0034] A noise sample set covering various typical environmental noises (including traffic noise, crowd noise, air conditioning steady-state noise, and wind noise) is used as training data. The 24 normalized frequency band energy values obtained from the preprocessing operations described in this step are used as network input. The difference between the optimal tap coefficients of the finite impulse response filter (FIR) determined manually under the corresponding noise environment and the baseline coefficients is used as the training target labels. Training employs an error backpropagation strategy: the mean squared error between the predicted vector of coefficient offset values from the network output and the target label vector is used as the loss function. The gradient of the loss function with respect to the connection weights of each layer is calculated, and the connection weights of each layer are updated along the gradient descent direction. Training terminates when the decrease in the loss function on the validation set falls below a preset threshold for several consecutive rounds. During training, regularization is implemented by randomly setting the output of hidden layer nodes to zero with a preset probability to suppress overfitting to the training noise samples.
[0035] After training, all connection weights of the model undergo post-training quantization, compressing them from the original 32-bit floating-point format to an 8-bit integer format (i.e., each weight value is stored as an 8-bit integer, ranging from -128 to +127), and stored in the model weight area of the on-chip SRAM. The compressed model, after pruning and quantization, has a single forward inference time on the Bluetooth audio system-on-a-chip that is less than the preset feedback control interrupt cycle, thus meeting the real-time constraints of the active noise cancellation system. A set of initial tap coefficients for a finite impulse response filter is also included. The initial tap coefficients are baseline coefficients calibrated in an anechoic chamber environment for pink noise spectrum (i.e., broadband noise signals whose power spectral density is inversely proportional to frequency, with equal energy in each octave, often used to simulate background noise with a uniform spectral distribution in natural environments), with 128 taps; a Hanning window function coefficient lookup table containing 256 floating-point coefficient values for subsequent time-domain windowing operations; and a sub-band division lookup table defining the boundary frequency index numbers of 24 sub-bands divided according to the one-third octave rule from 0 Hz to the Nyquist frequency range. One-third octave is a frequency division method designed based on the frequency perception characteristics of human hearing. The ratio of the center frequencies of adjacent sub-bands is 2 to the power of one-third (approximately 1.26 times), and the bandwidth of each sub-band is proportional to its center frequency; the higher the center frequency, the wider the absolute bandwidth of the sub-band.
[0036] In addition, the on-chip SRAM also includes the following runtime buffers: a double buffer with a length of 256 sampling points for temporarily storing digital input signal frames output by the analog-to-digital converter; a fast Fourier transform input buffer with a length of 256 floating-point values; and a buffer for storing 128-point intermediate frequency domain energy calculation results.
[0037] Step 1: The ambient noise sound waves are picked up by the microphone set on the outside of the active noise-canceling headphones and converted into digital input signals; the digital input signals are preprocessed to obtain normalized frequency band energy values. The specific implementation process is as follows.
[0038] In operation, the external microphone continuously picks up ambient noise waves from the environment outside the headphones. Under the pressure of the sound waves, the microphone diaphragm generates a weak analog voltage signal proportional to the sound pressure. This analog voltage signal undergoes impedance transformation and primary amplification by the microphone's built-in preamplifier before being transmitted to the analog input pin of the audio codec chip via a flexible printed circuit board. The analog-to-digital converter (ADC) inside the audio codec chip discretely samples the input analog signal at a first sampling rate. Within each sampling period, the ADC samples and holds the instantaneous amplitude of the analog voltage signal and quantizes it, converting continuous analog voltage values into 24-bit signed integer digital values. A quantization precision of 24 bits means that each sample value can be selected from approximately 16.77 million discrete levels. The ADC arranges the continuously output 24-bit sample values in chronological order as a sampled value stream, which is the digital input signal. The digital input signal refers to the discrete digital sample value sequence output from the analog-to-digital converter, arranged in chronological order of sampling time. Each sample value represents the quantized representation of the sound pressure picked up by the external microphone at the corresponding moment in the digital domain, and is the input starting point for all subsequent digital signal processing links. The digital input signal is transferred to a pre-allocated double buffer in the on-chip SRAM of the Bluetooth audio system-on-a-chip via the I²S bus using direct memory access.
[0039] When 256 sample values accumulate in the double buffer, a frame ready interrupt is triggered. After the digital signal processor core responds to the interrupt, it extracts the 256 consecutive sample values in the double buffer as a whole processing frame and fills the 256 sample values one by one into the Fast Fourier Transform input buffer.
[0040] During the filling process, the digital signal processor core performs floating-point normalization on each sample value: dividing the 24-bit signed integer sample value by 2 to the power of 23 yields a floating-point normalized sample value ranging from approximately -1.0 to +1.0. The purpose of this normalization operation is to map the original sample values, which have significant amplitude differences at different sound pressure levels, to the same numerical range, so that subsequent frequency domain analysis is not affected by the absolute amplitude differences of the original signal.
[0041] After normalization, the digital signal processor core calls the Hanning window function coefficients pre-stored in the lookup table. Framing involves dividing a continuous stream of sampled values into contiguous data blocks according to a preset frame length. Each data block is called a processing frame. Framing is a preparatory operation for frequency domain analysis. The larger the frame length, the higher the frequency resolution, but the lower the time resolution. In this embodiment, a frame length of 256 points is chosen to achieve a balance between the frequency resolution required in the headphone noise reduction scenario and the real-time response of the system.
[0042] The Hanning window function is a commonly used slowly varying window function in digital signal processing: at the beginning and end of a frame, the window function coefficients are close to 0; in the middle region of the frame, the window function coefficients are close to 1.0. When the sampled values at the beginning and end of the analyzed frame are weighted by window coefficients close to zero, the boundaries between frames become smoother, thereby suppressing the spectral leakage phenomenon caused by frame truncation in the frequency domain (i.e., the phenomenon where signal energy diffuses from its original frequency position to adjacent frequency positions, leading to distortion of the spectral analysis results).
[0043] The digital signal processor (DSP) core takes the 256 coefficient values from the Hanning window function lookup table, multiplies them point-by-point with the normalized sampled values at the corresponding indexes in the Fast Fourier Transform (FFT) input buffer, and writes the product back to the same index position in the FFT input buffer, completing the windowing operation. The DSP core then calls its hardware-accelerated FFT engine to perform a 256-point real-to-complex FFT on the windowed 256 normalized sampled values. The FFT is an algorithm that efficiently converts discrete-time signals to the frequency domain. Its input is 256 sequentially arranged real sampled values in the time domain, and its output is 128 complex frequency values in the frequency domain, each composed of a real part and an imaginary part. The 128 frequency points are evenly distributed between 0 Hz and 24000 Hz (i.e., the Nyquist frequency, which is the highest signal frequency that can be restored without distortion when sampled at the first sampling rate according to the sampling theorem). The frequency interval between adjacent frequency points is 93.75 Hz (i.e., the first sampling rate divided by the frame length). This frequency interval is called the frequency resolution.
[0044] For each complex output at a frequency point, the digital signal processor (DSP) core calculates its amplitude value: first, it calculates the square of the real part and the square of the imaginary part of the complex number at that frequency point; then, it adds the two squared values to obtain a sum; finally, it calculates the square root of the sum, and the square root is the amplitude value at that frequency point. This amplitude value characterizes the energy intensity of the corresponding frequency component in the ambient noise; the larger the amplitude value, the more prominent the frequency component is in the current ambient noise. The DSP core sequentially stores the amplitude values of the 128 frequency points into the intermediate calculation result buffer of the frequency domain energy.
[0045] The digital signal processor core calls the sub-band division boundary frequency index number pre-stored in the lookup table. A sub-band refers to several frequency intervals formed by merging the various frequency points output by the Fast Fourier Transform according to a preset frequency division rule. In this embodiment, the one-third octave rule is used to merge the 128 original frequency points into 24 sub-bands. The merging operation reduces the dimensionality of the subsequent deep neural network input feature vector while retaining the main structural features of the noise spectrum energy distribution.
[0046] The sub-band lookup table stores information for each sub-band in binary format: the first item is the starting frequency index number of the sub-band, and the second item is the ending frequency index number of the sub-band. Starting from the first sub-band, the digital signal processor core sequentially reads the starting and ending frequency index numbers of each sub-band. It retrieves the amplitude values of all frequency points between the starting and ending index numbers from the intermediate frequency domain energy calculation result buffer, calculates the sum of the squares of these amplitude values, and then divides it by the number of frequency points contained in the sub-band to obtain the average energy value of that sub-band. The purpose of using average energy instead of total energy in the merging operation is to eliminate the energy deviation introduced by the different number of frequency points contained in different sub-bands, making the energy values of each sub-band comparable. The average energy value is then stored in the energy register of the corresponding sub-band.
[0047] After traversing all 24 sub-bands, a sequence of sub-band energy values consisting of 24 average energy values is obtained. The digital signal processor core performs normalization processing on the average energy values of the 24 sub-bands. First, it traverses the 24 average energy values and finds the maximum value; then, each of the 24 average energy values is divided by this maximum value, and the resulting 24 quotients are the normalized frequency band energy values. The value of each normalized frequency band energy value ranges from 0.0 to 1.0, with the sub-band having the highest energy corresponding to a normalized value of 1.0, and the normalized values of the remaining sub-bands scaled proportionally.
[0048] The normalized frequency band energy values are a set of values obtained by scaling the average energy value of each sub-band proportionally, using the average energy value of the sub-band with the highest energy in the current processing frame as a reference. The purpose of normalization is to eliminate the interference of changes in the absolute sound pressure level of ambient noise on subsequent analysis: regardless of whether the environment is a quiet office or a noisy street, the normalized energy distribution only reflects the shape characteristics of the noise spectrum, and is not affected by absolute loudness. This allows the deep neural network to focus on learning the mapping relationship between the shape of the noise spectrum distribution and the optimal filter coefficients, without having to deal with the additional dimension of change brought about by loudness variations. These 24 normalized frequency band energy values constitute the frequency domain energy distribution vector corresponding to the current processing frame, which will serve as the input basis for calculating the distribution centroid and generating the environmental feature tensor in subsequent steps.
[0049] Step 2: Based on the direction and distance of the distribution centroid of the normalized frequency band energy value in the frequency domain coordinates from the preset reference position, apply attenuation weights to the frequency band energy values on the same side of the deviation direction and far from the distribution centroid, and maintain the original weights for the frequency band energy values on the opposite side of the deviation direction to generate an environmental feature tensor. The specific implementation process is as follows.
[0050] The digital signal processor core reads 24 normalized frequency band energy values from the on-chip SRAM and calculates the centroid of the distribution of these 24 energy values in the frequency domain coordinates.
[0051] The centroid of distribution is a locational indicator describing the concentration of energy across the entire frequency spectrum, similar to the concept of the center of mass in physics. The center of mass indicates where an object's mass is concentrated in space, while the centroid of distribution indicates the frequency at which noise energy is concentrated in the frequency spectrum. The calculation process for the centroid of distribution is as follows:
[0052] The index number of each sub-band is used as its position coordinate in the frequency domain. This coordinate is multiplied by the normalized energy value of the sub-band to obtain its coordinate-energy product. The coordinate-energy products of all 24 sub-bands are summed to obtain a total coordinate-energy product. Simultaneously, the 24 normalized energy values are summed to obtain a total energy value. Finally, the total coordinate-energy product is divided by the total energy value, and the quotient is the position of the centroid in the frequency domain. The centroid is a continuous floating-point value, not limited to an integer index number.
[0053] If the normalized energy values of each sub-band are exactly equal (i.e., the noise energy is uniformly distributed across the spectrum, similar to the characteristics of pink noise), then the center of gravity will fall approximately in the middle of the frequency domain coordinates. If the energy of the high-frequency sub-bands is much greater than that of the low-frequency sub-bands, for example, in street traffic noise where the mid-to-high frequency components generated by engine and tire friction dominate, then the center of gravity will be biased towards a higher coordinate position. Conversely, if the energy of the low-frequency sub-bands is much greater than that of the high-frequency sub-bands, for example, in the low-frequency rumble of heavy machinery or air conditioning compressors, then the center of gravity will be biased towards a lower coordinate position. The meaning of the center of gravity can be understood as where the energy of the current environmental noise is mainly concentrated in the spectrum.
[0054] The specific steps for determining the frequency domain index number of the distribution centroid are as follows.
[0055] After the centroid of the distribution is calculated, the core of the digital signal processor rounds the centroid value down (i.e., discards the decimal part and retains the integer part) to obtain the frequency domain index number of the centroid. For example, when the centroid value is 18.3, the frequency domain index number is 18; when the centroid value is 5.7, the frequency domain index number is 5.
[0056] The frequency domain index number represents the number of the sub-band closest to and not exceeding the given position among the 24 discrete sub-bands, mapping the centroid position of the continuous floating-point distribution. This index number is used for subsequent deviation direction determination, deviation distance calculation, and frequency band set division, as the division of the frequency band set is based on integer index numbers. A preset reference position value is pre-stored in the on-chip SRAM. This preset reference position is determined as follows:
[0057] In an anechoic chamber environment, pink noise (i.e., a broadband noise signal with power spectral density inversely proportional to frequency, whose energy is equal in each octave) is used as the excitation signal input to the external microphone. The preprocessing steps are identical to those in step 1: framing, Hanning windowing, 256-point Fast Fourier Transform, 24 sub-band one-third octave band merging, and maximum value normalization. The centroid value corresponding to the pink noise distribution is then calculated. Since the energy of each sub-band of the pink noise is approximately uniform under one-third octave band division, its centroid will fall approximately in the middle of the frequency domain coordinates. In this embodiment, the preset reference position value obtained through calibration is 12.4. This calibration value is stored in on-chip SRAM in floating-point format.
[0058] The digital signal processor core rounds down the preset reference position value to obtain the frequency domain index number of the preset reference position. This frequency domain index number serves as the comparison benchmark for subsequent deviation direction determination and deviation distance calculation. In this embodiment, the preset reference position value is 12.4, and its frequency domain index number is 12.
[0059] The digital signal processor core compares the frequency domain index number of the distribution centroid with the frequency domain index number of the preset reference position to determine the deviation direction. The determination rule is strictly executed according to claim 3:
[0060] If the frequency domain index of the distribution centroid is greater than the frequency domain index of the preset reference position, it indicates that the current noise energy distribution is shifted towards higher frequencies compared to the equilibrium state. That is, the energy proportion of the high-frequency sub-bands is higher than the expected proportion under equilibrium conditions. In this case, the deviation direction is determined to be towards the high-frequency side. If the frequency domain index of the distribution centroid is less than the frequency domain index of the preset reference position, it indicates that the current noise energy distribution is shifted towards lower frequencies compared to the equilibrium state. That is, the energy proportion of the low-frequency sub-bands is higher than the expected proportion under equilibrium conditions. In this case, the deviation direction is determined to be towards the low-frequency side. If the frequency domain index of the distribution centroid is equal to the frequency domain index of the preset reference position (i.e., the distribution centroid of the current noise spectrum falls exactly within the same sub-band as the reference position), it is determined to be a no-deviation state. In the no-deviation state, subsequent attenuation weighting operations maintain the original energy values for all frequency bands, and the energy values of the 24 normalized frequency bands are directly arranged in the original frequency domain order to form the environmental feature tensor.
[0061] The digital signal processor core calculates the index difference between the frequency domain index of the centroid of the distribution and the frequency domain index of the preset reference position, and uses this index difference as the deviation distance determination value. The index difference is calculated as follows:
[0062] The difference between the frequency domain index of the distribution centroid and the frequency domain index of the preset reference position is calculated, and the result is subtracted. The absolute value of the subtraction result is taken (i.e., regardless of whether the deviation direction points to high or low frequencies, only the magnitude of the deviation is considered). The deviation distance judgment value is a non-negative integer, and its physical meaning is: how many sub-bands the energy distribution centroid of the current noise spectrum has crossed from the equilibrium reference position. The larger the deviation distance judgment value, the more severe the deviation of the current noise spectrum from the equilibrium state, and the more concentrated the noise energy is at one end of the spectrum; the smaller the deviation distance judgment value, the closer the current noise spectrum is to the equilibrium state.
[0063] Taking the preset reference position in this embodiment at frequency index number 12 as a reference: if the calculated frequency index number of the distribution centroid is 18, then the index number difference is 6, the deviation distance judgment value is 6, indicating that the noise energy centroid has shifted in a certain direction by approximately 6 sub-frequency bands. If the frequency index number of the distribution centroid is 5, then the index number difference is 7, the deviation distance judgment value is 7, indicating that the noise energy centroid has shifted in a certain direction by approximately 7 sub-frequency bands.
[0064] After determining the deviation direction and the frequency domain index number of the distribution centroid, the digital signal processor core divides the 24 sub-frequency bands into a first frequency band set and a second frequency band set, using the frequency domain index number of the distribution centroid as the dividing point. The division rules for the frequency band sets are strictly implemented according to claim 3, with two cases:
[0065] Scenario 1, Deviation Direction Pointing to the High-Frequency Side: When the frequency domain index number of the distribution center of gravity is greater than the frequency domain index number of the preset reference position, the deviation direction points to the high-frequency side. In this case, all sub-bands with frequency domain index numbers greater than the frequency domain index number of the distribution center of gravity are assigned to the first frequency band set, and all sub-bands with frequency domain index numbers less than the frequency domain index number of the distribution center of gravity are assigned to the second frequency band set. The sub-band corresponding to the frequency domain index number of the distribution center of gravity at the boundary point is not assigned to either set. This sub-band is the core location of the energy distribution, and its energy value remains unchanged in subsequent processing. Taking the frequency domain index number of the distribution center of gravity as 18 and the deviation direction pointing to the high-frequency side as an example: the first frequency band set contains six sub-bands with index numbers 19, 20, 21, 22, 23, and 24. These sub-bands are located on the same side of the deviation direction (high-frequency side), and their frequency domain positions are above the distribution center of gravity; the second frequency band set contains seventeen sub-bands with index numbers 1 to 17. These sub-bands are located on the opposite side of the deviation direction (low-frequency side). The sub-band corresponding to index number 18 is not included in any set, and its energy value remains unchanged.
[0066] Scenario 2, Deviation direction towards the low-frequency side: When the frequency domain index number of the distribution centroid is less than the frequency domain index number of the preset reference position, the deviation direction points towards the low-frequency side. In this case, all sub-bands with frequency domain index numbers less than the frequency domain index number of the distribution centroid are assigned to the first frequency band set, and all sub-bands with frequency domain index numbers greater than the frequency domain index number of the distribution centroid are assigned to the second frequency band set.
[0067] Taking a frequency domain index of 5 where the distribution centroid is located, and the deviation direction pointing towards the low-frequency side, as an example: The first frequency band set includes four sub-bands with index numbers 1, 2, 3, and 4. These sub-bands are located on the same side of the deviation direction (the low-frequency side), and their frequency domain positions are below the distribution centroid. The second frequency band set includes nineteen sub-bands with index numbers 6 to 24. These sub-bands are located on the opposite side of the deviation direction (the high-frequency side). The sub-band corresponding to index number 5 is not included in any set, and its energy value remains unchanged.
[0068] The first set of frequency bands is the set of frequency bands on the same side as the direction of deviation. These sub-bands are located further away from the side where the energy has already been shifted, and their frequency domain positions are further away from the preset reference position than the distribution centroid. The second set of frequency bands is the set of frequency bands on the opposite side of the direction of deviation. These sub-bands are located on the opposite side of the direction of deviation, and their energy proportion is already lower than the expected proportion of the corresponding frequency band under equilibrium conditions.
[0069] For each sub-band in the first frequency band set, the digital signal processor core performs differentiated attenuation-weighted processing. The processing starts from the frequency domain index of the distribution centroid and sequentially traverses each sub-band in the first frequency band set along the deviation direction. The traversal order depends on the deviation direction: if the deviation direction points to higher frequencies, the sub-bands in the first frequency band set are traversed in ascending order of index number (i.e., starting from the adjacent high-frequency side of the distribution centroid and gradually moving towards higher frequencies); if the deviation direction points to lower frequencies, the sub-bands in the first frequency band set are traversed in descending order of index number (i.e., starting from the adjacent low-frequency side of the distribution centroid and gradually moving towards lower frequencies).
[0070] For the currently traversed sub-band, the digital signal processor (DSP) core calculates the absolute difference between the frequency domain index of that sub-band and the frequency domain index of the energy distribution centroid. This absolute difference is called the frequency domain span value. The frequency domain span value indicates how many sub-bands away the current sub-band is from the energy distribution centroid in the frequency domain coordinates. The larger the span value, the farther the sub-band is from the core area of energy concentration. The frequency domain span value is a positive integer, and its calculation only involves the arithmetic difference of the index numbers, and is independent of the specific frequency (Hertz) value of each sub-band. This is because the 24 sub-bands are considered as equally spaced discrete points in the frequency domain coordinates. After calculating the frequency domain span value, the DSP core compares it with the deviation distance determination value. The comparison result determines whether the energy value of the sub-band has been attenuated.
[0071] When the frequency span value is less than or equal to the deviation distance judgment value, it indicates that although the sub-band is located on one side of the deviation direction, it is not far from the centroid of the distribution and is still within the vicinity of the energy concentration core region. For these near-end bands on the same side, this step keeps their normalized energy values unchanged and does not perform attenuation processing. The original energy information of the near-end bands on the same side is retained because they contain the neighboring structural features of the main energy components of the current noise spectrum. Attenuating them would cause the environmental feature tensor to lose the spectral details needed to distinguish different noise subtypes.
[0072] When the frequency span value exceeds the deviation distance threshold, it indicates that the sub-band has significantly moved away from the energy distribution centroid and belongs to the far-end frequency band in the deviation direction. In the current noise scenario, the energy values of these far-end frequency bands are more of a tail extension of the spectral distribution, contributing little to the main spectral characteristics describing the current noise, and may even carry random fluctuations. These random fluctuations change irregularly between different processing frames. If used as input to a deep neural network without suppression, it may cause unnecessary jitter in the filter coefficient offset values output by the network between different frames. Therefore, attenuation processing is applied to these far-end frequency bands. The specific attenuation processing method is as follows:
[0073] The normalized energy value of the sub-band is multiplied by a preset attenuation factor, and the product replaces the original normalized energy value of the sub-band. The preset attenuation factor is a set of attenuation coefficients pre-stored in on-chip SRAM, and its value decreases stepwise as the frequency domain span increases. The stepwise decrease means that the portion of the frequency domain span that exceeds the deviation distance judgment value is divided into several consecutive value intervals, each interval corresponding to a fixed preset attenuation factor value. The preset attenuation factor corresponding to the interval in which the frequency domain span falls is used. The later the interval (i.e., the larger the frequency domain span), the smaller the corresponding preset attenuation factor value, and the stronger the attenuation.
[0074] In this embodiment, the preset attenuation factor is configured with three attenuation levels: when the frequency domain span is greater than the deviation distance judgment value but not more than twice the deviation distance judgment value, the preset attenuation factor is 0.75, meaning the normalized energy value of this sub-band is attenuated to three-quarters of its original value. When the frequency domain span is greater than twice the deviation distance judgment value but not more than three times the deviation distance judgment value, the preset attenuation factor is 0.50, meaning the normalized energy value of this sub-band is attenuated to half its original value. When the frequency domain span is greater than three times the deviation distance judgment value, the preset attenuation factor is 0.25, meaning the normalized energy value of this sub-band is attenuated to one-quarter of its original value.
[0075] For each sub-band in the second frequency band set, i.e., the frequency band located on the opposite side of the offset direction, the digital signal processor core keeps the normalized energy value unchanged and does not perform attenuation processing. In the current noise spectrum, the energy proportion of the sub-bands in the second frequency band set is already lower than the expected proportion of the corresponding frequency band in the equilibrium state (because the energy has been shifted to the other side). Although these frequency bands have weaker energy, they still carry discriminative information that helps distinguish different noise scenarios. If attenuation is applied to these frequency bands that already have low energy, it will weaken the ability of the environmental feature tensor to express different noise scenarios. For example, in the low-frequency-dominated heavy machinery noise, preserving the weak energy distribution pattern of the high-frequency sub-bands can help the network distinguish it from the air conditioner compressor noise, which is also low-frequency-dominated but has slightly different high-frequency characteristics.
[0076] After completing all the above weighted processing, the digital signal processor core obtained 24 processed sub-band energy values. Among these 24 values, the energy values of sub-bands belonging to the first frequency band set and whose frequency domain span value is greater than the deviation distance judgment value have been attenuated to different degrees according to the corresponding step attenuation factor; the energy values of sub-bands belonging to the first frequency band set but whose frequency domain span value is less than or equal to the deviation distance judgment value remain unchanged; the energy values of all sub-bands belonging to the second frequency band set remain unchanged; and the energy values of sub-bands located at the frequency domain index number of the distribution centroid (i.e., the core position of energy distribution) also remain unchanged.
[0077] The digital signal processor core arranges the 24 weighted sub-band energy values in the original frequency domain order, i.e., from the index number of sub-band 1 (lowest frequency) to sub-band 24 (highest frequency) in ascending order, to form a one-dimensional vector containing 24 elements, and stores the vector in the pre-allocated environmental feature tensor buffer in the on-chip SRAM.
[0078] This vector is the environmental feature tensor output in this step. Each element in the environmental feature tensor is the noise frequency domain feature representation of the corresponding sub-band after differential attenuation perceived in the deviation direction. Compared with the original normalized frequency band energy values output in step 1, the environmental feature tensor selectively suppresses the energy expression of the far-end frequency bands in the deviation direction while preserving the overall shape of the noise spectrum, while fully preserving the information of the near-end same-side frequency bands and opposite-side frequency bands.
[0079] The environmental feature tensor will serve as the input for subsequent steps, which will be used by a lightweight deep neural network to predict the coefficient offset of the finite impulse response filter suitable for the current noise environment, thereby driving the real-time update of the filter parameters.
[0080] Step 3: Input the environmental feature tensor into the pre-constructed lightweight deep neural network. The lightweight deep neural network is a compressed model obtained by pruning and parameter quantization of the original network to an eight-bit integer. The compressed model has a single forward inference time on the chip that is less than the preset feedback control interruption cycle. The specific implementation process is as follows.
[0081] The digital signal processor core reads 24 floating-point normalized energy values one by one from the on-chip SRAM environmental feature tensor buffer. Since the normalized frequency band energy values are limited to the range of 0.0 to 1.0, and each energy value is multiplied only by an attenuation factor ranging from 0.0 to 1.0 during the attenuation weighting process, the values of all 24 elements in the environmental feature tensor are still within the floating-point range of 0.0 to 1.0.
[0082] Before performing network inference on the environmental feature tensor, the digital signal processor core first performs a quantization operation, converting each element from 32-bit floating-point format to 8-bit integer format. This ensures that the input data type maintains the same computational precision as the connection weights in the lightweight deep neural network, which have already been quantized to 8-bit integers. This allows the entire forward inference chain to be executed efficiently on the integer arithmetic unit without needing to call the floating-point arithmetic unit. The quantization operation consists of three steps.
[0083] Step 1: Multiply each floating-point element value by 255. 255 is the maximum value that an 8-bit unsigned integer can represent. After multiplication, a floating-point intermediate value with a range of 0.0 to 255.0 is obtained.
[0084] Step 2: Perform a rounding operation on the floating-point intermediate value to obtain an integer value between 0 and 255.
[0085] Step 3: Since the connection weights of each layer in the lightweight deep neural network use a signed 8-bit integer format with a value range of -128 to +127, in order to align the value range of the input data with the value range of the weights (i.e., the input data and weights use the same zero point position and value range, which helps the neural network accelerator engine to process multiplication and addition operations with a unified integer operation logic), the digital signal processor core subtracts 128 from the quantized integer value, shifting the value range of the input element from 0 to 255 to -128 to +127.
[0086] The 24 quantized 8-bit integer values are arranged in ascending order of their original frequency domain indexes, from sub-band 1 to sub-band 24, forming the quantized input tensor. The number of elements (dimensions) of the quantized input tensor is identical to that of the environmental feature tensor, both being 24 elements. The only difference is that the data type of each element is converted from 32-bit floating-point to 8-bit integer, and the numerical range is mapped from 0.0 to 1.0 to -128 to +127. The physical meaning of the quantized input tensor is exactly the same as that of the environmental feature tensor, representing the frequency domain energy distribution characteristics of the 24 one-third octave sub-bands under the current noise environment. The only difference is that the numerical precision is compressed from high-precision floating-point to 8-bit integer, and the numerical range is shifted to accommodate subsequent integer operations.
[0087] The lightweight deep neural network has been fully described in the implementation environment initialization phase of step 1.
[0088] This network is a feedforward fully connected network. Feedforward means that data is passed in a single direction through the network, from the input layer to the output layer, layer by layer, without any reverse or cyclic connections; fully connected means that there is a path with independent connection weights between each node in the previous layer and each node in the next layer. The network consists of one input layer, three hidden layers, and one output layer. The input layer has 24 nodes, receiving 24 elements of a 24-dimensional quantized input tensor; the first hidden layer has 48 nodes, the second hidden layer has 32 nodes, and the third hidden layer has 32 nodes. This design, with the number of nodes decreasing layer by layer, allows the network to progressively compress the dimensionality of the feature representation during layer-by-layer processing, extracting the high-level abstract features that are most discriminative to the offset values of the prediction filter coefficients; the hidden layers use a linear rectified function as the activation function, and its operation rules are as follows:
[0089] When the input value is less than or equal to 0, the output is 0; when the input value is greater than 0, the output is the original value. This activation method gives the network nonlinear expressive power, enabling it to learn the complex mapping relationship between environmental features and filter coefficient offsets, while the computational overhead is extremely small. The output layer has 128 nodes, which corresponds to the number of taps of the finite impulse response filter used in subsequent steps. Each output node outputs the coefficient offset corresponding to a tap position.
[0090] All connection weights of the network have been quantized after training, compressed from 32-bit floating-point format to 8-bit integer format, and stored in the model weight area of the on-chip SRAM with each weight value occupying 1 byte of storage density. The value range of each quantized weight value is -128 to +127. The network bias parameter, which is a constant value added to each node in addition to the weighted summation, is used to shift the weighted summation result before the activation function to adjust the ease with which the node is activated. It is also stored in 8-bit integer format, and its value range is also -128 to +127.
[0091] All the input quantization rules, network inter-layer connection structures, the number and dimensions of weights in each layer, the type and operation rules of activation functions, and the existence and function of bias parameters have been clearly described above. Based on this, those skilled in the art can completely reproduce the forward inference process of this lightweight deep neural network.
[0092] The compression model's single forward inference time on the Bluetooth audio system-on-a-chip is less than the preset feedback control interrupt period. The feedback control interrupt period is the maximum allowable time interval reserved by the active noise cancellation system between processing two consecutive frames of noise signals. It is also the upper limit of the time required for the entire signal processing chain, from microphone pickup to speaker output of the noise-resistant wave, to complete one full cycle. In this embodiment, the feedback control interrupt period is preset to 1.5 milliseconds. The value of the feedback control interrupt period is based on:
[0093] The human ear is highly sensitive to phase changes at frequencies below 2 kHz. To ensure the noise reduction system can effectively track noise changes, the closed-loop delay should be controlled within the time required for sound wave propagation of approximately 0.5 meters, corresponding to a time constraint of approximately 1.5 milliseconds. If the forward inference time exceeds this period, the filter coefficient update will lag behind the noise change, resulting in a phase mismatch between the currently output anti-noise wave and the actual ambient noise. Noise reduction performance will degrade as the delay increases. Actual measurements on a Bluetooth audio system-on-a-chip show that the compressed model after pruning and quantization in this embodiment has a single forward inference time of approximately 0.8 milliseconds. This measured value is less than the 1.5 millisecond feedback control interruption period, leaving approximately 0.7 milliseconds of time margin for analog-to-digital conversion, preprocessing, coefficient updates, and convolutional filtering. The entire signal processing chain can complete all operations within a single interruption period, meeting the real-time constraints of the active noise reduction system.
[0094] Step 4, perform layer-by-layer integer forward operations, the specific operations are as follows.
[0095] After the quantized input tensor is ready, the digital signal processor core loads the 24 eight-bit integer elements into the input register of the neural network accelerator engine, initiating the forward inference of the lightweight deep neural network. The entire forward inference process is executed within the neural network accelerator engine, with intermediate operations at each layer performed using eight-bit integer precision, without using floating-point units. Internally, the neural network accelerator engine uses accumulators with a bit width greater than eight bits to temporarily store intermediate results during multiplication and accumulation to avoid data overflow caused by multiple multiplication and accumulation. However, the internal bit width of the accumulator is a hardware implementation detail of the accelerator engine and does not affect the external logic of the forward operations described in this step. The layer-by-layer execution process is as follows.
[0096] Layer 1 consists of the input layer and the first hidden layer: The neural network accelerator engine reads all connection weights between the 24 nodes of the input layer and the 48 nodes of the first hidden layer from the model weight region, totaling 1152 8-bit integer weight values. For each node in the first hidden layer, the accelerator engine performs the following integer multiplication-accumulation operation: multiply each of the 24 quantized input elements by the connection weight at the corresponding index position connected to that node, resulting in 24 integer product values; then sum these 24 integer product values to obtain a cumulative sum; finally, add the cumulative sum to the bias value corresponding to that node to obtain an integer intermediate value. After performing the above operation on each of the 48 nodes of the first hidden layer, a total of 48 integer intermediate values are obtained. These 48 integer intermediate values are fed into a linear rectified function for activation processing. For each integer intermediate value, if it is greater than 0, the original value is retained; if it is less than or equal to 0, the output is set to 0, resulting in 48 activated output values for the first hidden layer. At this point, the forward operation of the first layer is complete, and the 48 eight-bit integer output values are passed into the second layer as input for the next layer.
[0097] Layer 2 consists of hidden layers 1 and 2: The neural network accelerator engine reads all connection weights between the 48 nodes of hidden layer 1 and the 32 nodes of hidden layer 2 from the model weight region, totaling 1536 8-bit integer weight values. For each node in hidden layer 2, the accelerator engine performs an integer multiplication-addition operation on the 48 integer values output from hidden layer 1 and the connection weights connected to that node at the corresponding index, accumulates the bias value, and then activates it through a linear rectified function to obtain 32 8-bit integer output values. These 32 output values are then fed into layer 3 as input to the next layer.
[0098] The third layer consists of the second and third hidden layers: the accelerator engine reads all connection weights between the 32 nodes in the second hidden layer and the 32 nodes in the third hidden layer from the model weight region, totaling 1024 8-bit integer weight values. For each node in the third hidden layer, it is processed according to the same integer multiplication-addition-bias addition-activation process as the previous layers, resulting in 32 8-bit integer output values. These 32 output values are then passed as input to the next layer and fed into the output layer.
[0099] Layer 4 extends from the 3rd hidden layer to the output layer: The accelerator engine reads all connection weights between the 32 nodes of the 3rd hidden layer and the 128 nodes of the output layer from the model weight region, totaling 4096 8-bit integer weight values. For each node in the output layer, the accelerator engine performs integer multiplication and addition operations on the 32 integer values output from the 3rd hidden layer and the connection weights connected to that node at the corresponding index position, and accumulates the bias value. The output layer is a special layer in the network structure, and its operation rules differ from the three hidden layers in one key aspect: after performing full multiplication and addition and bias accumulation, each node in the output layer does not undergo activation by a linear rectified function, but directly outputs the original integer value. The reason for this is that the 128 output values of the output layer correspond to the offsets of 128 filter tap coefficients. These offsets can be positive (indicating that the corresponding tap coefficient needs to be increased from the current level) or negative (indicating that the corresponding tap coefficient needs to be decreased from the current level), and their signs carry the key information of the adjustment direction. The characteristic of a linear rectifier function is that it forces all input values less than or equal to 0 to be 0. If a linear rectifier function is applied to the output layer, all negative offset information will be truncated and lost. The network will only be able to output non-negative offsets, meaning it can only suggest increasing the coefficients but not decreasing them, limiting the flexibility and accuracy of filter coefficient adjustment. Therefore, the output layer retains the original integer values without activation processing to fully preserve both the magnitude and sign information of the offset values.
[0100] After the above four layers of integer forward operations, the neural network accelerator engine outputs a sequence of 128 eight-bit integer values, which is the eight-bit integer offset sequence. The first element in the sequence corresponds to the offset prediction value of the first tap coefficient of the finite impulse response filter, the second element corresponds to the offset prediction value of the second tap coefficient, and so on up to the 128th element.
[0101] In the 8-bit integer offset sequence, the value range of each element is limited by the numerical range of the 8-bit signed integer, from -128 to +127. However, the tap coefficients of the finite impulse response filter are floating-point numbers. Dequantizing the integer offset values output by the neural network back to floating-point format of the same order of magnitude as the filter coefficients allows for direct point-by-point accumulation with the current tap coefficients. The specific dequantization process is as follows: the digital signal processor core reads 128 8-bit integer offset values one by one, divides each integer offset value by a preset dequantization scaling factor, and the quotient is the floating-point offset value.
[0102] The preset dequantization scaling factor is a floating-point constant determined during the model training phase and pre-stored in the on-chip SRAM. It is determined as follows: During training, the numerical distribution range of the raw integer output values (without dequantization) generated by the network output layer for a large number of training samples is statistically analyzed. Simultaneously, the numerical distribution range of the corresponding target filter coefficient offset values (i.e., training labels, obtained by subtracting the baseline coefficient from the optimal tap coefficient determined through manual tuning) is statistically analyzed. The statistical ratio between the two is calculated, and the ratio of the target offset range to the raw integer output value range is used as the dequantization scaling factor. The purpose of this is to ensure that the order of magnitude of the dequantized floating-point offset values matches the actual requirements of the filter coefficient offset. In this embodiment, the dequantization scaling factor obtained in this manner is set to 256.0.
[0103] The inverse quantization scaling factor of 256.0 means that the smallest resolvable floating-point offset, approximately 0.0039 (i.e., 1.0 ÷ 256.0), is represented by one integer unit within the network. Dividing the integer offset value 64 by 256.0 yields a floating-point offset value of 0.25, indicating a suggestion to increase the corresponding tap coefficient by 0.25. Dividing the integer offset value -32 by 256.0 yields a floating-point offset value of -0.125, indicating a suggestion to decrease the corresponding tap coefficient by 0.125. After performing the division by 256.0 on each of the 128 integer offset values, the digital signal processor core obtains 128 floating-point offset values. These 128 floating-point offset values are arranged in order corresponding one-to-one with the tap numbers of the finite impulse response filter, forming the digital filter coefficient offset values.
[0104] The digital filter coefficient offset represents the magnitude and direction by which the deep learning network should adjust the tap coefficient relative to its current value for each of the 128 tap positions in the finite impulse response (FIR) filter, based on the spectral characteristics of the current ambient noise. A positive offset suggests increasing the tap coefficient (enhancing the contribution of the signal component at that time delay position to the noise immunity), while a negative offset suggests decreasing the tap coefficient (weakening the contribution of the signal component at that time delay position to the noise immunity). A larger absolute value of the offset indicates a larger suggested adjustment magnitude. The digital filter coefficient offset will serve as input for subsequent steps, used to perform point-by-point updates to the current tap coefficients of the FIR filter.
[0105] Step 5: Retrieve the current tap coefficients of the finite impulse response filter pre-stored in the random access memory of the audio processing chip, and accumulate them point by point according to the digital filter coefficient offset value and the current tap coefficients to obtain the updated tap coefficients. The specific implementation process is as follows.
[0106] The digital signal processor core reads 128 floating-point tap coefficients that are currently active from the finite impulse response filter coefficient storage area in the on-chip SRAM. These are the coefficient values that are currently being used by the finite impulse response filter for convolution filtering operations.
[0107] Tap coefficients are core parameters in a Finite Impulse Response (FIR) filter. The hardware structure of a FIR is a pipeline containing 128 delay units: the sampled values of the input discrete signal are passed sequentially along the delay lines, with each delay unit delaying the signal by one sampling period, approximately 20.8 microseconds at a 48000 Hz sampling rate. A tap is then added after each delay unit, multiplying the delayed signal output by a corresponding tap coefficient. The sum of these 128 taps constitutes the filter's output value at the current sampling moment. Therefore, the 128 tap coefficients collectively determine the filter's frequency response characteristics to the input signal. Different combinations result in different passband and stopband shapes, thus producing noise-resistant signals with different spectral characteristics.
[0108] During system startup, this set of coefficients equals the initial tap coefficients described in step 1, consisting of 128 reference values calibrated with pink noise in an anechoic chamber. During operation, these coefficients are continuously rewritten with each environmental adaptive update. The reading method is as follows: the digital signal processor core starts from the beginning address of the on-chip SRAM coefficient storage area, reads 128 times consecutively, with each coefficient occupying 4 bytes (32-bit floating-point format), and stores the 128 floating-point numbers sequentially into a temporary coefficient buffer.
[0109] The offset value is accumulated point by point with the current coefficient, and the specific operation is as follows.
[0110] After reading the current tap coefficient, the digital signal processor core performs point-by-point addition on the 128 floating-point offset values in the digital filter coefficient offset value sequence and the 128 current tap coefficients at the corresponding index positions. Point-by-point addition means that the first element in the offset value sequence is added to the first element in the current tap coefficient, the second element is added to the second element, and so on, up to the 128th element, for a total of 128 independent floating-point addition operations.
[0111] The result of each addition operation is called a candidate tap coefficient. If a certain offset value is positive, it means that the tap coefficient corresponding to the deep neural network prediction needs to be increased. The candidate value is greater than the current value, and the contribution of the signal component at the time delay position corresponding to that tap in the noise immunity will be enhanced. If a certain offset value is negative, it means that the tap coefficient corresponding to the deep neural network prediction needs to be decreased. The candidate value is less than the current value, and the contribution of the signal component at the time delay position corresponding to that tap will be weakened. After all 128 pointwise additions are completed, 128 candidate tap coefficients are obtained and temporarily stored in the on-chip SRAM temporary coefficient buffer.
[0112] The tap coefficients of a filter cannot be increased or decreased indefinitely during operation. If the tap coefficients are too large, the amplitude of the filter's output signal will exceed the linear input range of the digital-to-analog converter (DAC), forcibly truncating signal peaks and troughs, resulting in clipping distortion. That is, the signal waveform is flattened after exceeding the upper limit of the amplitude that the DAC can linearly convert, introducing nonlinear distortion components. If the absolute value of the tap coefficient is too large and its sign is negative, the filter's gain at certain frequencies may decrease to the point where it cannot effectively cancel noise at the corresponding frequency, or even cause feedback loop oscillations. Therefore, it is necessary to perform an out-of-bounds check on each candidate tap coefficient to limit it within a preset safe range. Two preset coefficient boundary values are pre-stored in the on-chip SRAM: a preset upper limit and a preset lower limit. These two boundary values are determined as follows:
[0113] During the system debugging phase, the finite impulse response filter is connected to the audio test platform. The tap coefficients are gradually increased or decreased while the amplitude and spectral response of the filter's output signal are measured simultaneously. The tap coefficient value at which the output signal amplitude approaches the full-scale input range of the digital-to-analog converter (DAC), i.e., the maximum input signal amplitude that the DAC can linearly convert without significant distortion, is recorded as the upper limit of the preset coefficient. The tap coefficient value at which the filter's gain at a specific frequency drops to the point where it can no longer effectively cancel the noise at that frequency is recorded as the lower limit of the preset coefficient. In this embodiment, the upper limit of the preset coefficient determined by the above debugging and calibration is 1.5, and the lower limit of the preset coefficient is -1.5. The digital signal processor core compares each of the 128 candidate tap coefficients with the upper and lower limits of the preset coefficient, using a three-stage judgment rule:
[0114] If the candidate tap coefficient is greater than the preset upper limit of 1.5, it indicates that the bias predicted by the deep neural network is increasing and the magnitude is large, and the candidate value exceeds the safe operating range of the hardware. In this case, the digital signal processor (DSP) core forces the candidate value to be 1.5, i.e., takes the maximum allowable value within the safe range; this operation is called upper clamping. If the candidate tap coefficient is less than the preset lower limit of -1.5, it indicates that the bias predicted by the deep neural network is decreasing and the magnitude is large, and the candidate value is below the safe range. In this case, the DSP core forces the candidate value to be -1.5, i.e., takes the minimum allowable value within the safe range; this operation is called lower clamping. If the candidate tap coefficient is neither greater than 1.5 nor less than -1.5, it indicates that the candidate value is within the legal interval between the two safe boundaries, and the bias predicted by the deep neural network is within the safe operating range of the hardware. In this case, the candidate value remains unchanged and is directly used as the final value. The logic of clamping is: when the candidate value does not exceed the safe boundaries, the network's suggestion is fully adopted; when it exceeds the boundaries, the boundary value is taken, achieving a balance between the network's predictive ability and hardware safety constraints.
[0115] After comparing and clamping each of the 128 candidate tap coefficients, each value is ensured to fall within the closed interval of -1.5 to 1.5. These 128 values are the updated tap coefficients.
[0116] The updated coefficients are written back to random access memory, as follows.
[0117] The digital signal processor core writes all 128 updated tap coefficients back to the corresponding address in the finite impulse response filter coefficient storage area of the on-chip SRAM in ascending order of their serial numbers, overwriting the original current tap coefficients.
[0118] After the write-back operation is completed, the coefficients stored in the on-chip SRAM have been updated to the current version. From the next sampling time, the finite impulse response filter will use this updated set of tap coefficients to perform convolution filtering operations, completing an adaptive closed loop from environmental noise perception, feature extraction, network inference to filter coefficient update.
[0119] Step 6: Perform convolution filtering on the digital input signal using the updated tap coefficients to generate a digital noise-resistant wave signal. After digital-to-analog conversion and power amplification, the signal is radiated outward through the headphone speaker to cancel out the ambient noise picked up by the microphone. The specific implementation process is as follows.
[0120] The digital signal processor core reads 128 updated tap coefficients one by one from the coefficient storage area of the on-chip SRAM and writes each coefficient point by point into the tap coefficient register of the finite impulse response filter. The tap coefficient register is a hardware storage unit in the finite impulse response filter that corresponds one-to-one with each tap of the delay line. A register is connected after the output tap of each delay unit. This register stores the corresponding tap coefficient value in a latching manner. The value in the register remains constant in each sampling period until the coefficient is overwritten by the next update.
[0121] The 128 tap coefficient registers correspond to 128 delay units: register 1 is connected to the output tap of the first delay unit, register 2 is connected to the output tap of the second delay unit, and so on, up to register 128 connected to the output tap of the 128th delay unit. The function of the delay unit is to pass the sampled value of the input digital signal step by step: at the arrival of each sampling period, the signal value temporarily stored in the current delay unit is passed to the next delay unit, while the current delay unit receives the new value passed from the previous stage; the 128 delay units are connected in series to form a delay line. After the signal enters from the entrance of the delay line, it needs to pass through 128 sampling periods before it can be shifted out from the last stage. During this period, the output tap of each stage stores a copy of the signal at different delay times.
[0122] Convolution filtering generates digital noise-resistant wave signals, and the specific operation is as follows.
[0123] In step 1, the digital input signal output by the analog-to-digital converter is used simultaneously for two parallel paths: one path is fed into a double buffer for preprocessing and frequency domain analysis; the other path is continuously fed into the delay line input of the finite impulse response filter to generate anti-noise wave output in real time during each sampling period.
[0124] At each sampling moment, the digital signal processor (DSP) core shifts the latest arriving digital input signal sample value into the first stage of the delay line, and the existing signal values in each stage of the delay line are shifted one stage to the right. At this point, the outputs of each delay unit from stage 1 to stage 128 store the signal values arriving at the current moment and those arriving at the previous 127 sampling moments, respectively. These 128 signal values constitute a delayed signal vector. The first element of the vector is the latest sample value that was just shifted in, the second element is the signal value from one sampling period ago, and so on, up to the 128th element, which is the signal value from 127 sampling periods ago. The DSP core performs a multiplication operation on the 128 delayed signals in the delayed signal vector and the 128 updated tap coefficients at the corresponding index positions:
[0125] The signal value output from the first-stage delay unit is multiplied by the coefficient value in the first tap coefficient register, the signal value output from the second stage is multiplied by the coefficient value in the second register, and so on, up to the 128th stage, performing a total of 128 multiplications. Then, all 128 multiplication results are accumulated one by one; the sum is the digital noise-resistant signal at the current sampling time. The digital noise-resistant signal is a signed 24-bit integer value, consistent with the bit precision of the analog-to-digital converter output in step 1.
[0126] The physical essence of convolution filtering is to use a finite impulse response (FIR) filter to perform spectral shaping on the input signal. Different combinations of tap coefficients allow the filter to apply different gains and phase shifts to different frequency components. The set of tap coefficients updated in step 5 based on the current noise spectrum characteristics makes the filter exhibit frequency response characteristics that match the current ambient noise spectrum. The generated anti-noise wave signal, after reaching the ear canal or earmuff cavity, can form a sound field superposition with the ambient noise that is out of phase and has similar amplitude.
[0127] The digital signal processor (DSP) core outputs the digital noise-resistant signal of the current sampling moment to the digital input port of the digital-to-analog converter (DAC). The DAC is integrated within the audio codec chip, operates at 24-bit precision, and shares the same chip as the DAC. The DAC's operation is as follows:
[0128] In each sampling period, a 24-bit signed integer digital noise immunity signal is received. Through an internal binary weighted switched-capacitor network or resistor ladder network, the corresponding weighted switches are turned on or off based on whether each bit of the 24-bit digital value is 0 or 1. This generates an analog voltage at the output that is proportional to the digital encoding value; this analog voltage is the analog noise immunity signal. The digital-to-analog conversion process is completed within nanoseconds, and the delay from digital input to analog output is much less than one sampling period.
[0129] Before sending the analog noise-reducing signal to the power amplifier, the digital signal processor core first performs peak amplitude detection on the analog noise-reducing signal. The power amplifier has an input voltage threshold, which is determined based on the amplifier's maximum linear input voltage and the supply voltage range of the analog-to-digital converter used in this embodiment, and is preset to 1.0 volt. Input signals exceeding this threshold will cause the amplifier to enter saturation, and the output signal will no longer increase linearly with the input signal but will be limited to near the amplifier's maximum output swing. This manifests as the top and bottom of the signal waveform being clipped, producing amplification saturation distortion, changing the spectral structure of the noise-reducing signal, and weakening the noise reduction effect. The peak amplitude detection operation is as follows:
[0130] First, the digital signal processor (DSP) core determines the length of the current detection time window (determined in the next section). At the start of the detection time window, a window peak variable is initialized to 0. During the duration of the detection time window, for each sample value of the analog anti-noise wave signal output by the digital-to-analog converter (DAC), the DSP core reads the signal amplitude of that sample value and compares it with the currently stored window peak value. If the signal amplitude of the current sample point is greater than the window peak value, the window peak value is replaced by that amplitude; otherwise, the window peak value remains unchanged. When the detection time window ends, the window peak value is the value with the largest signal amplitude among all sample points within the current detection time window, and is used as the current peak value output for the analog anti-noise wave signal. After output, the window peak value is reset to 0, and peak detection for the next detection time window begins.
[0131] The dynamic determination of the detection time window length is as follows.
[0132] The length of the detection time window is not a fixed value, but is dynamically adjusted according to the severity of the change in the environmental noise spectrum. The adjustment is based on the calculated deviation distance judgment value, that is, the difference between the index number of the frequency domain where the distribution centroid is located and the index number of the frequency domain where the preset reference position is located.
[0133] The digital signal processor core reads the current deviation distance determination value stored in the on-chip SRAM, and then reads the corresponding detection time window length from the time window lookup table pre-stored in the audio processing chip. The storage structure of the time window lookup table is as follows: a continuous area is reserved in the on-chip SRAM, and several sets of correspondences between deviation distance intervals and detection time lengths are stored row by row.
[0134] In this embodiment, the preset mapping relationship of the time window lookup table is as follows: when the deviation distance judgment value is between 0 and 2, that is, the noise spectrum is close to the equilibrium state and the environmental noise type is relatively stable, the detection time window length is 2.0 milliseconds; when the deviation distance judgment value is between 3 and 5, the noise spectrum has a moderate degree of shift, and the detection time window length is 1.0 milliseconds; when the deviation distance judgment value is greater than or equal to 6, the noise spectrum has a significant shift and the environmental noise type may be changing drastically, and the detection time window length is 0.5 milliseconds.
[0135] In this mapping relationship, the detection time decreases monotonically as the deviation distance increases. A larger deviation distance indicates a more drastic shift in the current noise spectrum relative to the baseline state, suggesting that the type or spectral characteristics of the environmental noise may be changing rapidly. In this case, shortening the detection time window allows peak detection to be updated at a higher frequency, enabling the system to respond more quickly to changes in the noise environment. Conversely, when the deviation distance is small, the noise spectrum is relatively stable, and a longer detection time window makes peak detection smoother, avoiding unnecessary and frequent triggering of clipping due to accidental single-point spikes.
[0136] After the digital signal processor core matches the corresponding interval in the lookup table based on the current deviation distance judgment value, it uses the read detection time length as the current detection time window length for the above-mentioned peak amplitude detection of the analog anti-noise wave signal.
[0137] After acquiring the current peak value of the analog noise-resistant signal, the digital signal processor core compares it with a preset power amplifier input threshold. If the current peak value is less than or equal to the power amplifier input threshold, it means that the maximum amplitude of the analog noise-resistant signal within the current window is within the linear amplification range of the power amplifier, and no amplitude limiting is required; the signal can pass directly.
[0138] If the current peak value is greater than the power amplifier's input threshold, it indicates that at certain sampling moments within the current window, the instantaneous amplitude of the signal has exceeded the input range that the power amplifier can linearly process. At this point, the digital signal processor (DSP) core truncates the portion of the analog noise-resistant signal that exceeds the threshold. For sampling points where the signal amplitude exceeds the threshold, its amplitude is forcibly reduced to the threshold level; for sampling points that do not exceed the threshold, the original amplitude remains unchanged. After amplitude limiting, the peaks and troughs in the signal that exceed the threshold are flattened to the threshold level, resulting in a limited analog noise-resistant signal.
[0139] The limited analog noise-canceling signal is fed into a power amplifier. A power amplifier is an analog circuit that simultaneously amplifies the voltage and current of a low-power analog signal, and its output can drive low-impedance loads such as loudspeakers. The power amplifier linearly amplifies the input analog voltage signal at a preset fixed gain. The amplification gain is determined based on the difference between the loudspeaker's sensitivity at 1 kHz and the target sound pressure level required by the active noise cancellation system in the ear canal. The loudspeaker sensitivity is 100 dB SPL per milliwatt. To ensure a noise-canceling signal with a sound pressure level of at least 85 dB in the ear canal to cancel peak ambient noise, a voltage amplification factor of approximately 4 times is required, corresponding to a gain of 12 dB. The amplified signal is then output to the headphone's speaker.
[0140] A loudspeaker is a transducer that converts electrical signals into sound waves based on the principle of electromagnetic induction. The amplified analog electrical signal flows through the voice coil inside the loudspeaker. The voice coil is subjected to the Ampere force in the magnetic field of the permanent magnet, which produces mechanical vibrations that are consistent with the waveform of the electrical signal. The vibration pushes the surrounding air through the diaphragm to produce sound waves that alternate between compression and rarefaction. The sound waves radiated outward are the noise-resistant sound waves.
[0141] The spectral characteristics of the noise-canceling sound wave are determined by the updated tap coefficients, whose amplitude and phase match the characteristics of the current ambient noise. In the ear canal of in-ear headphones or the earcup cavity of over-ear headphones, the noise-canceling sound wave encounters the ambient noise sound wave that penetrates from the outside of the headphones via a physical path. The sound pressure of the two is superimposed in space. Because the noise-canceling sound wave and the ambient noise have nearly opposite phases and similar amplitudes on their main frequency components, the amplitude of the superimposed composite sound pressure is significantly reduced, and the noise sound pressure level perceived at the eardrum decreases, achieving active noise cancellation.
[0142] By calculating the centroid of the environmental noise spectrum, and based on the direction and distance of the centroid's deviation from the preset reference position, a stepwise decreasing attenuation weight is applied to the far-end frequency bands on the same side of the deviation direction, while the original weights are maintained for the frequency bands on the opposite side of the deviation direction. The generated environmental feature tensor retains the main structural features of the noise spectrum while suppressing the far-end random fluctuation components, enabling the subsequent deep neural network to more stably predict the filter coefficient offset values and making it less prone to coefficient jitter when switching between different noise scenarios.
[0143] After pruning and parameter quantization to eight-bit integers, the deep neural network is deployed on the headphone chip. All forward inference operations are completed with integer precision, without the need to call the floating-point unit. The time consumption of a single forward inference is controlled within the preset feedback control interrupt cycle, and real-time adaptive updating of filter coefficients is achieved under the limited computing power and power consumption budget of the headphone chip.
[0144] After summing the offset value predicted by the network point by point with the current tap coefficient, the candidate coefficients are clamped to prevent them from exceeding the preset upper or lower limit. If the coefficient exceeds the limit, the safe boundary value is taken; if it does not exceed the limit, the original value is kept. This fully adopts the network prediction results while preventing the filter coefficients from being too large, which would cause clipping distortion in the digital-to-analog converter, or the coefficients from being too small, which would cause insufficient noise reduction gain.
[0145] By dynamically adjusting the time window length for peak amplitude detection based on the degree of deviation of the distribution center of gravity, the larger the deviation, the shorter the window and the faster the response. When the noise spectrum is relatively stable, a long window is used for smooth detection to avoid false triggering of amplitude limiting. When the noise spectrum changes drastically, a short window is used to quickly track the signal peak and limit the amplitude in time, thus balancing noise reduction stability and scene switching response speed.
[0146] like Figure 2 As shown, embodiments of the present invention also provide a deep learning-based active noise-canceling headphone environment adaptive control system, comprising:
[0147] The conversion module is used to pick up ambient noise sound waves through a microphone located on the outside of the active noise-canceling headphones and convert them into digital input signals; the digital input signals are preprocessed to obtain normalized frequency band energy values;
[0148] The calculation module is used to apply attenuation weights to the frequency band energy values that are on the same side of the deviation direction and far from the distribution centroid of the normalized frequency band energy values in the frequency domain coordinates, based on the direction and distance of the centroid of the distribution deviation from the preset reference position, while maintaining the original weights for the frequency band energy values on the opposite side of the deviation direction, and generating an environmental feature tensor.
[0149] The input module is used to input environmental feature tensors into a pre-built lightweight deep neural network, wherein the lightweight deep neural network is a compressed model obtained by pruning and parameter quantization of the original network to an eight-bit integer, and the compressed model has a single forward inference time on the chip that is less than a preset feedback control interruption cycle.
[0150] The accumulation module is used to perform forward operations on the environmental feature tensor by a lightweight deep neural network and output the digital filter coefficient offset value; it retrieves the current tap coefficient of the finite impulse response filter pre-stored in the random access memory of the audio processing chip, and accumulates it point by point according to the digital filter coefficient offset value and the current tap coefficient to obtain the updated tap coefficient;
[0151] The update module is used to perform convolution filtering on the digital input signal with the updated tap coefficients to generate a digital noise-resistant wave signal. After digital-to-analog conversion and power amplification, the signal is radiated outward through the headphone speaker to cancel out the ambient noise picked up by the microphone.
[0152] It should be noted that this system is a system corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.
[0153] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A deep learning-based active noise-canceling headphone environment adaptive control method, applied to the headphone main control unit connected to an external microphone, characterized in that, include: Ambient noise sound waves are picked up by a microphone located on the outside of the active noise-canceling headphones and converted into digital input signals; The digital input signal is preprocessed to obtain the normalized frequency band energy value; Based on the direction and distance of the distribution centroid of the normalized frequency band energy value in the frequency domain coordinates from the preset reference position, attenuation weights are applied to the frequency band energy values on the same side of the deviation direction and far from the distribution centroid, while the original weights are maintained for the frequency band energy values on the opposite side of the deviation direction, thus generating an environmental feature tensor. The environmental feature tensor is input into a pre-constructed lightweight deep neural network, wherein the lightweight deep neural network is a compressed model obtained by pruning and parameter quantization of the original network to an eight-bit integer, and the compressed model has a single forward inference time on the chip that is less than a preset feedback control interruption cycle. A lightweight deep neural network performs forward operations on the environmental feature tensor and outputs digital filter coefficient offset values. The current tap coefficients of the finite impulse response filter, which are pre-stored in the random access memory of the audio processing chip, are retrieved and then accumulated point by point according to the digital filter coefficient offset value and the current tap coefficients to obtain the updated tap coefficients. The digital input signal is convolutionally filtered by the updated tap coefficients to generate a digital noise-resistant wave signal. After digital-to-analog conversion and power amplification, the signal is radiated outward through the headphone speaker to cancel out the ambient noise picked up by the microphone.
2. The deep learning-based active noise cancellation headphone environment adaptive control method according to claim 1, characterized in that, Based on the direction and distance of the centroid of the normalized frequency band energy values in the frequency domain coordinates from the preset reference position, attenuation weights are applied to the frequency band energy values on the same side of the deviation direction and far from the centroid, while the original weights are maintained for the frequency band energy values on the opposite side of the deviation direction. This generates an environmental feature tensor, including: Using the centroid of the distribution as the dividing point, the frequency domain coordinates are divided into a first set of frequency bands on the same side as the deviation direction and a second set of frequency bands on the opposite side of the deviation direction; Calculate the index number difference between the frequency domain index number of the distribution centroid and the frequency domain index number of the preset reference position, and use the index number difference as the deviation distance determination value. Starting from the distribution centroid, traverse each frequency band in the first frequency band set in sequence along the deviation direction, and compare the frequency domain span value between the currently traversed frequency band and the distribution centroid with the deviation distance judgment value. When the frequency domain span value is greater than the deviation distance judgment value, the product of the normalized energy value of the frequency band and the preset attenuation factor is calculated. The preset attenuation factor decreases stepwise as the frequency domain span value increases. When the frequency domain span value is less than or equal to the deviation distance judgment value, the normalized energy value of the frequency band remains unchanged. The normalized energy values of each frequency band in the second frequency band set remain unchanged from their original values; The normalized energy values of each frequency band after the above weighting process are arranged in the original frequency domain order to form the environmental feature tensor.
3. The deep learning-based active noise cancellation headphone environment adaptive control method according to claim 2, characterized in that, Using the centroid of the distribution as the dividing point, the frequency domain coordinates are divided into a first frequency band set on the same side as the deviation direction and a second frequency band set on the opposite side of the deviation direction, including: Determine the direction of deviation of the distribution's center of gravity relative to the preset reference position; If the frequency domain index number of the distribution centroid is greater than the frequency domain index number of the preset reference position, then it is determined that the deviation direction points to the high-frequency side. All frequency bands with frequency domain index numbers greater than the index number of the distribution centroid are assigned to the first frequency band set, and all frequency bands with frequency domain index numbers less than the index number of the distribution centroid are assigned to the second frequency band set. If the frequency domain index number of the distribution centroid is less than the frequency domain index number of the preset reference position, it is determined that the deviation direction points to the low frequency side. All frequency bands with frequency domain index numbers less than the index number of the distribution centroid are assigned to the first frequency band set, and all frequency bands with frequency domain index numbers greater than the index number of the distribution centroid are assigned to the second frequency band set.
4. The deep learning-based active noise cancellation headphone environment adaptive control method according to claim 3, characterized in that, The lightweight deep neural network performs a forward operation on the environmental feature tensor and outputs digital filter coefficient offset values, including: Each element in the environmental feature tensor is quantized, converting it from a floating-point value to an eight-bit integer value to obtain a quantized input tensor. The quantized input tensor is input into the lightweight deep neural network; wherein the connection weights of each layer of the lightweight deep neural network have been pre-quantized and stored as eight-bit integer fixed values, the number of nodes in its input layer is consistent with the dimension of the quantized input tensor, and the number of nodes in its output layer is consistent with the number of taps in the finite impulse response filter. The lightweight deep neural network performs integer forward operations layer by layer: each layer performs integer multiplication and addition operations on the input eight-bit integer value and the corresponding quantization weight, and after processing by the activation function, the output of the layer is obtained and passed to the next layer until the output layer outputs the eight-bit integer offset value sequence. The offset sequence of eight-bit integer values is dequantized to obtain the offset values of floating-point digital filter coefficients.
5. The deep learning-based active noise-canceling headphone environment adaptive control method according to claim 4, characterized in that, The current tap coefficients of the finite impulse response filter pre-stored in the random access memory of the audio processing chip are retrieved, and the updated tap coefficients are obtained by progressively adding the digital filter coefficient offset value and the current tap coefficients, including: Read all current tap coefficients of the finite impulse response filter from the random access memory; Each element in the digital filter coefficient offset value sequence output by the lightweight deep neural network is added point by point to the current tap coefficient at the corresponding index position to obtain the candidate tap coefficient; The candidate tap coefficient is compared with the preset upper limit and the preset lower limit. If the candidate tap coefficient is greater than the preset upper limit, the candidate tap coefficient is assigned the preset upper limit. If the candidate tap coefficient is less than the preset lower limit, the candidate tap coefficient is assigned the preset lower limit. Otherwise, the candidate tap coefficient remains unchanged, and the updated tap coefficient is obtained. Write the updated tap coefficients back to random access memory to replace the current tap coefficients.
6. The deep learning-based active noise-canceling headphone environment adaptive control method according to claim 5, characterized in that, The digital input signal is convolutionally filtered using updated tap coefficients to generate a digital noise-resistant wave signal. This signal is then converted from digital to analog and amplified before being radiated outwards through the headphone speaker to cancel out ambient noise picked up by the microphone. This process includes: Read the updated tap coefficients from the random access memory and write the updated tap coefficients point by point into the tap coefficient register of the finite impulse response filter, so that each updated tap coefficient corresponds to a first-level delay unit in the finite impulse response filter. The digital input signal is shifted into the delay line of the finite impulse response filter one sample point at a time, forming a delayed signal vector containing the same number of tap coefficients at the current sampling moment; Perform multiplication operations on each delayed signal in the delayed signal vector and the updated tap coefficients at the corresponding index positions, and sum all the multiplication results to obtain the digital noise-resistant wave signal at the current sampling time; The digital noise immunity signal is output to the digital-to-analog converter, which converts it into an analog noise immunity signal. The simulated noise cancellation signal is input to the power amplifier for power amplification. The amplified signal drives the speaker to radiate sound waves outward, so as to form a sound field superposition with the ambient noise picked up by the microphone in the ear canal or earmuff cavity, thereby achieving active noise cancellation.
7. The deep learning-based active noise cancellation headphone environment adaptive control method according to claim 6, characterized in that, The analog noise-resistant wave signal is input to the power amplifier for power amplification, including: Before inputting the analog noise immunity signal to the power amplifier, the peak amplitude of the analog noise immunity signal is detected to obtain the current peak value of the analog noise immunity signal; If the current peak value is greater than the power amplifier input threshold, the analog noise immunity signal is clipped, and the part exceeding the power amplifier input threshold is truncated to obtain the clipped analog noise immunity signal. The limited analog noise-resistant wave signal is input to the power amplifier for power amplification.
8. The deep learning-based active noise cancellation headphone environment adaptive control method according to claim 7, characterized in that, Peak amplitude detection of analog noise-resistant wave signals includes: Within a preset detection time window, the simulated noise-resistant wave signal is continuously sampled to obtain the signal amplitude value at each sampling point within the detection time window; The signal amplitude value of each sampling point is compared with the currently stored window peak value. If the signal amplitude value of the current sampling point is greater than the window peak value, the window peak value is updated with the signal amplitude value of the current sampling point; otherwise, the window peak value remains unchanged. At the end of the detection time window, the final obtained window peak value is used as the current peak value output of the simulated anti-noise wave signal, and the window peak value is reset to the initial value for peak detection in the next detection time window.
9. The deep learning-based active noise-canceling headphone environment adaptive control method according to claim 8, characterized in that, The length of the preset detection time window is dynamically determined based on the degree of centroid deviation of the distribution of the environmental feature tensor, including: Obtain the index number difference calculated from the frequency domain index number of the distribution centroid and the frequency domain index number of the preset reference position, and use the index number difference as the current deviation distance determination value. Based on the current deviation distance determination value, the corresponding detection time window length is read from the time window lookup table pre-stored in the audio processing chip; wherein, the time window lookup table has multiple mapping relationships between deviation distance intervals and detection time lengths, and the detection time length decreases monotonically as the deviation distance increases, so that the active noise-canceling headphones can respond quickly when the environmental noise spectrum distribution changes drastically; The detected time length is used as the length of the preset detection time window for detecting the peak amplitude of the simulated noise-resistant wave signal.
10. A deep learning-based active noise-canceling headphone environment adaptive control system, wherein the system implements the method as described in any one of claims 1 to 9, characterized in that, include: The conversion module is used to pick up ambient noise sound waves through a microphone located on the outside of the active noise-canceling headphones and convert them into digital input signals; The digital input signal is preprocessed to obtain the normalized frequency band energy value; The calculation module is used to apply attenuation weights to the frequency band energy values that are on the same side of the deviation direction and far from the distribution centroid of the normalized frequency band energy values in the frequency domain coordinates, based on the direction and distance of the centroid of the distribution deviation from the preset reference position, while maintaining the original weights for the frequency band energy values on the opposite side of the deviation direction, and generating an environmental feature tensor. The input module is used to input environmental feature tensors into a pre-built lightweight deep neural network, wherein the lightweight deep neural network is a compressed model obtained by pruning and parameter quantization of the original network to an eight-bit integer, and the compressed model has a single forward inference time on the chip that is less than a preset feedback control interruption cycle. The accumulation module is used to perform forward operations on the environmental feature tensor by a lightweight deep neural network and output the digital filter coefficient offset value; it retrieves the current tap coefficient of the finite impulse response filter pre-stored in the random access memory of the audio processing chip, and accumulates it point by point according to the digital filter coefficient offset value and the current tap coefficient to obtain the updated tap coefficient; The update module is used to perform convolution filtering on the digital input signal with the updated tap coefficients to generate a digital noise-resistant wave signal. After digital-to-analog conversion and power amplification, the signal is radiated outward through the headphone speaker to cancel out the ambient noise picked up by the microphone.