Self-adaptive sound equipment equalization calibration method

Through the adaptive audio equalization calibration method, the problems of low efficiency and poor adaptability of audio self-calibration in the existing technology are solved, and efficient and stable multi-scene audio calibration is achieved on resource-constrained platforms, thereby improving the sound quality performance of the audio system.

CN120711339AActive Publication Date: 2025-09-26CHENGDU SHUIYUEYU TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510833511.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-26
Estimated Expiration
2045-06-20

AI Technical Summary

Technical Problem

Existing audio self-calibration technology runs inefficiently on resource-constrained embedded platforms and is difficult to adapt to multiple scenarios. It also suffers from limited test signal flexibility, restricted target frequency response generation, imprecise filter design, and insufficient gain and parameter optimization, resulting in unstable calibration results.

Method used

An adaptive sound equalization calibration method is adopted. By collecting audio signals and performing short-time Fourier transform, the target level is calculated and smoothed, significant peaks are identified and binomial fitting is performed, Gaussian functions are constructed to simulate filter parameters, and the frequency response curve is iteratively adjusted in rounds to generate a lightweight peak filter that can adapt to different acoustic environments.

Benefits of technology

It achieves efficient calibration on resource-constrained platforms, adapts to multi-scenario applications, improves calibration efficiency and listening quality, reduces computational complexity and equipment deployment complexity, and enhances applicability and stability in different acoustic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120711339A_ABST
    Figure CN120711339A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive sound equipment equalization calibration method. The method comprises the following steps: acquiring an audio signal of an audio system and carrying out short-time Fourier transform on the audio signal to obtain a frequency response curve; calculating a target level according to the frequency response curve; carrying out smoothing processing on the acquired frequency response curve; whether a peak value larger than a threshold value exists in the smoothed frequency response curve or not is judged, the influence of a current peak filter on frequency response is simulated through a Gaussian function according to peak filter parameters, the influence is superposed on the smoothed frequency response curve, and a new adjusted frequency response curve is obtained; if the number of iterations is greater than or equal to a preset value, ending iteration, outputting a peak filter parameter, and configuring a peak filter by adopting the peak filter parameter; and inputting the audio signal into a plurality of configured peak filters to obtain an audio signal after equalization calibration. The sound equipment equalization calibration efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of self-calibration technology, and in particular to an adaptive sound equalization calibration method. Background Art

[0002] Audio self-calibration technology uses an algorithm to automatically optimize the frequency response of an audio system, improving sound quality in varying acoustic environments. This technology uses a microphone to collect ambient sound field data, analyze the frequency response characteristics, and generate equalization filter parameters to correct for fluctuations in the frequency response, thereby improving the consistency of the audio output. Currently, this technology is widely used in professional recording studios, consumer audio systems, and smart home devices.

[0003] The self-calibration process typically involves stimulating the audio device with a specific test signal (such as a swept frequency signal or noise signal), collecting environmental response data, and calculating a target frequency response curve based on this data. The algorithm then designs filters to adjust the frequency response to approximate the target curve. To meet diverse application requirements, calibration must balance high-precision measurement with adaptation to complex scenarios. For example, professional recording studios require precise calibration in a fixed location, while home environments require adaptation to a variety of listening areas.

[0004] The problems existing in the prior art are as follows:

[0005] 1. Inefficient algorithms: Some audio self-calibration algorithms are complex and rely on large-scale computations, resulting in low efficiency on resource-constrained embedded platforms. Calibration also takes a long time, reducing the user experience.

[0006] 2. Limited flexibility of test signals: Existing technologies mostly use a single test signal mode, which makes it difficult to simultaneously meet the needs of high-precision measurement at a fixed position and adaptation to dynamic areas, limiting its applicability in multiple scenarios.

[0007] 3. Limitations of target frequency response generation: Some algorithms rely on preset templates or external reference data (such as standard curves) to generate target frequency response curves. When faced with complex acoustic environments, the configuration is complex and the universality is poor.

[0008] 4. Filter design issues: Some algorithms generate an excessive number of filters to process multiple frequency fluctuations simultaneously, which can lead to over-adjustment of the frequency response and affect the listening experience. Furthermore, existing algorithms often rely on simple rules (such as fixed Q values) or empirical parameters (based on preset values) when estimating the adjustment bandwidth, rather than dynamically adjusting according to the characteristics of the actual sound field data. This makes it difficult to accurately capture peak characteristics, resulting in unstable calibration results.

