Automatic equalization amplitude-frequency response method and device, equipment and storage medium
By analyzing the frequency sweep signal of the loudspeaker and using Fourier transform and filter coefficient adjustment, the automatic equalization amplitude-frequency response of the loudspeaker was realized, which solved the time-consuming and laborious debugging problem in the existing technology and improved the listening effect.
Patent Information
- Application Number
- CN202511105114.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-11-11
AI Technical Summary
In the existing technology, adjusting the amplitude-frequency response of a loudspeaker to improve the listening effect requires repeated adjustments, which is time-consuming and labor-intensive, and is difficult to automate.
By analyzing the actual amplitude-frequency response of the swept frequency signal, the peak filter coefficients are obtained using Fast Fourier Transform, and narrowband compensation and wideband frequency band difference quantization are performed to generate the target filter coefficients, ultimately achieving automatic equalization of the amplitude-frequency response.
It achieves automatic equalization of the speaker's amplitude and frequency response, improving the listening experience and reducing the need for and time for manual adjustments.
Smart Images

Figure CN120932660A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of audio signal processing, and in particular to an automatic equalization amplitude-frequency response method, apparatus, device, and storage medium. Background Technology
[0002] A swept-frequency signal is a signal whose frequency changes continuously over time according to a specific pattern. It is mainly used to test the frequency response of a system or device. Frequency response, in electronics, describes the difference in an instrument's ability to process signals of different frequencies. Any audio device or medium (the object that records sound signals) has a frequency response. Frequency response includes phase response and amplitude response. The human ear is not sensitive to the phase information of audio signals; when the phase distortion does not reach the audible threshold, the phase response is not a major concern. The amplitude response, however, has a direct and obvious impact on the human listening experience. Amplitude response represents the degree of gain or attenuation of a system for signals of different frequencies, that is, the ratio of the output signal amplitude to the input signal amplitude (usually expressed in decibels, dB), also known as amplitude-frequency response or amplitude-frequency characteristic.
[0003] Theoretically, a high-performance, high-reproduction-capability loudspeaker should have a smooth, flat amplitude-frequency response (ARF) curve. However, due to room reflections, the actual measured ARF exhibits varying degrees of peaks and troughs. When reproducing audio in a room using a loudspeaker, given a fixed number of loudspeakers, gain compensation is typically applied to the ARF to reduce the impact of room reflections on sound reproduction and achieve a better listening experience, thus calibrating the room's sound field. In practice, a microphone is used to record the swept frequency signal reproduced by the loudspeaker. The measured swept frequency signal is processed to obtain the ARF. By analyzing the ARF, gain compensation parameters are obtained. Based on these parameters, the ARF is adjusted. Because of room reflections, adjusting the ARF and improving the listening experience becomes a time-consuming and laborious process requiring repeated adjustments.
[0004] Therefore, how to automatically improve the listening experience is a problem that urgently needs to be solved. Summary of the Invention
[0005] The main objective of this application is to provide an automatic equalization amplitude-frequency response method, apparatus, device, and storage medium, which aims to solve the technical problem of how to automatically improve the listening effect.
[0006] To achieve the above objectives, this application proposes an automatic equalization amplitude-frequency response method, the method comprising:
[0007] The sweep frequency signal is obtained according to the preset sampling frequency, and the actual amplitude-frequency response is obtained by performing a fast Fourier transform on the sweep frequency signal.
[0008] The peak filter coefficients are obtained by narrowband compensation and optimization based on the actual amplitude-frequency response.
[0009] The target filter coefficients are obtained by broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response. The target filter coefficients include low-mounted filter coefficients and high-mounted filter coefficients.
[0010] The swept frequency signal is automatically equalized based on the peak filter coefficients and the target filter coefficients to obtain the target amplitude-frequency response.
[0011] In one embodiment, the step of obtaining peak filter coefficients by narrowband compensation and optimization based on the actual amplitude-frequency response includes:
[0012] The target sound pressure level in the low-mid frequency band is obtained based on the actual amplitude-frequency response and the preset low-mid frequency band range.
[0013] The compensated amplitude-frequency response is obtained based on the sound pressure level at each frequency point corresponding to the actual amplitude-frequency response and the target sound pressure level in the low-mid frequency band.
[0014] Peak filter coefficients are obtained by peak detection and quality factor optimization based on the compensated amplitude-frequency response.
[0015] In one embodiment, the step of obtaining peak filter coefficients by peak detection and quality factor optimization based on the compensated amplitude-frequency response includes:
[0016] Peak detection is performed on the compensated amplitude-frequency response to obtain a local minimum value;
[0017] The peak filter gain and peak filter center frequency are obtained by frequency point filtering based on the local minimum value and the preset first threshold.
[0018] Obtain a preset quality factor array, and obtain the peak filter quality factor by traversing the quality factor array according to the preset sampling frequency, the peak filter gain, and the peak filter center frequency;
[0019] The target peak filter gain is obtained by normalizing the peak filter gain.
[0020] The peak filter coefficients are obtained based on the preset sampling frequency, the peak filter center frequency, the peak filter quality factor, and the target peak filter gain.
[0021] In one embodiment, the step of obtaining the target filter coefficients by broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response includes:
[0022] The peak filter cascade amplitude frequency response is obtained based on the peak filter coefficients.
[0023] The corrected amplitude frequency response is obtained based on the peak filter cascade amplitude frequency response and the actual amplitude frequency response;
[0024] Based on the preset frequency band grouping and the corrected amplitude-frequency response, a compressed difference array is obtained by broadband frequency band difference quantization.
[0025] The target filter coefficients are obtained based on the compression difference array and the preset filter quality factor coefficients.
[0026] In one embodiment, the step of obtaining a compressed difference array by performing broadband frequency band difference quantization based on preset frequency band grouping and the corrected amplitude-frequency response includes:
[0027] The average sound pressure level of each frequency band of the corrected amplitude-frequency response is calculated according to the preset frequency band grouping to obtain an array of average sound pressure levels;
[0028] The sound pressure level difference between adjacent frequency bands of the corrected amplitude-frequency response is calculated based on the sound pressure level mean array to obtain the sound pressure level difference array;
[0029] The compression difference array is obtained by traversing the sound pressure level difference array according to the preset segmented compression function.
[0030] In one embodiment, the step of obtaining the target filter coefficients based on the compression difference array and the preset filter quality factor coefficients includes:
[0031] The target filter gain and target filter center frequency are obtained by traversing the compression difference array according to the preset frequency band threshold. The target filter gain includes the low-mounted filter gain and the high-mounted filter gain, and the target filter center frequency includes the low-mounted filter center frequency and the high-mounted filter center frequency.
[0032] The target filter quality factor is obtained based on the preset filter quality factor coefficient, and the target filter quality factor includes the low-mounted filter quality factor and the high-mounted filter quality factor.
[0033] The target filter coefficients are obtained based on the preset sampling frequency, the target filter gain, the target filter center frequency, and the target filter quality factor.
[0034] In one embodiment, the step of automatically equalizing the swept frequency signal based on the peak filter coefficients and the target filter coefficients to obtain the target amplitude-frequency response includes:
[0035] The swept frequency signal is filtered and analyzed based on the peak filter coefficients, the low-level filter coefficients, or the high-level filter coefficients to obtain the current local minimum, the current compression difference array, and the current amplitude-frequency response.
[0036] When the current local minimum value is greater than or equal to a preset first threshold and the current compression difference array is all at a preset second threshold, the current amplitude-frequency response is taken as the target amplitude-frequency response.
[0037] Furthermore, to achieve the above objectives, this application also proposes an automatic equalization amplitude-frequency response device, the device comprising:
[0038] The signal acquisition module is used to acquire a sweep frequency signal according to a preset sampling frequency, and to perform a fast Fourier transform on the sweep frequency signal to obtain the actual amplitude-frequency response.
[0039] The narrowband adjustment module is used to perform narrowband compensation and optimization based on the actual amplitude-frequency response to obtain the peak filter coefficients.
[0040] A broadband adjustment module is used to perform broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response to obtain target filter coefficients, wherein the target filter coefficients include low-mounted filter coefficients and high-mounted filter coefficients.
[0041] An automatic equalization module is used to automatically equalize the swept frequency signal based on the peak filter coefficients and the target filter coefficients to obtain the target amplitude-frequency response.
[0042] In addition, to achieve the above objectives, this application also proposes an automatic equalization amplitude-frequency response device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the automatic equalization amplitude-frequency response method as described above.
[0043] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the automatic equalization amplitude-frequency response method described above.
[0044] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the automatic equalization amplitude-frequency response method described above.
[0045] This application provides an automatic equalization method for amplitude-frequency response. The method includes: acquiring a swept frequency signal based on a preset sampling frequency, and performing a Fast Fourier Transform on the swept frequency signal to obtain an actual amplitude-frequency response; performing narrowband compensation and optimization based on the actual amplitude-frequency response to obtain peak filter coefficients; performing broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response to obtain target filter coefficients, the target filter coefficients including low-profile filter coefficients and high-profile filter coefficients; and automatically equalizing the swept frequency signal based on the peak filter coefficients and the target filter coefficients to obtain a target amplitude-frequency response. In summary, this application achieves automatic equalization of the amplitude-frequency response by analyzing the amplitude-frequency response and using multiple filters for narrowband and broadband adjustments, thereby improving the listening experience. Attached Figure Description
[0046] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating the first embodiment of the automatic equalization amplitude-frequency response method of this application.
[0049] Figure 2 A flowchart illustrating the second embodiment of the automatic equalization amplitude-frequency response method of this application;
[0050] Figure 3 A flowchart illustrating the third embodiment of the automatic equalization amplitude-frequency response method of this application;
[0051] Figure 4 This is a schematic diagram of the module structure of the automatic equalization amplitude-frequency response device according to an embodiment of this application;
[0052] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the automatic equalization amplitude-frequency response method in the embodiments of this application.
[0053] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0054] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0055] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0056] The main solution of this application embodiment is as follows: A swept frequency signal is acquired according to a preset sampling frequency, and a fast Fourier transform is performed on the swept frequency signal to obtain the actual amplitude-frequency response; narrowband compensation and optimization are performed on the actual amplitude-frequency response to obtain peak filter coefficients; wideband frequency band difference quantization is performed on the peak filter coefficients and the actual amplitude-frequency response to obtain target filter coefficients, the target filter coefficients including low-profile filter coefficients and high-profile filter coefficients; automatic equalization is performed on the swept frequency signal based on the peak filter coefficients and the target filter coefficients to obtain the target amplitude-frequency response.
[0057] A swept-frequency signal is a signal whose frequency changes continuously over time according to a specific pattern. It is mainly used to test the frequency response of a system or device. Frequency response, in electronics, describes the difference in an instrument's ability to process signals of different frequencies. Any audio device or medium (the object that records sound signals) has a frequency response. Frequency response includes phase response and amplitude response. The human ear is not sensitive to the phase information of audio signals; when the phase distortion does not reach the audible threshold, the phase response is not a major concern. The amplitude response, however, has a direct and obvious impact on the human listening experience. Amplitude response represents the degree of gain or attenuation of a system for signals of different frequencies, that is, the ratio of the output signal amplitude to the input signal amplitude (usually expressed in decibels, dB), also known as amplitude-frequency response or amplitude-frequency characteristic.
[0058] Theoretically, the amplitude-frequency response (ARF) of a high-performance, high-reproduction loudspeaker should be a smooth, flat curve. However, due to room reflections, the actual measured ARF exhibits varying degrees of peaks and troughs. When reproducing audio in a room using a loudspeaker, given a fixed number of loudspeakers, gain compensation is typically applied to the ARF to reduce the impact of room reflections on sound reproduction and achieve a better listening experience, thus calibrating the room's sound field. In practice, a microphone is used to record the swept frequency signal reproduced by the loudspeaker, and the measured swept frequency signal is processed to obtain the ARF. By analyzing the ARF, gain compensation parameters are obtained. Based on these parameters, the ARF is adjusted. However, due to the influence of room reflections, adjusting the ARF and improving the listening experience becomes a time-consuming and laborious process requiring repeated adjustments. Therefore, how to automatically improve the listening experience is a problem that urgently needs to be solved.
[0059] This application achieves automatic equalization of the amplitude-frequency response by analyzing the amplitude-frequency response and using various filters for narrowband and broadband adjustments, thereby improving the listening experience.
[0060] It should be noted that the executing entity in this embodiment can be an automatic equalization amplitude-frequency response system, or a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of implementing the aforementioned automatic equalization amplitude-frequency response function. This embodiment does not specifically limit it in this regard. The following uses an automatic equalization amplitude-frequency response system as an example to describe this embodiment and the following embodiments.
[0061] Based on this, embodiments of this application provide an automatic equalization amplitude-frequency response method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the automatic equalization amplitude-frequency response method of this application.
[0062] In this embodiment, the automatic equalization amplitude-frequency response method includes steps S10 to S40:
[0063] Step S10: Obtain the sweep frequency signal according to the preset sampling frequency, and perform a fast Fourier transform on the sweep frequency signal to obtain the actual amplitude-frequency response.
[0064] It should be noted that the preset sampling frequency is 48000Hz, which meets the requirements for high-precision sampling of audio signals. In this step, the sweep signal is generated by a signal generator, and its frequency changes continuously over time according to a specific pattern (e.g., increasing by 100Hz per second) to test the frequency response of the system or device. Then, the sweep signal reproduced through the speaker is recorded using a microphone, and the recorded analog signal is converted into a digital signal. Next, as shown in Equation 1:
[0065]
[0066] Performing an FFT (Fast Fourier Transform) on a digital signal yields an nfft / 2-point complex frequency response (where nfft points represent the frequency range [0, 48000], and nfft / 2 points represent the frequency range [0, 24000]), where nfft is the number of points in the Fast Fourier Transform, and data... real and data imag These represent the real and imaginary parts of the nfft / 2-point complex frequency response obtained after the swept frequency signal undergoes a Fast Fourier Transform, respectively. mag The amplitude values at each frequency point are calculated.
[0067] The amplitude at each frequency point is calculated and converted into sound pressure level (i.e., data). SPL This yields the actual amplitude-frequency response. Specifically, as shown in Formula 2:
[0068] data SPL=20log 10 (data mag )(Formula 2)
[0069] Additionally, it should be noted that the actual amplitude-frequency response represents the degree of gain or attenuation of the system for signals of different frequencies, that is, the ratio of the amplitude of the output signal to the amplitude of the input signal.
[0070] Step S20: Perform narrowband compensation and optimization based on the actual amplitude-frequency response to obtain the peak filter coefficients.
[0071] It should be noted that narrowband compensation and optimization refers to the precise compensation of local dips or bulges in the actual amplitude-frequency response using a peak filter to improve the amplitude-frequency characteristics of the system within a specific frequency range. The peak filter coefficients are the core parameters controlling the peak filter's filtering capabilities and are used to adjust the gain within the peak frequency range in digital signal processing.
[0072] Step S30: Perform broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response to obtain the target filter coefficients, which include low-mounted filter coefficients and high-mounted filter coefficients.
[0073] It should be noted that in this step, the system calculates the average sound pressure level (SPL) of each frequency band in the corrected amplitude-frequency response based on preset frequency band groups. Then, it calculates the SPL difference between adjacent frequency bands in the corrected amplitude-frequency response, obtaining an array of SPL difference values. Next, it iterates through the SPL difference array, processing the differences using a piecewise compression function to obtain a compressed difference array. It then iterates through the compressed difference array, recording non-zero differences and their corresponding frequency bands, which serve as the gain and center frequency of the target filter used for broadband adjustment. Finally, based on the target filter's sampling frequency, center frequency, gain, and quality factor, the target filter coefficients are calculated.
[0074] Additionally, it should be noted that broadband frequency band difference quantification refers to analyzing the differences in amplitude-frequency response across different frequency bands to quantify the frequency bands and adjustment amounts that need to be adjusted. The target filter coefficients refer to either low-frequency (below 1000Hz) or high-frequency (above 1000Hz) filter coefficients, specifically selected based on whether the adjusted frequency band is low-frequency (e.g., below 1000Hz) or high-frequency (e.g., above 1000Hz). Low-frequency filter coefficients refer to the filter coefficients used for adjusting low frequencies, while high-frequency filter coefficients refer to the filter coefficients used for adjusting high frequencies.
[0075] Step S40: Automatically equalize the swept frequency signal according to the peak filter coefficients and the target filter coefficients to obtain the target amplitude-frequency response.
[0076] It should be noted that in this step, the system performs time-domain filtering on the swept frequency signal based on the obtained peak filter coefficients, low-profile filter coefficients, or high-profile filter coefficients. Then, the filtered swept frequency signal is reproduced through a speaker and re-recorded using a microphone. Next, the recorded swept frequency signal is subjected to a Fast Fourier Transform again to obtain a new amplitude-frequency response. It is then determined whether the new amplitude-frequency response meets preset conditions. If it does, the automatic equalization process ends, and the new amplitude-frequency response is used as the target amplitude-frequency response; otherwise, the filter coefficients are adjusted based on the new amplitude-frequency response, and the next round of automatic equalization is performed.
[0077] Understandably, the target amplitude-frequency response refers to the amplitude-frequency response that has been significantly improved after automatic equalization, which can better adapt to the listening environment and provide a better listening experience.
[0078] In one feasible implementation, step S40 specifically includes:
[0079] Step S401: Perform filtering analysis on the swept frequency signal based on the peak filter coefficient, the low-level filter coefficient, or the high-level filter coefficient to obtain the current local minimum, the current compression difference array, and the current amplitude-frequency response.
[0080] It should be noted that in this step, the system performs filtering operations on each sampling point of the swept frequency signal according to the filter type (peak filter, low-profile filter, or high-profile filter) and its corresponding coefficients to adjust the frequency domain characteristics of the signal. The actual amplitude-frequency response of the filtered swept frequency signal is then calculated to obtain the compensated amplitude-frequency response. The local minimum points of the compensated amplitude-frequency response and their corresponding frequency positions are considered; these values are referred to as the "current local minimum." Simultaneously, the average sound pressure level of each frequency band of the corrected amplitude-frequency response of the filtered signal is calculated according to preset frequency band groups, and the sound pressure level difference between adjacent frequency bands is further calculated to obtain the current compression difference array. The actual amplitude-frequency response of the swept frequency signal after filtering is referred to as the current amplitude-frequency response.
[0081] Additionally, it should be noted that the current local minimum refers to the lowest sound pressure level on the compensated amplitude-frequency response curve after filtering, reflecting the severity of the remaining bulge in the actual amplitude-frequency response. The current compression difference array refers to the array of sound pressure level differences between adjacent frequency bands on the corrected amplitude-frequency response curve after filtering, processed by a compression function, used to quantify the imbalance between frequency bands. The current amplitude-frequency response refers to the actual amplitude-frequency response of the swept signal measured after filter calibration.
[0082] Step S402: When the current local minimum value is greater than or equal to a preset first threshold and the current compression difference array is all at a preset second threshold, the current amplitude-frequency response is taken as the target amplitude-frequency response.
[0083] It should be noted that the preset first threshold refers to the maximum allowable compensated amplitude-frequency response (e.g., -5dB); if it is lower than this value, further correction is required. The preset second threshold refers to the optimization target of the sound pressure level difference between frequency bands, which is set to 0 in this embodiment. Specifically, in this step, the system checks whether the current local minimum value is ≥ -5dB (first threshold) and whether all elements of the current compression difference array are 0 (second threshold). If both conditions are met, it indicates that the amplitude-frequency response has no significant bulge and the frequency bands are balanced, and the current amplitude-frequency response is output as the target amplitude-frequency response. If the conditions are not met, the system returns to step S401 to adjust the filter coefficients and continue filtering until the termination condition is met.
[0084] Understandably, threshold judgment is used to achieve automatic equalization termination control, ensuring that the amplitude-frequency characteristics of the output signal meet the requirements of the listening environment, while avoiding excessive iteration.
[0085] This embodiment provides an automatic equalization method for amplitude-frequency response. The method includes: acquiring a swept frequency signal based on a preset sampling frequency, and performing a Fast Fourier Transform on the swept frequency signal to obtain an actual amplitude-frequency response; performing narrowband compensation and optimization based on the actual amplitude-frequency response to obtain peak filter coefficients; performing broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response to obtain target filter coefficients, the target filter coefficients including low-profile filter coefficients and high-profile filter coefficients; and automatically equalizing the swept frequency signal based on the peak filter coefficients and the target filter coefficients to obtain a target amplitude-frequency response. In summary, this embodiment achieves automatic equalization of the amplitude-frequency response by analyzing the amplitude-frequency response and using multiple filters for narrowband and broadband adjustments, thereby improving the listening experience.
[0086] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of the automatic equalization amplitude-frequency response method of this application. Step S20 specifically includes:
[0087] Step S201: Obtain the target sound pressure level in the low-mid frequency band based on the actual amplitude-frequency response and the preset low-mid frequency band range.
[0088] It should be noted that the preset low-mid frequency range is [20, 500] Hz. In this step, the system iterates through the amplitude values of each frequency point within this low-mid frequency range in the actual amplitude-frequency response, calculates the sum of squares of the amplitude value at each frequency point, then takes the average value and the square root to obtain the root mean square value. Finally, the system takes the logarithm to base 10 of this root mean square value and multiplies it by 20 to calculate the target sound pressure level in the low-mid frequency range.
[0089] Understandably, this step of determining the target sound pressure level in the low-to-mid frequency range is to enable targeted compensation and optimization of the amplitude-frequency response in subsequent steps, resulting in a flatter amplitude-frequency response and improved audio playback quality.
[0090] Step S202: Obtain the compensated amplitude-frequency response based on the sound pressure level at each frequency point corresponding to the actual amplitude-frequency response and the target sound pressure level in the low-mid frequency band.
[0091] It should be noted that in this step, the system creates a vector with the same number of points as the actual amplitude-frequency response, initially setting the sound pressure level of all frequencies to 0. Within the low-mid frequency range [20, 500] Hz, the sound pressure level of each frequency point in the vector is set to the previously calculated target sound pressure level for the low-mid frequency range. Then, the sound pressure level of the corresponding frequency point of the actual amplitude-frequency response is subtracted from this vector. For differences greater than 0, the difference is set to 0 (indicating no further gain is needed); for differences less than or equal to 0, the original difference remains unchanged, thus obtaining the compensated amplitude-frequency response.
[0092] Step S203: Based on the compensated amplitude-frequency response, perform peak detection and quality factor optimization to obtain the peak filter coefficients.
[0093] It's important to note that the compensated amplitude-frequency response (ARF) refers to an adjustment calculated to compensate for the difference between the actual and target ARFs. It reflects the frequency points where gain or attenuation is needed. In this step, peak detection is used to identify significant dips (i.e., local minima) in the compensated ARF. These dips reflect bulges in the actual ARF, typically caused by factors such as room reflections. Quality factor optimization adjusts the filter's quality factor to make the gain variation near the center frequency more adaptive to the actual situation, thus achieving better narrowband adjustment.
[0094] In one feasible implementation, step S203 specifically includes:
[0095] Step A10: Perform peak detection on the compensated amplitude-frequency response to obtain the local minimum value.
[0096] It's important to note that in this step, the system performs peak detection on the compensated amplitude-frequency response. Specifically, by traversing each frequency point of the compensated amplitude-frequency response, it searches for points where the sound pressure level is significantly lower than adjacent frequencies—i.e., local minima. The purpose of peak detection is to locate the peak regions in the amplitude-frequency response that require focused adjustment, namely the bulges in the amplitude-frequency response caused by room reflections. By finding these local minima, the adjustment parameters of the peak filter can be further determined, thereby achieving gain compensation for these regions.
[0097] Step A20: Based on the local minimum value and the preset first threshold, frequency point screening is performed to obtain the peak filter gain and the peak filter center frequency.
[0098] It should be noted that after obtaining the local minimum, frequency points are filtered according to a preset first threshold (-5dB in this example). Specifically, all local minimums are traversed, and local minimums with sound pressure levels less than or equal to -5dB and their corresponding frequency points are recorded. These frequency points will be used as the center frequency of the peak filter, and the corresponding sound pressure levels will be used as the initial gain of the peak filter.
[0099] Understandably, frequency selection helps determine which frequencies require peak filter gain compensation and the strength of that compensation. This facilitates precise adjustments for specific frequency band spikes caused by room reflections.
[0100] Step A30: Obtain a preset quality factor array, and obtain the peak filter quality factor by traversing the quality factor array according to the preset sampling frequency, the peak filter gain, and the peak filter center frequency.
[0101] It should be noted that the peak filter quality factor is a parameter that determines the bandwidth of the peak filter; the higher the quality factor, the narrower the filter's adjustment bandwidth. In this step, the system presets multiple sets of quality factors (e.g., 50 sets), with the number of quality factors in each set matching the number of peak filters. Then, the quality factors are randomly initialized within the range of [0.05, 20]. Each set of quality factors is iterated through, and based on the preset sampling frequency (48000Hz), the peak filter's gain, and center frequency, the cascaded amplitude-frequency response of the peak filters under each quality factor is calculated. The mean square error (MSE) is then calculated by comparing this MSE with the compensated amplitude-frequency response. The set of quality factors with the smallest MSE is selected as the final quality factor of the peak filter.
[0102] Understandably, optimizing the quality factor helps determine the bandwidth characteristics of the peak filter, enabling the filter to provide more precise gain adjustment near the center frequency while avoiding unnecessary interference to other frequency bands.
[0103] Step A40: Normalize the peak filter gain to obtain the target peak filter gain.
[0104] It should be noted that after obtaining the gain of the peak filter, it is normalized. Specifically, as shown in Equation 3:
[0105]
[0106] Where N is the number of peak filters, NormalizedGain(i) is the target peak filter gain after normalization, and Gain(i) is the peak filter gain.
[0107] Step A50: Obtain the peak filter coefficients based on the preset sampling frequency, the peak filter center frequency, the peak filter quality factor, and the target peak filter gain.
[0108] It should be noted that after obtaining the target peak filter gain, center frequency, and quality factor, the system calculates the peak filter coefficients based on these parameters. Specifically, as shown in Equation 4:
[0109]
[0110] Among them, b n and a n For the peak filter coefficients, A, ω, and α are obtained from Equation 5:
[0111]
[0112] Among them, f sample For the preset sampling frequency, f center Let G be the center frequency of the peak filter, G be the target peak filter gain, and Q be the peak filter quality factor.
[0113] In this embodiment, by automatically analyzing the actual amplitude-frequency response curve (such as the bulge frequency band), the key parameters (gain, center frequency, quality factor and coefficient) of the peak filter are intelligently generated, realizing the design of accurate compensation signal for narrowband problems. This solves the problems of traditional methods relying on manual analysis and low debugging efficiency, and improves the automation and accuracy of amplitude-frequency response equalization.
[0114] Based on the first and second embodiments of this application, in the third embodiment of this application, the content that is the same as or similar to that in embodiments one and two above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 , Figure 3 This is a flowchart illustrating the third embodiment of the automatic equalization amplitude-frequency response method of this application. Step S30 specifically includes:
[0115] Step S301: Obtain the peak filter cascade amplitude frequency response based on the peak filter coefficients.
[0116] It should be noted that in this step, the system calculates the overall amplitude-frequency response of the cascaded peak filters by multiplying the transfer function of each peak filter in the frequency domain. Specifically, the gain at each frequency point is calculated based on the peak filter coefficients (b0, b1, b2, a0, a1, a2), and then the gains of all peak filters are summed to obtain the curve of the cascaded peak filter amplitude-frequency response. Furthermore, it should be noted that the cascaded peak filter amplitude-frequency response refers to the overall amplitude-frequency response obtained by combining the amplitude-frequency responses of multiple peak filters through summation. It reflects the degree of gain or attenuation of the system for signals of different frequencies under the combined effect of all peak filters.
[0117] Step S302: Obtain the corrected amplitude frequency response based on the peak filter cascade amplitude frequency response and the actual amplitude frequency response.
[0118] It should be noted that in this step, the system will add the obtained peak filter cascaded amplitude-frequency response to the actual amplitude-frequency response point by point (in the frequency domain) to obtain the corrected amplitude-frequency response. Additionally, it should be noted that the corrected amplitude-frequency response refers to the amplitude-frequency response obtained after the actual amplitude-frequency response has been initially adjusted by the peak filter; it is closer to the ideal flat amplitude-frequency response.
[0119] Understandably, the purpose of this step is to preliminarily correct the bumps and dips in the actual amplitude-frequency response by adjusting the peak filter, making it flatter and providing a more accurate basis for subsequent broadband frequency band difference quantization.
[0120] Step S303: Perform broadband frequency band difference quantization based on the preset frequency band grouping and the modified amplitude-frequency response to obtain a compressed difference array.
[0121] It should be noted that the preset frequency band groups (in Hz) are [[20,63],[63,125],[125,250],[250,500],[500,1000],[1000,2000],[2000,4000],[4000,8000],[8000,16000]]. Wideband frequency band difference quantization refers to the steps of calculating the sound pressure level difference between adjacent frequency bands and processing it using a piecewise compression function to quantify the differences between different wideband frequency bands. Specifically, based on these preset frequency band groups, the average sound pressure level of the corrected amplitude-frequency response in each frequency band is calculated. Then, the sound pressure level difference between adjacent frequency bands is calculated to obtain a sound pressure level difference array. Finally, the sound pressure level difference array is processed by a preset piecewise compression function to obtain a compressed difference array. The compressed difference array refers to the result obtained after processing the sound pressure level difference array using the piecewise compression function.
[0122] Understandably, the purpose of this step is to quantify the differences in amplitude-frequency response across different broadband frequency bands, providing a basis for subsequent broadband adjustments. By using a piecewise compression function, significant frequency band differences can be preserved to some extent, while insignificant differences can be suppressed.
[0123] Step S304: Obtain the target filter coefficients based on the compression difference array and the preset filter quality factor coefficients.
[0124] It should be noted that in this step, the system iterates through the compressed difference array, recording the differences that do not meet the preset conditions and their corresponding frequency bands. Based on these differences and frequency band information, the gain and center frequency of the low-mounted or high-mounted filter used for broadband adjustment are determined. Then, combined with the preset filter quality factor (K), the coefficients of the low-mounted or high-mounted filter are calculated using the corresponding filter formula.
[0125] Understandably, the purpose of this step is to determine the parameters of the low-mounted or high-mounted filters used to further adjust the amplitude-frequency response based on the results of broadband frequency band difference quantization, in order to achieve more accurate amplitude-frequency response equalization.
[0126] In one feasible implementation, step S303 specifically includes:
[0127] Step B10: Calculate the average sound pressure level of each frequency band of the modified amplitude-frequency response according to the preset frequency band grouping to obtain the average sound pressure level array.
[0128] It should be noted that, firstly, the system divides the corrected amplitude-frequency response curve into multiple frequency bands according to preset frequency band groupings (i.e., [[20,63],[63,125],[125,250],[250,500],[500,1000],[1000,2000],[2000,4000],[4000,8000],[8000,16000]]). Then, it averages the sound pressure level (SPL) at all frequencies within each band to obtain the mean SPL for each band. Finally, it sorts the mean SPL values of all bands in ascending order of frequency, forming an array of mean SPL values.
[0129] Step B20: Calculate the sound pressure level difference between adjacent frequency bands of the corrected amplitude-frequency response based on the sound pressure level mean array to obtain the sound pressure level difference array.
[0130] It's important to note that in this step, the system iterates through the sound pressure level mean array, calculating the difference between the sound pressure level means of adjacent frequency bands, thus obtaining the sound pressure level difference value between each adjacent frequency band. Finally, the sound pressure level difference values of all adjacent frequency bands are sorted in ascending frequency order to form a sound pressure level difference array. This sound pressure level difference array reflects the energy variation of the corrected amplitude-frequency response across different frequency bands. By calculating the sound pressure level difference values, significant energy differences between frequency bands can be identified, allowing for targeted adjustments.
[0131] Step B30: Traverse the sound pressure level difference array according to the preset segmented compression function to obtain the compression difference array.
[0132] It should be noted that in this step, the system pre-defines a piecewise compression function. This function compresses the sound pressure level difference to different degrees based on its magnitude and sign. Specifically, it divides the sound pressure level difference into three intervals by setting two thresholds. When the absolute value of the difference is in the first interval, type I compression is performed to suppress the influence of smaller differences; when the absolute value is in the second interval, type II compression is performed to adjust the influence of moderate differences; and when the absolute value is in the third interval, type III compression is performed to reduce the influence of larger differences. Specifically, the piecewise compression function is shown in Formula 6:
[0133]
[0134] Where abs(x(n)) is the absolute value of the sound pressure level difference. Then, the sound pressure level difference array is traversed, and the piecewise compression function is applied to each difference to obtain the compressed difference, which is then arranged in ascending order of frequency to form a compressed difference array.
[0135] In one feasible implementation, step S304 specifically includes:
[0136] Step C10: Traverse the compression difference array according to the preset frequency band threshold to obtain the target filter gain and the target filter center frequency. The target filter gain includes the low-mounted filter gain and the high-mounted filter gain, and the target filter center frequency includes the low-mounted filter center frequency and the high-mounted filter center frequency.
[0137] It should be noted that the preset frequency band threshold is 0, used to filter out non-zero differences in the compressed difference array and their corresponding frequency bands. The compressed difference array is iterated, and for each non-zero difference, the corresponding filter type (low-mounted filter or high-mounted filter) is determined based on its frequency band. Specifically, if the frequency band corresponding to the difference is within a preset low-frequency range, it is determined to be a low-mounted filter; if it is within a high-frequency range, it is determined to be a high-mounted filter. Next, the filter gain is determined based on the magnitude and sign of the difference, and the filter's center frequency is determined based on the center frequency of the frequency band corresponding to the difference.
[0138] Step C20: Obtain the target filter quality factor based on the preset filter quality factor coefficients. The target filter quality factor includes the low-profile filter quality factor and the high-profile filter quality factor.
[0139] It should be noted that the preset filter quality factor coefficient is k, with a default value of 1, but it can be changed according to actual adjustment needs. When a steeper filter effect is required, k takes a value greater than 1; when a gentler filter effect is required, k takes a value less than 1. Specifically, the quality factor of the low-rise or high-rise filter is obtained according to Formula 7:
[0140] Q low / high =0.7*k (Formula 7)
[0141] Among them, Q low / high This represents the quality factor of the low-mounted or high-mounted filter, where k is the preset filter quality factor coefficient.
[0142] Step C30: Obtain the target filter coefficients based on the preset sampling frequency, the target filter gain, the target filter center frequency, and the target filter quality factor.
[0143] It should be noted that in this step, the system calculates the coefficients of the target filter using the filter design formula based on the preset sampling frequency (e.g., 48000Hz), target filter gain, target filter center frequency, and target filter quality factor. Specifically, for low-mounted and high-mounted filters, their corresponding gain, center frequency, and quality factor are used for calculation, respectively. Two low-mounted filters or two high-mounted filters can be combined to form a bell-shaped filter. The formula for the low-mounted filter is shown in Formula 8.
[0144]
[0145] The formula for the elevated filter is shown in Formula 9:
[0146]
[0147] Among them, b n and a n For the low-mounted or high-mounted filter coefficients, A, ω, and α are also obtained from Equation 5 above, but at this time f center G is the center frequency of the low-mounted or high-mounted filter, G is the gain of the low-mounted or high-mounted filter, and Q is the quality factor of the low-mounted or high-mounted filter.
[0148] In this embodiment, the actual amplitude-frequency response is corrected by cascading peak filters (narrowband adjustment), and the broadband frequency band difference of the corrected amplitude-frequency response is automatically quantized based on preset frequency band groups (generating a compressed difference array). This achieves automated identification and analysis of broadband imbalance characteristics in the amplitude-frequency response, solves the efficiency problem of traditional methods that rely on repeated manual adjustments, and improves the automation and efficiency of the equalization process.
[0149] This application also provides an automatic equalization amplitude-frequency response device, please refer to... Figure 4 The automatic equalization amplitude-frequency response device includes:
[0150] The signal acquisition module 10 is used to acquire a sweep frequency signal according to a preset sampling frequency, and to perform a fast Fourier transform on the sweep frequency signal to obtain the actual amplitude-frequency response.
[0151] Narrowband adjustment module 20 is used to perform narrowband compensation and optimization based on the actual amplitude-frequency response to obtain peak filter coefficients;
[0152] The broadband adjustment module 30 is used to perform broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response to obtain target filter coefficients, the target filter coefficients including low-mounted filter coefficients and high-mounted filter coefficients;
[0153] The automatic equalization module 40 is used to automatically equalize the swept frequency signal according to the peak filter coefficients and the target filter coefficients to obtain the target amplitude-frequency response.
[0154] The automatic equalization amplitude-frequency response device provided in this application, employing the automatic equalization amplitude-frequency response method in the above embodiments, can solve the technical problem of how to automatically improve the listening effect. Compared with the prior art, the beneficial effects of the automatic equalization amplitude-frequency response device provided in this application are the same as those of the automatic equalization amplitude-frequency response method provided in the above embodiments, and other technical features in the automatic equalization amplitude-frequency response device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0155] In one embodiment, the narrowband adjustment module 20 is further configured to obtain a target sound pressure level in the low-mid frequency band based on the actual amplitude-frequency response and a preset low-mid frequency band interval; obtain a compensated amplitude-frequency response based on the sound pressure level at each frequency point corresponding to the actual amplitude-frequency response and the target sound pressure level in the low-mid frequency band; and obtain peak filter coefficients by performing peak detection and quality factor optimization based on the compensated amplitude-frequency response.
[0156] In one embodiment, the narrowband adjustment module 20 is further configured to perform peak detection on the compensated amplitude-frequency response to obtain a local minimum value;
[0157] The peak filter gain and peak filter center frequency are obtained by frequency point filtering based on the local minimum value and a preset first threshold; a preset quality factor array is obtained, and the peak filter quality factor is obtained by traversing the quality factor array according to the preset sampling frequency, the peak filter gain, and the peak filter center frequency; the peak filter gain is normalized to obtain the target peak filter gain; the peak filter coefficients are obtained according to the preset sampling frequency, the peak filter center frequency, the peak filter quality factor, and the target peak filter gain.
[0158] In one embodiment, the broadband adjustment module 30 is further configured to: obtain the peak filter cascade amplitude frequency response based on the peak filter coefficients; obtain the corrected amplitude frequency response based on the peak filter cascade amplitude frequency response and the actual amplitude frequency response; perform broadband frequency band difference quantization based on preset frequency band grouping and the corrected amplitude frequency response to obtain a compressed difference array; and obtain the target filter coefficients based on the compressed difference array and preset filter quality factor coefficients.
[0159] In one embodiment, the broadband adjustment module 30 is further configured to calculate the average sound pressure level of each frequency band of the corrected amplitude-frequency response according to a preset frequency band group, to obtain an array of average sound pressure levels; calculate the sound pressure level difference between adjacent frequency bands of the corrected amplitude-frequency response according to the array of average sound pressure levels, to obtain an array of sound pressure level differences; and traverse the array of sound pressure level differences according to a preset segmented compression function to obtain an array of compression differences.
[0160] In one embodiment, the broadband adjustment module 30 is further configured to traverse the compression difference array according to a preset frequency band threshold to obtain the target filter gain and the target filter center frequency, wherein the target filter gain includes the low-level filter gain and the high-level filter gain, and the target filter center frequency includes the low-level filter center frequency and the high-level filter center frequency; obtain the target filter quality factor according to a preset filter quality factor coefficient, wherein the target filter quality factor includes the low-level filter quality factor and the high-level filter quality factor; and obtain the target filter coefficients according to a preset sampling frequency, the target filter gain, the target filter center frequency, and the target filter quality factor.
[0161] In one embodiment, the automatic equalization module 40 is further configured to perform filtering analysis on the swept frequency signal based on the peak filter coefficient, the low-profile filter coefficient, or the high-profile filter coefficient to obtain the current local minimum, the current compression difference array, and the current amplitude-frequency response; when the current local minimum is greater than or equal to a preset first threshold and the current compression difference array is all at a preset second threshold, the current amplitude-frequency response is used as the target amplitude-frequency response.
[0162] This application provides an automatic equalization amplitude-frequency response device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the automatic equalization amplitude-frequency response method in the above embodiment 1.
[0163] The following is for reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing the automatic equalization amplitude-frequency response device in the embodiments of this application. The automatic equalization amplitude-frequency response device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The automatic equalization amplitude-frequency response device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0164] like Figure 5As shown, the automatic equalization amplitude-frequency response device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in ROM (Read Only Memory) 1002 or a program loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the automatic equalization amplitude-frequency response device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, LCDs (Liquid Crystal Displays), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the automatic equalization amplitude-frequency response device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows an automatic equalization amplitude-frequency response device with various systems, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0165] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0166] The automatic equalization amplitude-frequency response device provided in this application, employing the automatic equalization amplitude-frequency response method in the above embodiments, can solve the technical problem of how to automatically improve the listening effect. Compared with the prior art, the beneficial effects of the automatic equalization amplitude-frequency response device provided in this application are the same as those of the automatic equalization amplitude-frequency response method provided in the above embodiments, and other technical features in this automatic equalization amplitude-frequency response device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.
[0167] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0168] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0169] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the automatic equalization amplitude-frequency response method in the above embodiments.
[0170] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory or Flash Memory), optical fibers, CD-ROM (CD-Read Only Memory), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0171] The aforementioned computer-readable storage medium may be included in the automatic equalization amplitude-frequency response device; or it may exist independently and not assembled into the automatic equalization amplitude-frequency response device.
[0172] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the automatic equalization amplitude-frequency response device, the automatic equalization amplitude-frequency response device: acquires a sweep frequency signal according to a preset sampling frequency, and performs a fast Fourier transform on the sweep frequency signal to obtain an actual amplitude-frequency response; performs narrowband compensation and optimization based on the actual amplitude-frequency response to obtain peak filter coefficients; performs broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response to obtain target filter coefficients, the target filter coefficients including low-level filter coefficients and high-level filter coefficients; and automatically equalizes the sweep frequency signal based on the peak filter coefficients and the target filter coefficients to obtain a target amplitude-frequency response.
[0173] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LAN (Local Area Network) or WAN (Wide Area Network)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0174] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0175] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0176] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described automatic equalization amplitude-frequency response method, thereby solving the technical problem of how to automatically improve the listening effect. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the automatic equalization amplitude-frequency response method provided in the above embodiments, and will not be repeated here.
[0177] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the automatic equalization amplitude-frequency response method as described above.
[0178] The computer program product provided in this application can solve the technical problem of how to automatically improve the listening effect. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the automatic equalization amplitude-frequency response method provided in the above embodiments, and will not be repeated here.
[0179] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. An automatic equalization amplitude-frequency response method, characterized in that, The method includes: The sweep frequency signal is obtained according to the preset sampling frequency, and the actual amplitude-frequency response is obtained by performing a fast Fourier transform on the sweep frequency signal. The peak filter coefficients are obtained by narrowband compensation and optimization based on the actual amplitude-frequency response. The target filter coefficients are obtained by broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response. The target filter coefficients include low-mounted filter coefficients and high-mounted filter coefficients. The swept frequency signal is automatically equalized based on the peak filter coefficients and the target filter coefficients to obtain the target amplitude-frequency response.
2. The method as described in claim 1, characterized in that, The step of obtaining the peak filter coefficients by performing narrowband compensation and optimization based on the actual amplitude-frequency response includes: The target sound pressure level in the low-mid frequency band is obtained based on the actual amplitude-frequency response and the preset low-mid frequency band range. The compensated amplitude-frequency response is obtained based on the sound pressure level at each frequency point corresponding to the actual amplitude-frequency response and the target sound pressure level in the low-mid frequency band. Peak filter coefficients are obtained by peak detection and quality factor optimization based on the compensated amplitude-frequency response.
3. The method as described in claim 2, characterized in that, The steps of obtaining peak filter coefficients by peak detection and quality factor optimization based on the compensated amplitude-frequency response include: Peak detection is performed on the compensated amplitude-frequency response to obtain a local minimum value; The peak filter gain and peak filter center frequency are obtained by frequency point filtering based on the local minimum value and the preset first threshold. Obtain a preset quality factor array, and obtain the peak filter quality factor by traversing the quality factor array according to the preset sampling frequency, the peak filter gain, and the peak filter center frequency; The target peak filter gain is obtained by normalizing the peak filter gain. The peak filter coefficients are obtained based on the preset sampling frequency, the peak filter center frequency, the peak filter quality factor, and the target peak filter gain.
4. The method as described in claim 1, characterized in that, The step of obtaining the target filter coefficients by broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response includes: The peak filter cascade amplitude frequency response is obtained based on the peak filter coefficients. The corrected amplitude frequency response is obtained based on the peak filter cascade amplitude frequency response and the actual amplitude frequency response; Based on the preset frequency band grouping and the corrected amplitude-frequency response, a compressed difference array is obtained by broadband frequency band difference quantization. The target filter coefficients are obtained based on the compression difference array and the preset filter quality factor coefficients.
5. The method as described in claim 4, characterized in that, The step of obtaining a compressed difference array by broadband frequency band difference quantization based on preset frequency band grouping and the corrected amplitude frequency response includes: The average sound pressure level of each frequency band of the corrected amplitude-frequency response is calculated according to the preset frequency band grouping to obtain an array of average sound pressure levels; The sound pressure level difference between adjacent frequency bands of the corrected amplitude-frequency response is calculated based on the sound pressure level mean array to obtain the sound pressure level difference array; The compression difference array is obtained by traversing the sound pressure level difference array according to the preset segmented compression function.
6. The method as described in claim 4, characterized in that, The step of obtaining the target filter coefficients based on the compression difference array and the preset filter quality factor coefficients includes: The target filter gain and target filter center frequency are obtained by traversing the compression difference array according to the preset frequency band threshold. The target filter gain includes the low-mounted filter gain and the high-mounted filter gain, and the target filter center frequency includes the low-mounted filter center frequency and the high-mounted filter center frequency. The target filter quality factor is obtained based on the preset filter quality factor coefficient, and the target filter quality factor includes the low-mounted filter quality factor and the high-mounted filter quality factor. The target filter coefficients are obtained based on the preset sampling frequency, the target filter gain, the target filter center frequency, and the target filter quality factor.
7. The method as described in claim 1, characterized in that, The step of automatically equalizing the swept frequency signal based on the peak filter coefficients and the target filter coefficients to obtain the target amplitude-frequency response includes: The swept frequency signal is filtered and analyzed based on the peak filter coefficients, the low-level filter coefficients, or the high-level filter coefficients to obtain the current local minimum, the current compression difference array, and the current amplitude-frequency response. When the current local minimum value is greater than or equal to a preset first threshold and the current compression difference array is all at a preset second threshold, the current amplitude-frequency response is taken as the target amplitude-frequency response.
8. An automatic equalization amplitude-frequency response device, characterized in that, The device includes: The signal acquisition module is used to acquire a sweep frequency signal according to a preset sampling frequency, and to perform a fast Fourier transform on the sweep frequency signal to obtain the actual amplitude-frequency response. The narrowband adjustment module is used to perform narrowband compensation and optimization based on the actual amplitude-frequency response to obtain the peak filter coefficients. A broadband adjustment module is used to perform broadband frequency band difference quantization based on the peak filter coefficients and the actual amplitude-frequency response to obtain target filter coefficients, wherein the target filter coefficients include low-mounted filter coefficients and high-mounted filter coefficients. An automatic equalization module is used to automatically equalize the swept frequency signal based on the peak filter coefficients and the target filter coefficients to obtain the target amplitude-frequency response.
9. An automatic equalization amplitude-frequency response device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the automatic equalization amplitude-frequency response method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the automatic equalization amplitude-frequency response method as described in any one of claims 1 to 7.