[0009] 5. Insufficient gain and parameter optimization: Some algorithms fail to effectively constrain the gain amplitude, which can easily introduce excessive forward gain and cause distortion (such as clipping). At the same time, the filter parameter design is not fully optimized to match the perceptual characteristics of the human ear, resulting in poor audible calibration results. Summary of the Invention

[0010] In view of this, the present application provides an adaptive sound equalization calibration method.

[0011] The present application discloses an adaptive sound equalization calibration method, which includes:

[0012] Step 1: Collect the audio signal of the audio system and perform short-time Fourier transform on it to obtain the frequency response curve;

[0013] Step 2: Calculate a target level based on the frequency response curve for calibration;

[0014] Step 3: Smooth the collected frequency response curve;

[0015] Step 4: Determine whether there is a peak greater than a threshold in the smoothed frequency response curve. If so, find the maximum peak among all peaks, calculate the frequency, peak height, and half-peak width of the maximum peak, extract the frequency response curve data within the half-peak width range, perform binomial fitting, construct the intersection point with the height of the peak drop by a specified proportion, obtain two boundary frequencies, and calculate the bandwidth and quality factor of the maximum peak; the frequency corresponding to the maximum peak is the center frequency; the gain of the maximum peak is the amplitude of the peak value of the maximum peak exceeding the target level in step 2; the peak filter parameters include center frequency, quality factor, and gain;

[0016] Step 5: Based on the peak filter parameters, simulate the effect of the current peak filter on the frequency response through the Gaussian function, and superimpose its effect on the smoothed frequency response curve in step 3 to obtain the adjusted new frequency response curve for the next round of iteration; save the parameters of the current peak filter into the filter parameter group and proceed to step 4;

[0017] Step 6: If the number of iterations is greater than or equal to the preset value, the iteration is terminated, the filter parameter group of all the saved peak filters is output, and the filter parameter group is used to configure several peak filters;

[0018] Step 7: Input the audio signal into the configured peak filters to obtain an audio signal after equalization calibration.

[0019] Furthermore, the step 2 includes:

[0020] Select frequency band data within a specified frequency range from the frequency response data collected in step 1, calculate the average value of all amplitude values ​​within the frequency band data, and use the average value as the target level of the frequency response curve; the target level represents the target frequency response level.

[0021] Furthermore, the step 3 includes:

[0022] For each frequency point of the frequency response collected in step 2, calculate its k-octave frequency range. Within this frequency range, take the average of all amplitude values ​​and use this average to replace the amplitude value of the corresponding frequency point in the original frequency response curve.

[0023] Furthermore, the step 4 includes:

[0024] The frequency point of the peak filter is called to store the subsequent peak filter parameters, including center frequency, quality factor and gain; for the smoothed frequency response curve, significant peak detection, selection of priority processing value, local data extraction and fitting, calculation of bandwidth and quality factor, calculation of gain, filter effect simulation and update, and parameter saving are repeated until the number of iterations reaches the preset value or there are no significant peaks that need to be processed.

[0025] Furthermore, the significance peak detection includes:

[0026] Perform neighborhood comparison on the frequency response curve, extract all local extreme points and use them as peak points, calculate the elevation of each peak point relative to its neighborhood baseline, i.e., the protrusion, and set a minimum protrusion threshold to filter out non-structural outliers caused by relevant factors; for each valid peak, estimate its half-height width; relevant factors include environmental noise and fluctuations;

[0027] The selection priority value includes:

[0028] From all detected peaks, the peak with the strongest current energy, that is, the point with the largest amplitude, is selected as the priority processing object.

[0029] Furthermore, the local data extraction and fitting includes:

[0030] Centered on the peak frequency f c , taking the half-height width as the range, extract the local frequency response data {(f i ,R i )}, and fit it with a quadratic polynomial model:

[0031] R i ≈af i 2 +bf i +c

[0032] Among them, {a, b, c} are the coefficients of the polynomial to be found, which meet the least squares criterion:

[0033]

[0034] By solving the least squares problem, a local response model is constructed to describe the shape of the peak:

[0035]

[0036] Where i = 1, 2, ..., N, f i is the frequency of the ith frequency point, R i is the amplitude corresponding to the i-th frequency point, N is the total number of frequency points, is the peak value corresponding to frequency f.

[0037] Furthermore, the calculation of bandwidth and quality factor includes:

[0038] Construction guides:

[0039] Let the current peak amplitude be R peak , in the fitting curve Based on this, a constant reference line is constructed: R ref =R peak -3dB

[0040] Solve for the intersection point:

[0041] Equating the quadratic fitting curve with the constant reference line yields the quadratic equation:

[0042]

[0043] af 2 +bf+c-(R peak -3)=0

[0044] Solve the two real roots f1 and f2 of the quadratic equation, which correspond to the -3dB boundary frequencies respectively;

[0045] Calculate bandwidth and quality factor:

[0046] Bandwidth: BW = |f2-f1|

[0047] Quality Factor:

[0048] Among them, f c is the center frequency of the peak.

[0049] Furthermore, the calculating gain includes:

[0050] Calculate the difference between the current peak amplitude and the target level. Only perform negative attenuation on the frequency bands with excessive energy, that is, the parts with peak amplitudes higher than the target level, with the gain value equal to the difference. The maximum attenuation is limited to the specified decibels.

[0051] The filter effect simulation and update includes:

[0052] Using a Gaussian function to approximate the effect of the filter on the frequency response:

[0053] The filter parameters obtained in each round of iteration include the center frequency f c , bandwidth BW, gain Gain, construct the following Gaussian function:

[0054]

[0055] in, That is, half of the bandwidth is used to control the diffusion width of the Gaussian function;

[0056] The effect of the Gaussian function is superimposed on the current frequency response curve to simulate the frequency response curve after the filter adjustment; the updated frequency response curve is used as the input for the next round of iteration;

[0057] The parameter saving includes:

[0058] Save the peak filter parameters generated in the current round into an array.

[0059] Furthermore, the step 4 further includes:

[0060] If there is no peak greater than the threshold in the smoothed frequency response curve, skip directly to step 6;

[0061] If normal fitting is not possible, the quality factor is set using empirical methods.

[0062] Furthermore, in step 6, the filter array is used to configure several peak filters, including:

[0063] According to the parameters of the peak filter in the filter array, a digital angular frequency, a gain coefficient and a filter bandwidth factor are obtained;

[0064] According to the digital angular frequency, the gain coefficient and the filter bandwidth factor, the coefficient of the peak filter is obtained;

[0065] All coefficients of the peak filter are normalized by dividing them by a specified value to obtain final peak filter coefficients, and the peak filter is configured using the final peak filter coefficients; the specified value is one of all coefficients before normalization.

[0066] Due to the adoption of the above technical solution, this application has the following advantages: while overcoming the limitations of existing technologies, this application optimizes performance for diverse application scenarios and achieves the following main technical effects:

[0067] 1. Low resource usage: The algorithm uses lightweight polynomial fitting and iterative peak suppression logic, enabling efficient operation on resource-constrained embedded platforms such as the ARM Cortex-M4. A single calibration process takes 5 seconds, with minimal computational overhead, making it suitable for real-time applications.

[0068] 2. Dual-mode signal acquisition, adapting to multiple scenarios: The algorithm supports two different signal acquisition modes to meet different usage requirements:

[0069] Sweep Signal Mode: Suitable for high-precision frequency response measurements at a fixed listening position, meeting the stringent requirements of professional recording studios.

[0070] Handheld Pink Noise Mode: By moving the microphone around the listening area, the user collects sound, simulating multi-position averaging. This effectively addresses the measurement challenge of "no fixed sweet spot" in home environments, reduces device deployment complexity, and improves adaptability to dynamic acoustic environments.

[0071] 3. Adaptive Target Frequency Response Extraction: The algorithm calculates the actual average response from the 500Hz to 2000Hz frequency band as the target frequency response curve, eliminating the need to rely on a preset ideal curve or external reference sound field data. This adaptive approach simplifies deployment and enhances versatility in diverse acoustic environments. It is more convenient and universally applicable than traditional methods that rely on the difference between the reference and current sound field frequency responses.

[0072] 4. Prioritizing significant peaks for optimized filtering efficiency and listening experience: The algorithm employs a round-by-round iterative peak clipping strategy, processing only the most significant peaks in each round. Compared to identifying multiple peaks and assigning multiple filters simultaneously, this effectively controls the number of equalization filters and avoids over-correction of the frequency response curve. Each round of iteration updates the adjusted frequency response curve, dynamically approaching the target response, ensuring controllable filter parameters and enhancing the naturalness of the listening experience.

[0073] 5. Bandwidth estimation based on fitting and real root solution: For each peak region, a quadratic polynomial curve is fitted to calculate the intersection frequency with the -3dB level, accurately estimating the bandwidth. Compared with existing rough estimation methods that rely on "adjacent valley differences" or "half-amplitude energy points," this method is more accurate and stable. If the fitting fails, it automatically falls back to the empirical Q value (e.g., low-frequency Q ≤ 10, mid-frequency Q ≤ 5), ensuring a balance between accuracy and robustness.

[0074] 6. Optimized for Embedded Use: To avoid multiple frequency-domain filtering operations, each iteration uses a Gaussian function corresponding to the equalization parameters to approximate the filter's effect on the frequency response. Using center frequency, bandwidth, and gain as control parameters, the Gaussian function rapidly updates the current frequency response, eliminating the need to construct or calculate the biquad filter response in real time. This approach significantly reduces computational complexity and resource consumption, making it particularly suitable for embedded use cases.

[0075] 7. Controllable Gain: The algorithm only clips peaks (negative gain) and does not boost valleys, avoiding compression, clipping, or distortion caused by positive gain. The maximum gain attenuation is set to -12dB, controlling the filter intensity and preventing sound quality loss. Both gain and Q values ​​are frequency-band constrained (e.g., low-frequency Q ≤ 10, mid-frequency Q ≤ 5), which aligns with human ear perception and further optimizes the naturalness and comfort of listening. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0077] Figure 1 Schematic diagram of a flow chart of an adaptive audio equalization calibration method according to an embodiment of the present application. DETAILED DESCRIPTION

[0078] The present application is further described with reference to the accompanying drawings and embodiments. The embodiments described are only a part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field should fall within the scope of protection of the embodiments of the present application.

[0079] See also Figure 1 The present application provides an embodiment of an adaptive sound equalization calibration method, which includes:

[0080] S1: Collect the audio signal of the audio system and perform short-time Fourier transform on it to obtain the frequency response curve;

[0081] In the embodiment of the present application, method A (sweep signal acquisition) or method B (pink noise acquisition) is selected to acquire the frequency response curve of the audio system to provide basic data for subsequent analysis.

[0082] Regarding method A: frequency sweep signal acquisition, the operation process is as follows:

[0083] 1. Fix the microphone at the typical listening point of the audio system (such as where the user usually sits) to ensure that the microphone position is stable.

[0084] 2. Play a 2-second chirp three times in a row. The chirp gradually changes from a low frequency (e.g., 20 Hz) to a high frequency (e.g., 20 kHz). The change can be linear or logarithmic.

[0085] 3. The microphone simultaneously collects the response signals of these three playbacks and records the audio data of each time.

[0086] The data processing involved in Method A is as follows:

[0087] 1. Perform short-time Fourier transform (STFT) on the collected signal to convert the time domain signal into the frequency domain and extract the steady-state frequency response characteristics of the system under static conditions.

[0088] 2. Take the average of the frequency response data collected three times to reduce the impact of transient interference in the environment (such as sudden background noise or short sound wave reflection) on the frequency response estimation.

[0089] Advantages: This method is suitable for use in static environments. Multiple averaging can improve the accuracy of frequency response estimation and reduce noise interference.

[0090] Method B: Pink noise acquisition, the operation process is as follows:

[0091] Play the pink noise signal. The characteristic of pink noise is that its power spectrum density decreases as the frequency increases, simulating the frequency distribution of natural sounds.

[0092] The user holds the microphone and slowly moves or rotates it within the typical listening area, for example, moving it forward, backward, left, and right at the listening point, or rotating it around a central point to cover multiple angles.

[0093] The data processing involved in Method B is as follows:

[0094] From the collected audio data, the middle 10 seconds of stable audio are selected as the analysis object, and the possibly unstable parts at the beginning and end (such as the jitter when the user just starts to move) are removed.

[0095] Perform short-time Fourier transform (STFT) on the 10-second audio and extract the frequency response curve.

[0096] By using a spatial moving average (i.e., smoothing the data collected at different locations), the effects of standing waves (frequency distortion caused by room reflections) and local anomalies (such as echoes at a certain location) are weakened.

[0097] Advantages: This method is suitable for dynamic environments. It improves the spatial robustness of frequency response estimation through spatial averaging and can better reflect the overall acoustic characteristics of the room.

[0098] Output a: Both methods will generate a frequency response curve, which contains a frequency axis (usually from 20Hz to 20kHz) and the corresponding amplitude value (in decibels).

[0099] S2: Calculate a target level based on the frequency response curve for calibration.

[0100] In the embodiment of the present application, the adjustment target of the audio system is defined by analyzing the frequency response data of a specific frequency band. The operation process is as follows:

[0101] 1. From the frequency response data collected by S1 (the data here corresponds to output a), select the frequency band data from 500 Hz to 2000 Hz.

[0102] 2. Calculate the average value of all amplitude values ​​within the frequency band and use this average value as the target level of the target frequency response curve for subsequent frequency response calibration and peak filter parameter adjustment.

[0103] Output b: A scalar value representing the target frequency response level (in decibels), which serves as a reference standard for subsequent adjustments.

[0104] S3: Smoothing the collected frequency response curve;

[0105] In the embodiment of the present application, the frequency response curve is smoothed to reduce the influence of noise and spikes while retaining the main trend. The operation process is as follows:

[0106] 1. For each frequency point of the frequency response collected by S2 (corresponding to output a), calculate its 1 / 6 octave frequency range (i.e., a smaller frequency window with upper and lower limits based on the logarithmic scale of the current frequency).

[0107] 2. Take the average of all amplitude values ​​within this frequency range.

[0108] 3. Replace the amplitude value of the frequency point in the original curve with the calculated average value.

[0109] Purpose: Smoothing can reduce the impact of frequency spikes (such as local amplification caused by standing waves) while preserving the overall trend of the frequency response curve and preventing subsequent steps from being disturbed by noise.

[0110] Output c: The smoothed frequency response curve is smoother than the original curve and suitable for further analysis.

[0111] S4: Determine whether there is a peak greater than a threshold in the smoothed frequency response curve. If so, find the maximum peak among all peaks, calculate the frequency, peak height and half-peak width of the maximum peak, extract the frequency response curve data within the half-peak width range, perform binomial fitting, construct an intersection point with the height of the fitting curve and the peak drop by a specified proportion, obtain two boundary frequencies, calculate the bandwidth and quality factor of the maximum peak; obtain the center frequency based on the bandwidth; the gain of the maximum peak is the amplitude of the peak value of the maximum peak exceeding the target level of S2; the peak filter parameters include the center frequency, quality factor and gain;

[0112] In this embodiment, the peak filter parameters are generated through an iterative process, gradually adjusting the frequency response curve to approach the target level (corresponding to output b) until a predetermined number of iterations (e.g., 10) are achieved. The overall process is as follows: 1. A peak filter frequency point is called to store subsequent peak filter parameters, including center frequency, quality factor, and gain. 2. For the smoothed frequency response curve (corresponding to output c), the following sub-steps (S4.1 to S4.7) are repeated until the number of iterations reaches 10 or there are no significant peaks to process.

[0113] Step S4 includes S4.1 to S4.7, which are specifically as follows:

[0114] S4.1: Significant peak detection:

[0115] Overview: The significant peak detection process is based on a combined strategy of "local maxima + prominence criteria." By performing neighborhood comparisons on the frequency response curve, all local extreme points are extracted. The elevation (prominence) of each peak point relative to its left and right neighboring baselines is then calculated, and a minimum prominence threshold is set to filter out non-structural outliers caused by factors such as environmental noise and fluctuations. For each significant peak, its full width at half maximum is further estimated to provide basic data for subsequent bandwidth and Q calculations.

[0116] Range: Only the frequency band below 500Hz is processed, as the low frequency band is more likely to have significant peak problems, such as low-frequency resonance.

[0117] The specific operation process of S4.1 is as follows:

[0118] S4.11: Local Maximum Identification:

[0119] The function first traverses the input signal data sequence {x1,x2,...,x N-1 ,x N}, find the point that satisfies the following conditions:

[0120] x n >x n-1 And x n >xn+1

[0121] That is, the point x n The local maximum value is used as the local peak point. This can be achieved by first-order difference sign change or sliding window comparison.

[0122] S4.12: Calculation of protrusion:

[0123] For each local peak point, calculate its "prominence", that is, the minimum height difference between the point and the valley bottom of its left and right envelopes. The calculation steps include:

[0124] Traverse the signal left and right to find the minimum value between the nearest higher peaks on either side of the current peak. Subtract the local valley value from the current peak amplitude to obtain the prominence. If the prominence is less than a set threshold (such as 1dB), the peak is considered insignificant and discarded. This ensures that only peaks with clear upward trends are retained, filtering out spurious peaks caused by minor fluctuations or random noise.

[0125] S4.13: Calculate peak width:

[0126] (1) Based on the significance value of the peak, the peak width is determined as the peak height minus half of the prominence, that is, the height from the peak amplitude down to half of its significance value.

[0127] (2) Width boundary positioning:

[0128] Left Boundary: Move leftward from the peak point to find the location where the signal amplitude first equals or falls below the measurement height.

[0129] Right Boundary: Move rightward from the peak point to find the location where the signal amplitude first equals or falls below the measurement height.

[0130] (3) Calculate peak width:

[0131] According to the physical coordinates of the horizontal axis of the signal (such as the frequency value), the distance between the left and right boundaries is calculated to obtain the peak width at the half-significance height.

[0132] Output d1: A peak list containing the center frequency and half-height width of each peak. The half-height in half-height width refers to the height of half the peak, and the width refers to the bandwidth corresponding to half the height of the peak.

[0133] S4.2: Select the priority value:

[0134] From all detected peaks (corresponding to all peaks in the peak list of output d1), the peak with the strongest energy (i.e., the point with the largest amplitude) is selected as the priority for processing. This step ensures that the self-calibration process focuses on the most significant frequency anomalies, avoiding minor issues. Output d2: Information about the currently processed peak, including its center frequency and amplitude.

[0135] S4.3: Local data extraction and fitting:

[0136] Centered on the peak frequency f c (corresponding to the center frequency in output d2), extract the local frequency response data {(f i ,R i )} (that is, only focusing on a small section of the frequency response curve near the peak), it is fitted by a quadratic polynomial model:

[0137] R i ≈af i 2 +bf i +c(i=1,2,...,N)

[0138] Among them, {a, b, c} are the coefficients of the polynomial to be found, which meet the least squares criterion:

[0139]

[0140] By solving the above least squares problem, a local response model is established to describe the shape of the peak:

[0141]

[0142] Among them, f i is the frequency of the ith frequency point, R i is the amplitude corresponding to the i-th frequency point, N is the total number of frequency points, is the peak value corresponding to frequency f.

[0143] Output d3: fitted quadratic function (used to represent this curve) for subsequent calculations.

[0144] S4.4: Calculate bandwidth and quality factor:

[0145] Bandwidth describes the effective frequency range covered by a peak in a frequency response curve and is typically calculated using the –3dB method. The –3dB threshold represents a 3dB drop in amplitude at that frequency point, equivalent to halving the signal power. This is a standard critical point in audio filter design.

[0146] S4.4 includes the following steps S4.41 to S4.43:

[0147] S4.41: Construction reference lines:

[0148] Let the current peak amplitude be R peak , in the fitting curve (corresponding to output d3) based on which a constant reference line is constructed:

[0149] R ref =R peak -3dB

[0150] S4.42: Solve for the intersection point:

[0151] Equating the quadratic fit curve with the reference line yields the quadratic equation:

[0152]

[0153] af 2 +bf+c-(R peak -3)=0

[0154] Solve the equation for the two real roots f1 and f2, which correspond to the -3dB boundary frequencies.

[0155] S4.43: Calculate bandwidth and quality factor:

[0156] Bandwidth: BW = |f2-f1|

[0157] Quality Factor:

[0158] Among them, f c is the center frequency of the peak.

[0159] Regarding exception handling in S4.4:

[0160] If the fitted quadratic function does not provide two valid intersection points (e.g., due to ambiguous peak shapes or data anomalies), use a rule of thumb: if the center frequency is below 200 Hz, set the quality factor to 10; otherwise, set the quality factor to 5 (default value).

[0161] Output d4: bandwidth and quality factor.

[0162] S4.5: Calculate the gain:

[0163] Calculate the difference between the current peak amplitude and the target level (corresponding to output b). Apply negative attenuation only to frequencies with excessive energy (i.e., peak amplitudes above the target level), using the gain value of this difference. Limit the maximum attenuation to -12dB to avoid excessive attenuation that could degrade audio quality. Avoid positive gain (i.e., no amplitude increase) to prevent system limiting or distortion.

[0164] Output d5: gain value (in decibels, usually negative).

[0165] S4.6: Filter Effect Simulation and Update:

[0166] The effect of using Gaussian function to approximate the peak filter on the frequency response: For the peak filter parameter group (center frequency f c (corresponding to output d2), bandwidth BW (corresponding to output d4), gain Gain (corresponding to output d5)), construct the following Gaussian function:

[0167]

[0168] in, That is, half of the bandwidth is used to control the diffusion width of the Gaussian function.

[0169] The effect of the Gaussian function is superimposed on the current frequency response curve to simulate the frequency response after the filter adjustment. The updated frequency response curve serves as the input for the next iteration. The updated frequency response curve is output.

[0170] S4.7: Parameter saving:

[0171] The parameters of the peak filter generated in the current round (center frequency (corresponding to the center frequency in output d2), quality factor (corresponding to the quality factor in output d4), and gain value (corresponding to output d5)) are saved in an array.

[0172] Output: Peak filter parameter group, recording all generated parameters.

[0173] The iterative control in step S4 is:

[0174] Each iteration attenuates the most significant peak, gradually bringing the frequency response curve closer to the target level. A maximum of 10 iterations can be performed. If no significant peaks remain (e.g., all peaks have been attenuated below the target level) or the maximum number of iterations is reached, the iteration ends.

[0175] S5: Based on the peak filter parameters, the Gaussian function is used to simulate the effect of the current peak filter on the frequency response. The effect is superimposed on the smoothed frequency response curve in S3 to obtain the adjusted new frequency response curve for the next round of iteration, and then enter S4.

[0176] S6: If the number of iterations is greater than or equal to a preset value, the iteration is terminated, a peak filter parameter group consisting of all the saved peak filters is output, and a plurality of peak filters are configured using the peak filter parameter group;

[0177] In the embodiment of the present application, each set of peak filter parameters generated by the above algorithm, including the center frequency fc (corresponding to the center frequency in output d2), the quality factor Q (corresponding to the quality factor in output d4), and the gain value Gain (corresponding to output d5) are converted into biquad filter coefficients that can be directly deployed in digital audio processing.

[0178] The specific operation process is as follows:

[0179] 1. Calculate intermediate variables:

[0180] Set the sampling rate to f s , then the intermediate variables are defined as follows:

[0181] Digital angular frequency:

[0182]

[0183] Gain factor:

[0184] A=10 G / 40

[0185] Filter bandwidth factor:

[0186]

[0187] 2. Calculate the peak filter coefficients:

[0188] The time domain form of the biquad filter processing audio is as follows (difference equation):

[0189] y(n)=b0*x(n)+b1*x(n-1)+b2*x(n-2)-a1*y(n-1)-a2*y(n-2)

[0190] The corresponding transfer function in the Z domain is:

[0191]

[0192] The coefficients are usually normalized and the numerator and denominator are divided by a0 to recalculate the coefficients so that a0 = 1:

[0193]

[0194] 3. Calculate the peak filter coefficients:

[0195] This application mainly uses peak filters:

[0196] b0=1+αA

[0197] b1=-2cos(ω0)

[0198] b2=1-αA

[0199]

[0200] a1=-2cos(ω0)

[0201]

[0202] Divide all coefficients by a0 and normalize them to get the final filter coefficients:

[0203]

[0204] Finally, the filter coefficient array {b0′, b1′, b2′, a1′, a′2} is obtained, which is used to construct the biquad filter structure.

[0205] Biquad filters have the advantages of high computational efficiency and adjustable amplitude response and are widely used in audio equalization systems.

[0206] S7: Input the audio signal into the configured multiple peak filters to obtain an audio signal after equalization calibration. Multiple peak filters can form an equalizer EQ.

[0207] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit them. Although the present application has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present application can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present application should be included in the scope of protection of the claims of the present application.

Claims

1. An adaptive sound equalization calibration method, characterized in that: include: Step 1: Collect the audio signal of the audio system and perform short-time Fourier transform on it to obtain the frequency response curve; Step 2: Calculate a target level based on the frequency response curve for calibration; Step 3: Smooth the collected frequency response curve; Step 4: Determine whether there is a peak greater than a threshold in the smoothed frequency response curve. If so, find the maximum peak among all peaks, calculate the frequency, peak height, and half-peak width of the maximum peak, extract the frequency response curve data within the half-peak width range, perform binomial fitting, construct the intersection point with the height of the peak drop by a specified proportion, obtain two boundary frequencies, and calculate the bandwidth and quality factor of the maximum peak; the frequency corresponding to the maximum peak is the center frequency; the gain of the maximum peak is the amplitude of the peak value of the maximum peak exceeding the target level in step 2; the peak filter parameters include center frequency, quality factor, and gain; Step 5: Based on the peak filter parameters, simulate the effect of the current peak filter on the frequency response through the Gaussian function, and superimpose its effect on the smoothed frequency response curve in step 3 to obtain the adjusted new frequency response curve for the next round of iteration; save the parameters of the current peak filter into the filter parameter group and proceed to step 4; Step 6: If the number of iterations is greater than or equal to the preset value, the iteration is terminated, the filter parameter group of all the saved peak filters is output, and the filter parameter group is used to configure several peak filters; Step 7: Input the audio signal into the configured peak filters to obtain an audio signal after equalization calibration.

2. The method according to claim 1, characterized in that The step 2 includes: Select frequency band data within a specified frequency range from the frequency response data collected in step 1, calculate the average value of all amplitude values ​​within the frequency band data, and use the average value as the target level of the frequency response curve; the target level represents the target frequency response level.

3. The method according to claim 1, characterized in that The step 3 comprises: For each frequency point of the frequency response collected in step 2, calculate its k-octave frequency range. Within this frequency range, take the average of all amplitude values ​​and use this average to replace the amplitude value of the corresponding frequency point in the original frequency response curve.

4. The method according to claim 1, wherein The step 4 comprises: The frequency point of the peak filter is called to store the subsequent peak filter parameters, including center frequency, quality factor and gain; for the smoothed frequency response curve, significant peak detection, selection of priority processing value, local data extraction and fitting, calculation of bandwidth and quality factor, calculation of gain, filter effect simulation and update, and parameter saving are repeated until the number of iterations reaches the preset value or there are no significant peaks that need to be processed.

5. The method according to claim 4, characterized in that The significant peak detection includes: Perform neighborhood comparison on the frequency response curve, extract all local extreme points and use them as peak points, calculate the elevation of each peak point relative to its neighborhood baseline, i.e., the protrusion, and set a minimum protrusion threshold to filter out non-structural outliers caused by relevant factors; for each valid peak, estimate its half-height width; relevant factors include environmental noise and fluctuations; The selection priority value includes: From all detected peaks, the peak with the strongest current energy, that is, the point with the largest amplitude, is selected as the priority processing object.

6. The method according to claim 4, characterized in that The local data extraction and fitting include: Centered on the peak frequency f c , taking the half-height width as the range, extract the local frequency response data {(f i ,R i )}, and fit it with a quadratic polynomial model: R i ≈af i 2 +bf i +c Among them, {a, b, c} are the coefficients of the polynomial to be found, which meet the least squares criterion: By solving the least squares problem, a local response model is constructed to describe the shape of the peak: Where i = 1, 2, ..., N, f i is the frequency of the ith frequency point, R i is the amplitude corresponding to the i-th frequency point, N is the total number of frequency points, is the peak value corresponding to frequency f.

7. The method according to claim 4, characterized in that The calculation of bandwidth and quality factor includes: Construction guides: Let the current peak amplitude be R peak , in the fitting curve Based on this, a constant reference line is constructed: R ref =R peak -3dB Solve for the intersection point: Equating the quadratic fitting curve with the constant reference line yields the quadratic equation: of 2 +bf+c-(R peak -3)=0 Solve the two real roots f1 and f2 of the quadratic equation, which correspond to the -3dB boundary frequencies respectively; Calculate bandwidth and quality factor: Bandwidth: BW = |f2-f1| Quality Factor: Among them, f c is the center frequency of the peak.

8. The method according to claim 4, characterized in that The calculation gain includes: Calculate the difference between the current peak amplitude and the target level. Only perform negative attenuation on the frequency bands with excessive energy, that is, the parts with peak amplitudes higher than the target level, with the gain value equal to the difference. The maximum attenuation is limited to the specified decibels. The filter effect simulation and update includes: Using a Gaussian function to approximate the effect of the filter on the frequency response: The filter parameters obtained in each round of iteration include the center frequency f c , bandwidth BW, gain Gain, construct the following Gaussian function: in, That is, half of the bandwidth is used to control the diffusion width of the Gaussian function; The effect of the Gaussian function is superimposed on the current frequency response curve to simulate the frequency response curve after the filter adjustment; the updated frequency response curve is used as the input for the next round of iteration; The parameter saving includes: Save the peak filter parameters generated in the current round into an array.

9. The method according to claim 1, characterized in that The step 4 further comprises: If there is no peak greater than the threshold in the smoothed frequency response curve, skip directly to step 6; If normal fitting is not possible, the quality factor is set using empirical methods.

10. The method according to claim 4, characterized in that In step 6, the filter array is used to configure several peak filters, including: According to the parameters of the peak filter in the filter array, a digital angular frequency, a gain coefficient and a filter bandwidth factor are obtained; According to the digital angular frequency, the gain coefficient and the filter bandwidth factor, the coefficient of the peak filter is obtained; All coefficients of the peak filter are normalized by dividing them by a specified value to obtain final peak filter coefficients, and the peak filter is configured using the final peak filter coefficients; the specified value is one of all coefficients before normalization.

Citation Information

Patent Citations

  • Audio calibration method and device

    CN117528382A

  • Improved frequency response fitting method and device and storage medium

    CN118249781A

  • Method and apparatus to compensate for imperfections in sound field using peak and dip frequencies

    US20050119879A1

  • Adaptive post-filtering technique based on the Modified Yule-Walker filter

    US6233552B1

Cited By

  • Audio frequency response automatic equalization method, system and device and storage medium

    CN121418725A