Frequency response correction method, device, equipment and storage medium

By acquiring the frequency response data of the sound system and performing Fourier transform to generate spectrum data, the equalizer parameters are automatically determined, which solves the time-consuming problem of equalizer parameter adjustment and realizes the automation and high efficiency of frequency response correction.

CN117979207BActive Publication Date: 2025-09-23GUANGZHOU KUGOU COMP TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311582368.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-09-23
Estimated Expiration
2043-11-23

AI Technical Summary

Technical Problem

In the prior art, equalizer parameter adjustment takes a long time, frequency response correction efficiency is low, and users need to manually debug, resulting in a time-consuming frequency response correction process.

Method used

By acquiring the first frequency response data and the second frequency response data, Fourier transform and fast Fourier transform are used to generate spectrum data, and the parameters of the equalizer are automatically determined so that the frequency response curve to be corrected is close to the reference frequency response curve.

Benefits of technology

It realizes the automation of frequency response correction, lowers the user threshold, improves the efficiency of frequency response correction, shortens the correction cycle, reduces labor costs, and is suitable for scenarios with low performance requirements for various devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117979207B_ABST
    Figure CN117979207B_ABST
Patent Text Reader

Abstract

The present application discloses a frequency response correction method, apparatus, device, and storage medium, belonging to the field of audio processing technology. The method includes: obtaining first frequency response data, the first frequency response data is used to characterize the frequency response curve to be corrected, and the frequency response curve is used to reflect the trend of loudness changing with frequency; performing time-frequency conversion on the first frequency response data to obtain first spectrum data, and the first spectrum data is used to reflect the properties of the frequency response curve to be corrected in the frequency direction; determining the parameters of an equalizer based on the first spectrum data and second spectrum data, the second spectrum data is obtained by performing time-frequency conversion on the second frequency response data, and the second frequency response data is used to characterize the reference frequency response curve used for frequency response correction, and the equalizer is used to control the frequency response curve to be corrected to be close to the reference frequency response curve based on the parameters. The embodiment of the present application realizes the automatic determination of the parameters of the equalizer, which helps to improve the efficiency of correcting the frequency response curve of the audio system, thereby improving the audio playback effect of the audio system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of audio processing technology, and in particular to a frequency response correction method, apparatus, device and storage medium. Background Art

[0002] An equalizer can change the frequency response curve of an audio system. Under the action of an equalizer, the audio playback effect of the audio system will change, thus achieving the purpose of tuning.

[0003] Differences in equalizer parameters can result in different audio playback effects in a sound system. To ensure that the equalizer can adjust the audio playback effect of a playback device to the user's desired audio playback effect, the equalizer parameters must be accurately determined. In related art, users manually adjust the equalizer parameters. By manually and repeatedly adjusting the equalizer parameters and listening to the changes in the audio playback effect of the playback device, it is determined whether the audio playback effect of the playback device meets expectations.

[0004] However, manually adjusting the parameters of the equalizer makes the frequency response correction process of the playback device time-consuming and the frequency response correction efficiency low. Summary of the Invention

[0005] This application provides a frequency response correction method, apparatus, device, and storage medium. The technical solution is as follows:

[0006] According to one aspect of an embodiment of the present application, a frequency response correction method is provided, the method comprising:

[0007] Acquiring first frequency response data, where the first frequency response data is used to represent a frequency response curve to be corrected, where the frequency response curve is used to reflect a trend of loudness changing with frequency;

[0008] Obtaining first spectrum data according to the first frequency response data, where the first spectrum data is used to reflect the properties of the frequency response curve to be corrected in the frequency direction;

[0009] Parameters of an equalizer are determined based on the first spectrum data and the second spectrum data, where the second spectrum data is determined based on second frequency response data, and the second frequency response data is used to represent a reference frequency response curve used for frequency response correction. The equalizer is used to control the frequency response curve to be corrected to approach the reference frequency response curve based on the parameters.

[0010] According to one aspect of an embodiment of the present application, a frequency response correction device is provided, the device comprising:

[0011] a data acquisition module, configured to acquire first frequency response data, wherein the first frequency response data is used to represent a frequency response curve to be corrected, wherein the frequency response curve is used to reflect a trend of loudness changing with frequency;

[0012] a spectrum determination module, configured to generate first spectrum data based on the first frequency response data, wherein the first spectrum data is used to reflect the properties of the frequency response curve to be corrected in the frequency direction;

[0013] a parameter determination module, configured to determine parameters of an equalizer based on the first spectrum data and second spectrum data, wherein the second spectrum data is determined based on second frequency response data, the second frequency response data being used to represent a reference frequency response curve used for frequency response correction, and the equalizer being configured to control the frequency response curve to be corrected to approach the reference frequency response curve based on the parameters.

[0014] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein the processor loads and executes the computer instructions from the memory to implement the above-mentioned frequency response correction method.

[0015] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores computer instructions. The computer instructions are loaded and executed by a processor from the storage medium to implement the above-mentioned frequency response correction method.

[0016] According to one aspect of an embodiment of the present application, a computer program product is provided, comprising computer instructions stored in a computer-readable storage medium. The computer instructions are loaded and executed by a processor from the computer-readable storage medium to implement the above-mentioned frequency response correction method.

[0017] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:

[0018] During the execution of this embodiment, only source and target frequency response data are required to automatically determine equalizer parameters. These equalizer parameters are then used to bring the frequency response of the audio playback device closer to the target frequency response data. This approach lowers the user barrier to entry for frequency response calibration and enables automatic frequency response calibration, helping to improve calibration efficiency and reduce labor costs.

[0019] Furthermore, during the frequency response correction process, the frequency response data is converted into spectrum data, and the calculations involved in determining the equalizer parameters based on the spectrum data are relatively small. This helps shorten the time required to determine the equalizer parameters and speed up frequency response correction. Furthermore, the reduced calculations make this frequency response correction method less demanding on device performance, helping to expand its application scenarios and enhance its universal applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1It is a schematic diagram of an implementation environment of a solution provided by an exemplary embodiment of the present application;

[0021] Figure 2 It is a schematic diagram of the inventive concept of this application;

[0022] Figure 3 is a flow chart of a frequency response correction method provided by an exemplary embodiment of the present application;

[0023] Figure 4 is a flow chart of a frequency response correction method provided by another exemplary embodiment of the present application;

[0024] Figure 5 is a schematic diagram of a frequency response correction method provided by an exemplary embodiment of the present application;

[0025] Figure 6 is a block diagram of a frequency response correction device provided by an exemplary embodiment of the present application;

[0026] Figure 7 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0028] First, the nouns involved in the embodiments of this application are introduced:

[0029] 1. Sound system: refers to a system that uses a microphone to convert the sound wave signal of the original sound field into an electrical signal, processes the electrical signal through some electronic equipment according to certain requirements, and finally uses a speaker or other playback device to convert the electrical signal into a sound wave signal for playback.

[0030] In an embodiment of the present application, the audio system includes at least an electronic device for converting electrical signals into sound wave signals and playing the sound wave signals. Optionally, the audio system includes a playback device and an equalizer, where the playback device includes a speaker. The equalizer is used to adjust the frequency response curve of the audio system to change the audio playback effect of the audio system and achieve the purpose of tuning.

[0031] 2. Equalizer: Used to compensate for deficiencies in playback devices or adjust the tone to suit user preferences. The equalizer adjusts the gain of certain frequency bands in the audio signal, making the sound in these bands louder or quieter, thereby adjusting the frequency response curve of the audio system and changing the audio playback effect of the playback device.

[0032] Depending on the location of their use, equalizers fall into at least two categories: amplifier-side equalizers and source-side equalizers. Source-side equalizers include hardware equalizers and software equalizers.

[0033] 3. FT (Fourier Transform): This method converts a signal in the time domain (i.e., time domain) into a signal in the frequency domain (i.e., frequency domain). Converting a time domain signal into a frequency domain signal makes it easier to handle difficult problems in the time domain in the frequency domain.

[0034] 4. Fast Fourier Transform (FFT): This is an efficient time-to-frequency conversion algorithm used to quickly compute the Fourier transform and its inverse transform. The FFT leverages certain mathematical properties of the Fourier transform, significantly improving its computational efficiency. Although the FFT and the Fourier transform are mathematically equivalent, its computational efficiency advantage has made it the primary tool for practical Fourier transform calculations.

[0035] Figure 1 FIG. 1 is a schematic diagram of an implementation environment of a solution provided by an exemplary embodiment of the present application. The implementation environment of the solution may include: a computer device 10 and an audio system 20 .

[0036] The computer device 10 can be an electronic device such as a personal computer (PC), tablet computer, mobile phone, wearable device, smart home appliance, vehicle-mounted terminal, aircraft, or the like. The computer device 10 has at least computing and storage functions. The computer device 10 is used to implement a frequency response correction function. For example, a target application is running on the computer device 10. The target application is used to perform frequency response correction on the audio system 20. The computer device 10 can also be a server, meaning that the frequency response correction process provided in the embodiments of the present application is performed remotely by the server.

[0037] Audio system 20 converts audio or video files into electrical signals and plays the corresponding sound. The audio system includes at least a playback device 22 and an equalizer 24. Equalizer 24 adjusts the audio playback quality of audio system 20, while playback device 22 plays the sound. Equalizer 24 can be implemented as either software or hardware.

[0038] There is a wired connection or a wireless connection between the computer device 10 and the sound system 20. Optionally, the computer device 10 exists independently of the sound system 20, or the computer device 10 is integrated into the sound system 20.

[0039] In one example, the computer device 10 and the audio system 20 are independent of each other. When frequency response correction is required, the computer device 10 obtains source frequency response data and target frequency response data of the audio system 20. Based on the source frequency response data (corresponding to the first frequency response parameter in the claims) and the target frequency response data (corresponding to the second frequency response parameter in the claims), the computer device 10 determines equalizer parameters and feeds these equalizer parameters back to the equalizer 24 in the audio system 20. After the frequency response correction is performed, the equalizer 24 uses the equalizer parameters to adjust the frequency response curve of the audio system 20, thereby changing the audio playback effect of the audio system 20.

[0040] During the frequency response correction process, the audio system 20 can be placed in a recording studio so that the source frequency response data of the audio system can be collected with less interference, thereby reducing the environmental error introduced during the frequency response correction process and helping to improve the correction effect of the frequency response correction.

[0041] During the frequency response calibration process, the sound system 20 can also be placed in an actual usage environment (e.g., outdoors, indoors, at a performance venue, etc.), so that the frequency response calibration process can determine the equalizer parameters suitable for the usage environment. For details on the process of this method, please refer to the following embodiments.

[0042] The application scenarios of the frequency response correction method provided in this application include but are not limited to at least one of the following:

[0043] (1) Before the audio system leaves the factory, the frequency response curve of the audio system is adjusted.

[0044] (2) During the use of the audio system, the frequency response curve of the speaker system is adjusted. For example, for an audio system that can be connected to the Internet of Things, the frequency response correction method can be used to regularly update the parameters of the equalizer in the audio system, so that the audio playback effect of the audio system can be regularly optimized. For example, the user determines the parameters of the equalizer in the audio system through the frequency response correction method according to the tuning needs.

[0045] It should be noted that the above application scenarios are merely examples of application scenarios of the frequency response correction method and are not intended to limit the application scenarios of the frequency response correction method.

[0046] Figure 2 It is a schematic diagram of the inventive concept provided by an exemplary embodiment of the present application.

[0047] like Figure 2 As shown in the figure, due to the limitations of the components and sound generation principles of the playback equipment in the audio system, different frequency points in the source frequency response curve used to represent the source frequency response data have different corresponding loudnesses. This may affect the playback effect of the audio system for audio files of certain styles. The audio playback effect of the audio system needs to be improved.

[0048] The present embodiment can automatically determine the parameters of an equalizer based on the source frequency response data and the target frequency response data. The equalizer is used to adjust the gain of the source frequency response curve according to the equalizer parameters, so that the corrected frequency response curve is close to the target frequency response curve, thereby achieving the purpose of automatic tuning.

[0049] Moreover, the frequency response calibration method provided in the embodiment of the present application has low technical requirements for users during the tuning process and realizes automatic calibration of the frequency response curve, which helps to shorten the frequency response calibration cycle.

[0050] Figure 3 This is a flow chart of a frequency response correction method provided by an exemplary embodiment of the present application. For example, the execution subject of this method may be Figure 1 The computer device 10 in the solution implementation environment shown. Figure 3 As shown, the method may include at least one of the following steps (310-330):

[0051] Step 310: Acquire first frequency response data. The first frequency response data is used to represent a frequency response curve to be corrected. The frequency response curve is used to reflect the trend of loudness changing with frequency.

[0052] In some embodiments, the first frequency response data is used to reflect the frequency response curve of the audio system when playing audio. A frequency response curve is also called a frequency response curve. A frequency response curve can be understood as a curve representing the energy distribution of sounds of different frequencies radiated by the audio system in space. In other words, the first frequency response data is used to characterize the audio system's ability to reproduce sounds of different frequencies.

[0053] Optionally, the frequency response curve is a two-dimensional curve, where the positive direction of the x-axis represents frequency from low to high, and the positive direction of the y-axis represents amplitude from low to high. For example, frequency corresponds to timbre in the human hearing sense; higher frequencies correspond to brighter timbre, and higher frequencies correspond to deeper timbre. Amplitude corresponds to loudness in the human hearing sense; the greater the loudness corresponding to a frequency in the frequency response curve, the louder the sound at that frequency. Different frequency response curves can provide users with different auditory experiences.

[0054] Optionally, the frequency response curve to be corrected is used to reflect the loudness of the sound system at different frequencies. Due to factors such as the components and structure of the playback device, the loudness corresponding to different frequencies in the frequency response curve to be corrected may vary. To improve the playback effect, the frequency response curve to be corrected needs to be tuned.

[0055] In some embodiments, the type of the first frequency response data includes but is not limited to at least one of the following: spectrum TXT (Text File), system scan test PCM (Pulse Code Modulation) file, etc. The first frequency response data is also called a first frequency response curve file.

[0056] In one example, the first frequency response data is a spectrum TXT file derived from an electroacoustic device. In another example, the first frequency response data is a PCM file captured by a radio device, and the computing device uses this PCM file as the first frequency response data. For example, during frequency response calibration, test audio is input into the audio system, and the radio device captures the test audio played by the audio system to generate a PCM file. This PCM file is then imported into the computing device, allowing the computing device to obtain the first frequency response data. For example, the test audio includes sine waves of varying frequencies.

[0057] Step 320: Determine first spectrum data based on the first frequency response data. The first spectrum data is used to reflect the properties of the frequency response curve to be corrected in the frequency direction.

[0058] Optionally, the first spectrum data includes frequency information and amplitude information of the first frequency response data. Exemplarily, the first spectrum data is a spectrogram corresponding to the first frequency response data. The spectrogram includes at least one amplitude spectrum, which is used to represent the mapping relationship between amplitude and frequency when the audio system plays audio. The spectrogram may also include a phase spectrum, which is not limited in this application.

[0059] In some embodiments, the manner in which the computer device determines the first spectrum data based on the first frequency response data is related to the type of the first frequency response data.

[0060] For example, if the first frequency response data is of spectrum TXT type, since spectrum TXT includes both frequency and amplitude information, the computer device reads the first spectrum data from the first frequency response data. This approach can expedite the acquisition of frequency response data and help shorten the time required for frequency response calibration.

[0061] For example, when the first frequency response data is a PCM file, the computer device performs spectrum extraction on the first frequency response data to obtain first spectrum data. Detailed content of this step is described below.

[0062] Step 330 : Determine parameters of an equalizer based on the first spectrum data and the second spectrum data. The second spectrum data is determined based on the second frequency response data. The second frequency response data is used to represent a reference frequency response curve used for frequency response correction. The equalizer is used to control the frequency response curve to be corrected to approach the reference frequency response curve based on the parameters.

[0063] In some embodiments, the second frequency response data is used to represent a target frequency response curve for frequency response correction. This target frequency response curve is also referred to as a reference frequency response curve. In other words, the second frequency response data provides a calibration standard for the frequency response correction process. The goal of frequency response correction is that, after frequency response correction, the frequency response curve of the audio system approaches the target frequency response curve, or that the frequency response curve of the audio system coincides with the target frequency response curve.

[0064] Optionally, the source of the second frequency response data includes, but is not limited to, at least one of the following: pre-set or user-specified. Exemplarily, the second frequency response data is pre-set. For example, the pre-set second frequency response data is used to represent a smooth reference frequency response curve. That is, in the reference frequency response curve, the loudness corresponding to different frequencies is the same, or the difference between the loudness corresponding to different frequencies is less than or equal to a first threshold. The first threshold may be a pre-set positive number.

[0065] Exemplarily, the second frequency response data is user-specified. That is, the user-specified second frequency response data may be set based on the user's listening habits. In this case, the loudness corresponding to different frequency bands in the reference frequency response curve may be the same or different.

[0066] In one example, a user can record test audio played by a reference sound system to obtain second frequency response data. Frequency response correction is then performed using this second frequency response data, so that the audio playback quality of the corrected sound system approximates that of the reference sound system. In this embodiment, the user can specify a reference frequency response curve so that the source frequency response curve can be corrected based on this reference frequency response curve. This ensures that the audio playback quality of the sound system, after correction, matches the user's listening habits. Users can also customize the audio playback quality of the sound system, enhancing the flexibility of the frequency response correction method.

[0067] In some embodiments, the type of the second frequency response data includes but is not limited to at least one of the following: spectrum TXT file, PCM file, etc. For details on the two types of frequency response data, please refer to the above introduction.

[0068] In some embodiments, equalizer parameters are used to indicate the equalizer's frequency response curve. Specifically, the equalizer generates the equalizer's frequency response curve based on the equalizer parameters. By superimposing the equalizer's frequency response curve with the frequency response curve to be corrected, the audio system's frequency response curve is brought closer to the reference frequency response curve, thereby achieving a tuning effect. Equalizer parameters can be understood as the parameters used by the equalizer to apply gain to the source frequency response curve. Gain refers to the change in the loudness of at least one frequency band in the source frequency response curve, such as increasing the loudness of frequency band 1 and decreasing the loudness of frequency band 2.

[0069] Optionally, the parameters of the equalizer include at least one of the following: a center frequency, a gain, and a quality factor; wherein the center frequency is also referred to as a center frequency point, and the quality factor is also referred to as a Q value. For a detailed description of the parameters of the equalizer, please refer to the following embodiments.

[0070] Exemplarily, the equalizer is configured to increase the loudness of at least one frequency band in the source frequency response curve. Within the at least one frequency band, the equalizer parameters corresponding to different frequency bands may be the same or different. The at least one frequency band is a frequency band having a significant difference between the first frequency response curve and the second frequency response curve.

[0071] Optionally, in the process of determining the equalizer parameters, it is necessary to separately determine the equalizer parameters corresponding to the at least one frequency band. This ensures that, after frequency response correction, the frequency response curve of the audio system in the at least one frequency band is close to a reference frequency response curve. For details of this process, please refer to the embodiments below.

[0072] In summary, the present embodiment only requires obtaining source and target frequency response data to automatically determine equalizer parameters. These equalizer parameters are then used to bring the frequency response of the audio system closer to the target frequency response. This approach lowers the user's threshold for tuning and enables automatic correction of the frequency response curve, helping to improve the efficiency of frequency response correction and reduce labor costs.

[0073] Furthermore, during the frequency response correction process, converting the frequency response data into spectrum data and determining the equalizer parameters based on the spectrum data requires less computation. This helps shorten the time required to determine the equalizer parameters, speeds up frequency response correction, and shortens the frequency response curve correction cycle. Furthermore, the reduced computational effort reduces the requirements for device performance, helping to expand the frequency response correction method's application scenarios and enhance its universal applicability.

[0074] The following describes a method for determining first spectrum data through several embodiments. The method is executed by a computer device.

[0075] In some embodiments, step 320, determining first spectrum data based on the first frequency response data, where the first spectrum data is used to reflect the properties of the frequency response curve to be corrected in the frequency direction, includes the following sub-steps: sub-step 322, performing a Fourier transform on the first frequency response data to determine initial spectrum data; sub-step 324, smoothing the initial spectrum data to determine smoothed spectrum data; and sub-step 326, interpolating the smoothed spectrum data based on the second spectrum data to determine first spectrum data.

[0076] In some embodiments, for a first frequency response data that is a PCM file type, the computer device performs spectrum data extraction on the first frequency response data to obtain first spectrum data. Exemplarily, the computer device performs a fast Fourier transform on the first frequency response data to obtain initial spectrum data. For example, the computer device uses kissfft to extract the spectrum data from the first frequency response data to obtain the initial spectrum data.

[0077] Optionally, the processing of the spectrum data mainly involves smoothing of the spectrum data, for example, Octive 1 / 3, Octive 1 / 6, etc. The smoothing is used to generate k*c frequency points based on c frequency points included in the initial spectrum data, where k is a positive integer.

[0078] Optionally, interpolation processing of the spectrum data is performed to ensure that the frequency values ​​and number of points of the frequency response curve to be corrected are consistent with those of the target frequency response curve. The interpolation processing is used to add a new frequency point between two adjacent frequency points included in the flattened spectrum data, and determine the amplitude value of the new frequency point based on the amplitude values ​​corresponding to the two adjacent frequency points.

[0079] Exemplarily, the computer device determines the total number of frequency points in the second spectrum data, and determines the number of frequency points to be interpolated based on the total number of frequency points in the second spectrum data; determines at least one interpolation frequency point and the amplitude corresponding to each interpolation frequency point based on the number of frequency points to be interpolated and the smooth spectrum data; adds at least one interpolation frequency point and the amplitude corresponding to each interpolation frequency point to the smooth spectrum data to obtain the first spectrum data.

[0080] For example, the computer device determines the number of frequency points to be interpolated based on the total number of frequency points in the second spectrum data, including: determining the total number of frequency points in the flat spectrum data, and subtracting the total number of frequency points in the flat spectrum data from the total number of frequency points in the second spectrum data to obtain the number of frequency points to be interpolated.

[0081] For example, the computer device determines at least one interpolation frequency point and the amplitude corresponding to each interpolation frequency point based on the number of frequency points to be interpolated and the smoothed spectrum data, including: the computer device selects a number of frequency point pairs to be interpolated from the frequency points included in the smoothed spectrum data, and the computer device determines the amplitude of the frequency point to be processed based on the amplitudes of the two frequency points included in the frequency point pair; wherein the frequency point pair includes two adjacent frequency points, and the frequency point to be processed is located in the frequency interval between the two frequency points in the frequency point pair.

[0082] For another example, a computer device determines at least one interpolation frequency point and the amplitude corresponding to each interpolation frequency point based on the number of frequency points to be interpolated and the smoothed spectrum data, including: determining the number of frequency points to be interpolated and the to-be-processed frequency points based on the smoothed spectrum data and the second spectrum data, where the to-be-processed frequency points refer to the frequency points included in the second spectrum data and not included in the smoothed spectrum data; for each of the at least one to-be-processed frequency points, determining the amplitude of the to-be-processed frequency point based on finding two frequency points closest to the to-be-processed frequency point from the smoothed spectrum data and according to the amplitudes of the two frequency points.

[0083] In this way, the total number of frequency points of the first spectrum data and the second spectrum data can be aligned, which helps to improve the accuracy of the equalizer parameters determined subsequently.

[0084] In some embodiments, the number of points in the spectrum data refers to the number of sampling points within a period of 0-2π during the fast Fourier transform process. The number of points in the spectrum data can be understood as the number of sampling points in the spectrum conversion process, that is, the total number of frequency points in the spectrum data obtained after the Fourier transform. For example, if the number of points in the spectrum data is 64, it means that the spectrum data includes 64 spectrums, that is, the spectrum data includes 64 frequency points and the amplitudes corresponding to each of the 64 frequency points.

[0085] The following describes a method for determining parameters of an equalizer through several embodiments. The method is performed by a computer device.

[0086] In some embodiments, the first spectrum data includes n frequency points and a first amplitude value of each frequency point, and the second spectrum data includes n frequency points and a second amplitude value of each frequency point, where n is a positive integer.

[0087] Optionally, the first spectrum data includes m frequency points and first amplitude values ​​of the m frequency points, and the second spectrum data includes p frequency points and second amplitude values ​​of each p frequency point, where m and p are positive integers greater than or equal to n.

[0088] A frequency point refers to an absolute frequency value. The total number of frequency points included in the first spectrum data and the second spectrum data may be related to the number of sampling points in the spectrum conversion process. This application does not limit the total number of frequency points included in the first spectrum data and the second spectrum data.

[0089] Exemplarily, the m frequency points and the p frequency points include at least n identical frequency points, where n refers to the smaller value of m and p.

[0090] In one example, in order to improve the utilization efficiency of each frequency point included in the spectrum data and improve the accuracy of the frequency response correction process, n=m=p, that is, the first spectrum data and the second spectrum data respectively include the same number of frequency points, and all of these frequency points participate in the process of determining the parameters of the equalizer.

[0091] In another example, during the process of determining the parameters of the equalizer, the computer device selects n common frequency points based on the first spectrum data and the second spectrum data, and determines the parameters of the equalizer based on the n frequency points. For example, the computer device determines the n frequency points commonly included in the first spectrum data and the second spectrum data based on the frequency point interval. For example, for any two frequency points among the n frequency points, the frequency span between the two frequency points is greater than or equal to a second threshold. The second threshold is used to represent the minimum frequency span between the two frequency points. Optionally, the second threshold is pre-set.

[0092] By controlling the frequency span between n frequency points, the impact of gaining a certain frequency point on other frequency bands can be reduced. This prevents the gain of a certain frequency point from causing large fluctuations in the loudness of other frequency bands, requiring adjustments to the gains of other frequency bands. This helps improve the efficiency of frequency response correction and helps to increase the degree to which the corrected frequency response curve approaches the reference frequency response curve.

[0093] In some embodiments, step 330, determining the parameters of the equalizer based on the first spectrum data and the second spectrum data, may include the following sub-steps.

[0094] Sub-step 332 : For each of the n frequency points, calculate the difference between the first amplitude value of the frequency point and the second amplitude value of the frequency point to obtain the amplitude difference of the frequency point.

[0095] In some embodiments, the first spectrum data includes at least one spectrum, each spectrum corresponding to a frequency amplitude, where the frequency amplitude is a first amplitude difference between frequency points. Exemplarily, the amplitude difference between frequency points is equal to the second amplitude value minus the first amplitude value. The amplitude difference between frequency points is used to represent the difference in amplitude between the first frequency response curve and the second frequency response curve at that frequency point, and the amplitude difference is a rational number. The computer device can calculate the amplitude differences for n frequency points sequentially or simultaneously for multiple frequency points.

[0096] In sub-step 334, a target frequency point is determined from the n frequency points according to the amplitude difference of the n frequency points. The target frequency point refers to a frequency point whose amplitude difference is greater than or equal to the calibration error.

[0097] Optionally, the absolute value of the amplitude difference of the target frequency point is greater than or equal to the amplitude difference of at least one frequency point other than the target frequency point among the n frequency points. For example, the absolute value of the amplitude difference of the target frequency point is the largest absolute value among the amplitude differences of the n frequency bands. For example, if n=4, and the amplitude differences of the four frequency points are: -10, 15, 10, and -20, respectively, the computer device will use the frequency point with an amplitude difference of -20 as the target frequency point.

[0098] Frequency amplitude differences can be positive or negative. Therefore, a target frequency amplitude difference greater than or equal to the calibration error means that the absolute value of the target frequency amplitude difference is greater than or equal to the calibration error. For example, if a frequency amplitude difference is -5 and the calibration error is 3, the frequency amplitude difference is greater than or equal to the calibration error, and the frequency can be used as the target frequency.

[0099] Optionally, the computer device determines the target frequency point from the n frequency points based on the quantitative relationship between the amplitude difference and the correction error. Exemplarily, the computer device selects the frequency point with the largest absolute value of the amplitude difference from the n frequency points as the target frequency point.

[0100] The calibration error can be preset, for example, the calibration error is equal to a decibel (dB), where a is a positive number. For example, the calibration error is any value between 1 and 3 dB. Exemplarily, the calibration error affects the degree of closeness between the calibrated frequency response curve and the reference frequency response curve. The smaller the calibration error, the closer the calibrated frequency response curve is to the reference frequency response curve; the larger the calibration error, the greater the difference between the calibrated frequency response curve and the reference frequency response curve.

[0101] For example, the calibration error can also be set by the user based on actual needs. For example, when frequency response calibration needs to be completed quickly, the user can set a larger calibration error, such as setting the calibration error to 3dB. For example, when accurate frequency response calibration is required, the user can set a smaller calibration error, such as setting the calibration error to 1dB. The calibration error is set based on actual needs and is not limited in this application.

[0102] In some embodiments, a computer device determines a target frequency point from among the n frequency points based on the amplitude differences of the n frequency points, including: selecting the amplitude difference with the largest absolute value from among the n frequency points; if the absolute value of the amplitude difference is greater than or equal to a calibration error, determining the frequency point with the amplitude difference from among the n frequency points as the target frequency point. If the absolute value of the amplitude difference is less than the calibration error, it indicates that the absolute values ​​of the amplitude differences of the n frequency points are all less than the calibration error, indicating that the frequency response curve of the audio system is relatively close to the reference frequency response curve, and further calibration of the frequency response curve is unnecessary. In other words, if no target frequency point exists among the n frequency points, the frequency response calibration process ends. The computer device determines the equalizer parameters corresponding to each target frequency point determined during the frequency response calibration process as the equalizer parameters.

[0103] Sub-step 336, determining the parameters of the equalizer according to the target frequency.

[0104] Optionally, if there is a target frequency among the n frequency points, the computer device determines equalizer parameters based on the target frequency point. The equalizer parameters determined based on the target frequency point are used to adjust the loudness of the target frequency point in the frequency band corresponding to the frequency response curve to be corrected. For example, the computer device determines the frequency point with the largest absolute value of the amplitude difference among the n frequency points, and the absolute value of the amplitude difference is greater than or equal to the correction error, as the target frequency point; the computer device then determines the equalizer parameters based on the target frequency point.

[0105] Optionally, when multiple target frequency points are determined from n frequency points, the computer device determines the parameters of the equalizer corresponding to each of the f target frequency points at one time, where f is a positive integer less than the total number of target frequency points. Exemplarily, the computer device determines f target frequency points from the multiple target frequency points based on a third threshold. In this case, the value of f is related to the third threshold, and the value of f is related to the multiple target frequency points. For example, the frequency span between any two of the f target frequency points is greater than or equal to the third threshold. Subsequently, the computer device determines the parameters of the equalizer based on the f target frequency points. In this case, the parameters of the equalizer include the parameters corresponding to each of the f target frequency points.

[0106] For target frequencies that are not selected from the multiple target frequencies, the computer device needs to first generate updated first frequency response data based on the equalizer parameters determined this time, and then determine whether these unselected target frequencies can still be used as target frequencies based on the updated first frequency response data. For details of this process, please refer to the embodiments below.

[0107] Since the equalizer's gain applied to a target frequency affects the frequency band containing the target frequency, selecting a target frequency with a larger frequency span can, on the one hand, help prevent the determined equalizer parameters from repeatedly applying gain to the frequency band containing a target frequency, resulting in the frequency response curve for that target frequency band not being close to the reference curve after frequency response correction. This method helps improve the accuracy of the frequency response correction process. On the other hand, for two target frequencies with a smaller frequency span, determining the equalizer parameters based on one of the two target frequencies first allows the determined equalizer parameters to also affect the frequency response curve of the other target frequency, potentially bringing the frequency response curve for the frequency band containing the other target frequency closer to the reference curve. This reduces the number of equalizer parameter determinations and helps improve the efficiency of frequency response correction.

[0108] Optionally, when multiple target frequencies are determined from the n frequency points, the computer device selects a target frequency from the multiple target frequencies and determines equalizer parameters based on the target frequency. The computer device uses the determined equalizer parameters to adjust the frequency response curve to be corrected, thereby obtaining a corrected frequency response curve. The computer device then re-executes step 320 based on the updated first frequency response data corresponding to the corrected frequency response curve until sub-step 324 fails to determine the target frequency. For details on this step, please refer to the embodiments below.

[0109] Through the above method, the equalizer parameters are determined based on the frequency points where the amplitude difference is greater than or equal to the correction error, so that the equalizer can correct the frequency response curve of the frequency band corresponding to the frequency point, so that the corrected frequency response curve of the frequency band approximates the corresponding curve portion of the reference frequency response curve for the frequency band, thereby achieving automatic frequency response correction. This embodiment does not involve complex calculations, and the determination facilitates efficient frequency response correction.

[0110] The following describes the process of determining the parameters of the equalizer according to the target frequency through several embodiments.

[0111] In some embodiments, the parameters of the equalizer include: center frequency, gain, and quality factor. The center frequency refers to the center point of the frequency to be corrected, the gain refers to the amplitude change at the center frequency after frequency response correction, and the quality factor is used to characterize the bandwidth of the influence of the gain on the frequencies surrounding the center frequency.

[0112] Sub-step 336 determines the parameters of the equalizer based on the target frequency, including: determining the center frequency based on the target frequency; determining the gain based on the amplitude difference of the target frequency; and determining the quality factor based on the center frequency and the bandwidth of the frequency response curve. The bandwidth of the frequency response curve is used to represent the frequency span at which the amplitude value of the center frequency is attenuated to half in the frequency response curve to be corrected.

[0113] Optionally, the center frequency is also referred to as a center frequency point. Exemplarily, the computer device determines the target frequency point as the center frequency.

[0114] Optionally, the gain is used to adjust the amplitude of the center frequency, where the adjusted amplitude of the center frequency is equal to the adjusted amplitude of the center frequency plus the gain. The gain is positively correlated with the amplitude difference of the target frequency. That is, the greater the amplitude difference of the target frequency, the greater the gain; and the smaller the amplitude difference of the target frequency, the smaller the gain. Exemplarily, the computer device uses the amplitude difference of the target frequency as the gain.

[0115] In some embodiments, the bandwidth of a frequency response curve refers to a frequency band that includes the center frequency of the frequency response curve to be corrected. The bandwidth of the frequency response curve corresponds to the passband frequency band of the center frequency in the frequency response curve to be corrected. The passband frequency band of the center frequency refers to the frequency span between a lower cutoff frequency and an upper cutoff frequency; the cutoff frequency refers to the frequency at which the loudness of a signal at the center frequency in the frequency response curve to be corrected is attenuated by half.

[0116] In some embodiments, the quality factor is positively correlated with the center frequency and negatively correlated with the bandwidth of the frequency response curve. Alternatively, the quality factor is equal to the ratio of the center frequency to the bandwidth of the frequency response curve. For example, a larger value of the quality factor indicates a smaller effect of the gain on the frequency band surrounding the center frequency; a smaller value of the quality factor indicates a greater effect of the gain on the frequency band surrounding the center frequency.

[0117] In the embodiment of the present application, the parameters of the equalizer for the passband frequency band to which the target frequency belongs can be quickly determined in a relatively simple manner, so that the equalizer can correct the frequency response curve of the audio system according to these parameters, which helps to reduce the difference between the corrected frequency response curve and the frequency response curve of the portion corresponding to the passband frequency band in the reference frequency response curve.

[0118] The following describes a method for determining the bandwidth of a frequency response curve through several embodiments. The method is executed by a computer device.

[0119] In some embodiments, the frequency response correction method further includes: determining a first frequency and a second frequency corresponding to the center frequency, where the first frequency refers to a frequency point corresponding to half of the amplitude value of the center frequency in a frequency-decreasing direction, and the second frequency refers to a frequency point corresponding to half of the amplitude value of the center frequency in a frequency-increasing direction; calculating a first frequency bandwidth between the center frequency and the first frequency, and calculating a second frequency bandwidth between the second frequency and the center frequency; and determining a bandwidth of the frequency response curve based on a target frequency bandwidth, where the target frequency bandwidth is the smaller value of the first frequency bandwidth and the second frequency bandwidth.

[0120] Optionally, the first frequency refers to a lower cutoff frequency, the second frequency refers to an upper cutoff frequency, the first frequency is less than a center frequency, and the second frequency is greater than the center frequency.

[0121] In some embodiments, the computer device determines the bandwidth of the frequency response curve based on the first frequency and / or the second frequency. Optionally, the computer device determines the difference between the second frequency and the first frequency as the bandwidth of the frequency response curve. In this case, the bandwidth of the frequency response curve w=f h -f l , where f l Indicates the first frequency, f h Indicates the second frequency.

[0122] Because the frequency response curve to be corrected may be asymmetrical on both sides of the center frequency, the computer device determines the bandwidth of the frequency response curve based on the frequency bandwidth to improve the accuracy of the bandwidth determined. For example, the computer device uses the difference between the center frequency and the first frequency as the first frequency bandwidth, and the difference between the second frequency and the center frequency as the second frequency bandwidth. The computer device determines the bandwidth of the frequency response curve based on the first frequency bandwidth and the second frequency bandwidth.

[0123] Optionally, the computer device selects a target frequency bandwidth from the first frequency bandwidth and the second frequency bandwidth, and calculates the bandwidth of the frequency response curve based on the target frequency. Exemplarily, the computer device determines the smaller of the first frequency bandwidth and the second frequency bandwidth as the target frequency bandwidth, and the computer device determines twice the target frequency bandwidth as the bandwidth of the frequency response curve.

[0124] In this case, the bandwidth of the frequency response curve is calculated as follows: w = 2 × min (f h -f c , f c -f l ); where w represents the bandwidth of the frequency response curve, min(f h -f c , f c -f l ) indicates that from f h -f c , f c -f l Determine the smaller value, f l Indicates the first frequency, f h represents the second frequency, f c Indicates the center frequency.

[0125] Selecting the smaller of the cutoff frequency and the center frequency as the target bandwidth helps ensure that the bandwidth of the determined frequency response curve corresponds to the frequency band width, thereby reducing the influence of other frequency bands other than the center frequency passband in the frequency response curve whose equalizer parameters are to be corrected. This method helps reduce repeated corrections of certain passband frequency bands and improves the efficiency of frequency response correction.

[0126] The following example describes the process of determining the parameters of the equalizer corresponding to the target frequency point. The execution subject of this embodiment is a computer device, and this embodiment mainly includes the following steps:

[0127] Step A10: Obtain first frequency response data. Optionally, the computer device obtains, via a sound receiving device, the first frequency response data recorded by the sound system during playback of the test audio. Exemplarily, the sound receiving device transmits the first frequency response data to the computer device via a wired or wireless network. The first frequency response data may be in the form of a PCM file.

[0128] Optionally, after frequency response calibration begins, the computer device may also need to obtain second frequency response data. The second frequency response data may be user-defined or pre-set. For example, the second frequency response data may be used to represent a smooth frequency response curve. The type of the second frequency response data may be the same as or different from the type of the first frequency response data.

[0129] For example, if the second frequency response data is a PCM file, the computer device needs to perform spectrum extraction processing on the second frequency response data to obtain second spectrum data. The processing method of this step is similar to the first spectrum data acquisition method and will not be repeated here.

[0130] Exemplarily, when the second spectrum data is preset, the second spectrum data may be stored in the computer device to reduce unnecessary calculation amount.

[0131] Step A20: Perform Fourier transform on the first frequency response data to obtain initial spectrum data.

[0132] Optionally, the computer device performs a fast Fourier transform on the first frequency response data based on an open source program called kissfft to obtain initial spectrum data. The initial spectrum data includes at least one frequency point and amplitude values ​​corresponding to each frequency point.

[0133] Step A30: Smoothing the initial spectrum data to obtain smooth spectrum data.

[0134] Step A40: performing interpolation processing on the flat spectrum data based on the second spectrum data to obtain first spectrum data.

[0135] It should be noted that steps A30 and A40 are optional. For example, after executing step A20, the computer device may directly use the initial spectrum data as the first spectrum data. For another example, if the initial spectrum data and the second spectrum data have the same number of points, the computer device may not execute step A40. In other words, the flat spectrum data determined in step A30 may be used as the first spectrum data.

[0136] For another example, the computer device may not execute step A30. That is, after executing step A20, the computer device may directly execute step A40 to interpolate the initial spectrum data based on the second spectrum data to obtain the first spectrum data.

[0137] Optionally, the execution order of step A30 and step A40 can be swapped, and this application does not limit the execution order of step A30 and step A40.

[0138] Step A50: For each of the n frequency points, calculate the difference between the first amplitude value and the second amplitude value of the frequency point to obtain the amplitude difference of the frequency point; and determine the target frequency point from the n frequency points based on the amplitude differences of the n frequency points.

[0139] Optionally, the n frequency points refer to all frequency points included in the first spectrum data, or the computer device selects n frequency points from the m frequency points included in the first spectrum data.

[0140] Exemplarily, the amplitude difference of the frequency points is equal to the first amplitude value minus the second amplitude value.

[0141] Step A60: Determine the center frequency based on the target frequency point; determine the gain based on the amplitude difference of the target frequency point. Exemplarily, the computer device determines the target frequency point as the center frequency and the amplitude difference of the target frequency point as the gain.

[0142] Step A70, determining a first frequency and a second frequency corresponding to the center frequency; calculating a first frequency bandwidth between the center frequency and the first frequency, and calculating a second frequency bandwidth between the second frequency and the center frequency; and determining the bandwidth of the frequency response curve based on the target frequency bandwidth.

[0143] Optionally, the bandwidth calculation formula of the frequency response curve is: w = 2 × min (f h -f c , f c -f l ). For explanations of the various parameters in this formula, please refer to the above embodiment and will not be repeated here.

[0144] Step A80: Determine the quality factor according to the center frequency and the bandwidth of the frequency response curve.

[0145] Optionally, the quality factor is calculated as: q = f c ÷w; where q represents the quality factor, f c represents the center frequency, and w represents the bandwidth of the frequency response curve.

[0146] The embodiment of the present application can automatically determine the parameters of the equalizer. Even users who do not know how to tune can quickly correct the frequency response curve of the audio system through the embodiment of the present application, greatly reducing labor costs and debugging cycles, and helping to improve production efficiency.

[0147] Figure 4 FIG is a schematic diagram of a frequency response correction method provided by another embodiment of the present application. For example, the execution subject of the method may be Figure 1 The computer device 10 in the solution implementation environment shown. Figure 4 As shown, the method may include at least one of the following steps (310-370):

[0148] Step 310: Acquire first frequency response data, where the first frequency response data is used to represent the frequency response curve to be calibrated.

[0149] Step 320: Perform time-frequency conversion on the first frequency response data to obtain first spectrum data.

[0150] Step 330: Determine parameters of an equalizer according to the first spectrum data and the second spectrum data.

[0151] The details of steps 310, 320, and 330 are described in the above embodiments and are not detailed here. If there are significant differences between the source frequency response curve and the reference frequency response curve, it is necessary to determine the equalizer parameters corresponding to multiple frequency bands so that the corrected frequency response curve can approximate the reference frequency response curve in each frequency band. In one possible embodiment, this objective is achieved by looping through at least steps 320 and 330.

[0152] The execution and stop conditions of the loop process are described below through several embodiments.

[0153] Step 340: Generate third frequency response data according to the parameters of the equalizer. The third frequency response data is used to reflect the frequency response curve of the equalizer.

[0154] In some embodiments, the third frequency response data is simulated and generated by a computer device based on equalizer parameters. Simulating and generating the equalizer's frequency response curve on a computer device helps improve the efficiency of frequency response correction, compared to directly applying the equalizer parameters to the equalizer in the audio system and re-recording the updated first audio data.

[0155] Optionally, the frequency response curve of the equalizer is used to adjust the frequency response curve to be corrected. The third frequency response data refers to data used to characterize the frequency response curve of the equalizer. As can be seen from the above content, the type of the third frequency response data includes but is not limited to at least one of the following: a spectrum TXT file, a PCM file, etc.

[0156] For the process of generating the third frequency response data, please refer to the following example.

[0157] Step 350: Superimpose the third frequency response data and the first frequency response data to generate updated first frequency response data.

[0158] Since the third frequency response data is used to characterize the frequency response curve of the equalizer and the first frequency response data is used to characterize the frequency response curve to be corrected, step 350 is used to add the frequency response curve to be corrected and the frequency response curve of the equalizer to obtain an updated frequency response curve to be corrected.

[0159] Exemplarily, the computer device superimposes the third frequency response data with the first frequency response data to generate updated first frequency response data, including: for any frequency band, the computer device obtains a first sub-frequency response curve for that frequency band from the first frequency response data, obtains a second sub-frequency response curve for that frequency band from the third frequency response data, and superimposes the first and second sub-frequency response curves in the loudness direction to obtain an updated sub-frequency response curve for that frequency band. An updated frequency response curve to be corrected is obtained by concatenating the sub-frequency response curves along the frequency direction, i.e., obtaining the updated first frequency response data.

[0160] That is, in this step, the computer device superimposes the frequency response curve of the equalizer and the frequency response curve to be corrected to obtain an updated frequency response curve to be corrected.

[0161] Step 360: Determine updated first spectrum data based on the updated first frequency response data.

[0162] This step is similar to step 320 . Please refer to the above embodiment for details, and no further details will be given here.

[0163] Step 370: When the amplitude difference between the updated first spectrum data and the second spectrum data meets the correction condition, the updated first spectrum data is used as the first spectrum data, and the step of determining the parameters of the equalizer based on the first spectrum data and the second spectrum data is performed again.

[0164] The correction condition is used to determine whether to continue the frequency response correction process. Optionally, the correction condition is related to the difference between the updated first spectrum data and the second spectrum data.

[0165] Exemplarily, the updated first spectrum data and second spectrum data each include n frequency points and amplitude values ​​corresponding to the n frequency points. The correction condition is that there is at least one frequency point to be corrected among the n frequency points, and the absolute value of the difference between the first amplitude value and the second amplitude value corresponding to the frequency point to be corrected is greater than or equal to the correction error. For a description of the correction error, the first amplitude value, and the second amplitude value, please refer to the above embodiment and are not further elaborated here.

[0166] After determining the updated first spectrum data, the computer device determines the parameters of the equalizer based on the updated first spectrum data and the second spectrum data. Optionally, the parameters of the equalizer determined in steps 330 and 370 are used to gain different frequency bands.

[0167] In some embodiments, the computer device again performs the step of determining equalizer parameters based on the first spectrum data and the second spectrum data, including: for each of n frequency points, calculating the difference between the first amplitude value and the second amplitude value of the frequency point to obtain an amplitude difference of the frequency point; and determining a target frequency point from the n frequency points based on the amplitude differences of the n frequency points. The specific process of this step is described in the above embodiment and is not further described here.

[0168] The parameters of the equalizer are determined according to the target frequency. Optionally, if the target frequency is not included in the n frequency points, it means that there is no need to perform frequency response correction. That is, the current loop process no longer meets the correction conditions. In this case, the equalizer parameters determined according to the target frequency in each loop completed by the computer device are summarized to obtain the parameters of the total equalizer. The computer device passes the parameters of the total equalizer to the equalizer, so that before the playback device plays, the equalizer generates a gain curve of the equalizer according to the parameters of the total equalizer, so that the frequency response curve of the audio system is changed, thereby improving the timbre of the audio system.

[0169] The following describes a method for generating the third frequency response data through several embodiments. The embodiment is performed by a computer device.

[0170] In some embodiments, equalizer parameters include center frequency, gain, and quality factor. The center frequency refers to the center frequency point to be corrected, the gain refers to the amplitude change at the center frequency after frequency response correction, and the quality factor represents the bandwidth of the gain's effect on frequencies surrounding the center frequency. For details on the equalizer parameters, please refer to the above embodiments and will not be elaborated upon here.

[0171] In some embodiments, step 340, generating third frequency response data according to the parameters of the equalizer, may include the following sub-steps.

[0172] Sub-step 342 , performing ratio processing based on the center frequency and the sampling frequency to determine a first parameter, where the sampling frequency is related to the number of frequency points included in the first spectrum data.

[0173] Sub-step 344 , performing exponential processing on the first constant according to the gain to determine the second parameter.

[0174] Sub-step 346 , performing ratio processing based on the first parameter and the quality factor to determine the third parameter.

[0175] Sub-step 348 , generating third frequency response data according to the first parameter, the second parameter, and the third parameter.

[0176] Optionally, the first parameter is positively correlated with the center frequency and negatively correlated with the sampling frequency. Exemplarily, the first parameter is calculated using the following formula: W0 = 2.0π × fc / fs; where W0 represents the first parameter, fc represents the center frequency, and fs represents the sampling frequency.

[0177] Optionally, the second parameter is positively correlated with the gain. For example, the second parameter is calculated using the following formula: A = pow(10.0, gain / 40.0); where A represents the second parameter, gain represents the gain, and pow(10.0, gain / 40.0) represents 10 raised to the power of gain / 40.0.

[0178] Optionally, the third parameter is positively correlated with the first parameter, and negatively correlated with the quality factor. For example, the first parameter is calculated using the following formula: alpha = sin(w0) / (2.0×q); where alpha represents the third parameter, w0 represents the first parameter, and q represents the quality factor.

[0179] In some embodiments, sub-step 348 of generating third frequency response data based on the first parameter, the second parameter, and the third parameter includes: the computer device generating filter coefficients for an equalizer based on the first parameter, the second parameter, and the third parameter, the filter coefficients being used to control the filter in the equalizer to affect the frequency response curve to be corrected; and the computer device performing frequency response processing based on the filter coefficients to obtain the third frequency response data.

[0180] In some embodiments, the equalizer includes multiple filters, with different filters used to apply gain to frequency response curves in different frequency bands. Specifically, during actual operation of the equalizer, the filters generate frequency response curves corresponding to different frequency bands, thereby applying gain to the source frequency response curve of the playback device and thereby changing the audio playback effect of the sound system.

[0181] For example, the filter type includes, but is not limited to, at least one of the following: a FIR (Finite Impulse Respond) digital filter, an IIR (Infinite Impulse Response) filter, etc. It should be noted that the type of filter included in the equalizer depends on the actual situation of the audio system and is not limited in this application.

[0182] The methods for generating third-party frequency response data based on equalizer parameter simulation vary for different filter types. Below, we describe the method for generating third-party frequency response data using an IIR digital filter as an example.

[0183] Optionally, the filter coefficients include a first filter coefficient, a second filter coefficient, a third filter coefficient, a fourth filter coefficient, a fifth filter coefficient and a sixth filter coefficient.

[0184] Among them, the first filter coefficient is positively correlated with the first parameter and negatively correlated with the second parameter; the second filter coefficient is positively correlated with the first parameter and positively correlated with the second parameter; the fifth filter coefficient is negatively correlated with the first parameter and positively correlated with the second parameter; the sixth filter coefficient is negatively correlated with the first parameter and negatively correlated with the second parameter.

[0185] Exemplarily, the calculation formula of the first filter coefficient is as follows: a0=1.0+alpha / A; wherein a0 represents the first filter coefficient, alpha represents the first parameter, and A represents the second parameter.

[0186] Exemplarily, the calculation formula of the second filter coefficient is as follows: b0=1.0+alpha*A; wherein b0 represents the second filter coefficient, and for other parameters, please refer to the above embodiment.

[0187] Exemplarily, the calculation formula of the third filter coefficient is as follows: a1=-2.0*cos(w0); wherein a1 represents the third filter coefficient, and w0 represents the third parameter.

[0188] Exemplarily, the calculation formula of the fourth filter coefficient is as follows: b1=-2.0*cos(w0); wherein b1 represents the fourth filter coefficient, and for other parameters, please refer to the above embodiment.

[0189] Exemplarily, the calculation formula of the fifth filter coefficient is as follows: a2=1.0-alpha / A; wherein a2 represents the fifth filter coefficient, and for other parameters, please refer to the above embodiment.

[0190] Exemplarily, the calculation formula of the sixth filter coefficient is as follows: b2=1.0-alpha*A; wherein b2 represents the sixth filter coefficient, and for other parameters, please refer to the above embodiment.

[0191] Optionally, the transfer function of the filter is calculated using the first filter coefficient, the second filter coefficient, the third filter coefficient, the fourth filter coefficient, the fifth filter coefficient, and the sixth filter coefficient. Exemplarily, the calculation formula of the transfer function H(z) of the filter is as follows:

[0192]

[0193] Optionally, the computer device generates third frequency response data according to a transfer function of the filter.

[0194] For example, the computer device generates the third frequency response data by referring to the freqz function of matlab.

[0195] Figure 5 A schematic diagram of a frequency response correction process provided by an exemplary embodiment of the present application is shown. Figure 5 This example illustrates the frequency response correction process. This example is performed by a computer and includes the following steps.

[0196] Step B10: Acquire calibration parameters, which include various parameters required for the calibration process. Optionally, the calibration parameters include, but are not limited to, at least one of the following: calibration error, the number of equalizer segments in the audio system to be calibrated, the frequency range to be calibrated, and a reference level. The number of equalizer segments indicates the frequency bands in which the equalizer can provide gain, and the range to be calibrated indicates the frequency bands in which the frequency response curve of the audio system to be calibrated needs to be calibrated. For example, the range to be calibrated may be 150-5000 kHz.

[0197] Step B20-a: Obtain first frequency response data. Exemplarily, the computer device imports the first frequency response data from an external source. For an introduction to the first frequency response data, please refer to the above embodiment and will not be elaborated upon here.

[0198] Step B20-b: Acquire second frequency response data. This application does not limit the execution order of step B20-a and step B20-b.

[0199] Step B30-a: Determine first spectrum data based on the first frequency response data. Optionally, if the first spectrum data is a spectrum TXT file, the computer device reads the first spectrum data from the first frequency response data. If the first spectrum data is a PCM file, the computer device performs operations such as a fast Fourier transform on the PCM file to obtain the first spectrum data. Please refer to the above embodiment for details.

[0200] Step B30-b: Determine second spectrum data based on the second frequency response data. The method for determining the second spectrum data is similar to the method for determining the first spectrum data, and will not be described in detail here.

[0201] Step B40: The first spectrum data includes n frequency points and a first amplitude value of each frequency point; the second spectrum data includes n frequency points and a second amplitude value of each frequency point; for each of the n frequency points, the difference between the first amplitude value of the frequency point and the second amplitude value of the frequency point is calculated to obtain the amplitude difference of the frequency point.

[0202] Step B50 determines a target frequency from the n frequency points based on the amplitude differences of the n frequency points. The target frequency is a frequency point whose amplitude difference is greater than or equal to the calibration error. Alternatively, this step can be understood as selecting the amplitude difference with the largest absolute value from the amplitude differences of the n frequency points and determining this amplitude difference as the target amplitude difference. The frequency point corresponding to the target amplitude difference is the target frequency point.

[0203] Step B60: Determine the parameters of the equalizer according to the target frequency. For details of this step, please refer to the above embodiment and will not be described in detail here.

[0204] Step B70: generating third frequency response data according to the parameters of the equalizer, where the third frequency response data is used to reflect the frequency response curve of the equalizer.

[0205] Step B80: Superimpose the third frequency response data and the first frequency response data to generate updated first frequency response data.

[0206] Step B90: When the amplitude difference between the updated first spectrum data and the second spectrum data meets the correction condition, the updated first spectrum data is used as the first spectrum data, and the step of determining the parameters of the equalizer based on the first spectrum data and the second spectrum data is performed again.

[0207] Optionally, after generating the updated first spectrum data, the computer device recalculates the amplitude differences of the n frequency points and selects the amplitude difference with the largest absolute value from the n frequency points. If the absolute value of the selected amplitude difference is greater than or equal to the calibration error, the frequency point corresponding to the selected amplitude difference is determined as the target frequency point. The computer device then executes step B60 to determine equalizer parameters associated with the target frequency point. The equalizer parameters associated with the target frequency point are used to adjust the gain of the frequency band in which the target frequency point is located in the frequency response curve to be calibrated.

[0208] If the absolute value of the selected amplitude difference is less than the calibration error, the frequency response calibration process ends. The computer device uses the equalizer parameters determined during steps B60 to B90 as the parameters of the overall equalizer and transmits the parameters of the equalizer to the sound system.

[0209] The embodiment of the present application automatically implements frequency response correction, greatly reducing the labor cost and debugging cycle required during the frequency response correction process, and helping to improve production efficiency.

[0210] Figure 6 A block diagram of a frequency response correction device provided by an exemplary embodiment of the present application is shown. The device can be implemented as all or part of a computer device through software, hardware, or a combination of both. The device 600 may include a data acquisition module 610, a spectrum determination module 620, and a parameter determination module 630.

[0211] The data acquisition module 610 is configured to acquire first frequency response data, where the first frequency response data is used to represent a frequency response curve to be corrected, and the frequency response curve is used to reflect a trend of loudness changing with frequency.

[0212] The spectrum determination module 620 is configured to determine first spectrum data according to the first frequency response data, where the first spectrum data is used to reflect the properties of the frequency response curve to be corrected in the frequency direction.

[0213] A parameter determination module 630 is configured to determine parameters of an equalizer based on the first spectrum data and the second spectrum data. The second spectrum data is determined based on second frequency response data, and the second frequency response data is used to represent a reference frequency response curve used for frequency response correction. The equalizer is configured to control the frequency response curve to be corrected to approach the reference frequency response curve based on the parameters.

[0214] In some embodiments, the first spectrum data includes n frequency points and a first amplitude value of each of the frequency points, and the second spectrum data includes the n frequency points and a second amplitude value of each of the frequency points, where n is a positive integer; the parameter determination module 630 includes: an amplitude difference calculation unit, for calculating, for each of the n frequency points, the difference between the first amplitude value of the frequency point and the second amplitude value of the frequency point to obtain the amplitude difference of the frequency point; a frequency point determination unit, for determining a target frequency point from the n frequency points based on the amplitude difference of the n frequency points, where the target frequency point refers to a frequency point whose amplitude difference is greater than or equal to the correction error; and a parameter determination unit, for determining the parameters of the equalizer based on the target frequency point.

[0215] In some embodiments, the parameters of the equalizer include: a center frequency, a gain, and a quality factor, wherein the center frequency refers to the center point of the frequency to be corrected, the gain refers to the amplitude change at the center frequency after frequency response correction, and the quality factor is used to characterize the bandwidth of the influence of the gain on the frequencies surrounding the center frequency; the parameter determination unit is used to determine the center frequency based on the target frequency point; determine the gain based on the amplitude difference between the target frequency points; and determine the quality factor based on the center frequency and the bandwidth of the frequency response curve, wherein the bandwidth of the frequency response curve is used to characterize the frequency span in the frequency response curve to be corrected where the amplitude value of the center frequency is attenuated to half.

[0216] In some embodiments, the quality factor is positively correlated with the center frequency, and the quality factor is negatively correlated with the bandwidth of the frequency response curve.

[0217] In some embodiments, the device 600 further includes: a bandwidth determination module, configured to determine a first frequency and a second frequency corresponding to the center frequency, wherein the first frequency refers to a frequency point corresponding to half of the amplitude value of the center frequency in a frequency decreasing direction, and the second frequency refers to a frequency point corresponding to half of the amplitude value of the center frequency in a frequency increasing direction; calculate a first frequency bandwidth between the center frequency and the first frequency, and calculate a second frequency bandwidth between the second frequency and the center frequency; and determine the bandwidth of the frequency response curve according to a target frequency bandwidth, wherein the target frequency bandwidth is the smaller value of the first frequency bandwidth and the second frequency bandwidth.

[0218] In some embodiments, the apparatus further includes: a frequency response generating module, configured to generate third frequency response data based on the parameters of the equalizer, the third frequency response data being used to reflect the frequency response curve of the equalizer; a data superposition module, configured to superimpose the third frequency response data and the first frequency response data to generate updated first frequency response data; a spectrum updating module, configured to determine updated first spectrum data based on the updated first frequency response data; and a loop execution module, configured to, if an amplitude difference between the updated first spectrum data and the second spectrum data satisfies a correction condition, use the updated first spectrum data as the first spectrum data and again execute the step of determining the parameters of the equalizer based on the first spectrum data and the second spectrum data.

[0219] In some embodiments, the parameters of the equalizer include: a center frequency, a gain, and a quality factor, where the center frequency refers to the center point of the frequency to be corrected, the gain refers to the amplitude change at the center frequency after frequency response correction, and the quality factor is used to characterize the bandwidth of influence of the gain on frequencies surrounding the center frequency. The frequency response generation module includes: a parameter determination unit, configured to determine a first parameter by performing ratio processing on the center frequency and a sampling frequency, where the sampling frequency is related to the number of frequency points included in the first spectrum data; to determine a second parameter by performing exponential processing on a first constant according to the gain; and to determine a third parameter by performing ratio processing on the first parameter and the quality factor; and a data calculation unit, configured to generate the third frequency response data based on the first parameter, the second parameter, and the third parameter.

[0220] In some embodiments, the data calculation unit is configured to: generate filter coefficients for the equalizer based on the first parameter, the second parameter, and the third parameter, wherein the filter coefficients are used to control the filter in the equalizer to affect the frequency response curve to be corrected; and perform frequency response processing based on the filter coefficients to obtain the third frequency response data.

[0221] In some embodiments, the spectrum generation module 620 is configured to perform Fourier transform on the first frequency response data to determine initial spectrum data; perform smoothing on the initial spectrum data to determine smooth spectrum data; and perform interpolation on the smooth spectrum data based on the second spectrum data to determine the first spectrum data.

[0222] It should be noted that the device provided in the above embodiment, when implementing its functions, only uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept. The specific implementation process is detailed in the embodiment on the method side, which will not be repeated here. For the beneficial effects of the device provided in the above embodiment, please refer to the description of the embodiment on the method side, which will not be repeated here.

[0223] Figure 7 A structural block diagram of a computer device provided by an exemplary embodiment of the present application is shown.

[0224] Typically, the computer device 700 includes a processor 701 and a memory 702 .

[0225] The processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 701 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), or PLA (Programmable Logic Array). The processor 701 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 701 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 701 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0226] Memory 702 may include one or more computer-readable storage media, which may be tangible and non-transitory. Memory 702 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices or flash memory storage devices. In some embodiments, the non-transitory computer-readable storage media in memory 702 store a computer program, which is loaded and executed by processor 701 to implement the frequency response correction methods provided in the above-described method embodiments.

[0227] An embodiment of the present application further provides a computer-readable storage medium storing a computer program. The computer program is loaded and executed by a processor to implement the frequency response correction method provided by the above-mentioned method embodiments, or to implement the frequency response correction model training method provided by the above-mentioned method embodiments.

[0228] The computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM (Random Access Memory), ROM (Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technology, CD-ROM, DVD (Digital Video Disc) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the above-mentioned ones.

[0229] An embodiment of the present application further provides a computer program product, comprising computer instructions stored in a computer-readable storage medium, and a processor reading and executing the computer instructions from the computer-readable storage medium to implement the frequency response correction methods provided in the above-mentioned method embodiments.

[0230] It should be understood that the term "plurality" used herein refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates an "or" relationship between the associated objects.

[0231] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent switches, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A frequency response correction method, characterized in that: The method comprises: Acquiring first frequency response data, where the first frequency response data is used to represent a frequency response curve to be corrected, where the frequency response curve is used to reflect a trend of loudness changing with frequency; determining first spectrum data according to the first frequency response data, where the first spectrum data is used to reflect the properties of the frequency response curve to be corrected in the frequency direction; determining parameters of an equalizer based on the first spectrum data and second spectrum data, wherein the second spectrum data is determined based on second frequency response data, the second frequency response data being used to represent a reference frequency response curve used for frequency response correction, and the equalizer being used to control the frequency response curve to be corrected to approach the reference frequency response curve based on the parameters; The first spectrum data includes n frequency points and a first amplitude value of each frequency point, and the second spectrum data includes the n frequency points and a second amplitude value of each frequency point, where n is a positive integer; Determining parameters of an equalizer according to the first spectrum data and the second spectrum data includes: For each of the n frequency points, calculating a difference between a first amplitude value of the frequency point and a second amplitude value of the frequency point to obtain an amplitude difference of the frequency point; Determining a target frequency point from the n frequency points based on the amplitude difference of the n frequency points, wherein the target frequency point refers to a frequency point whose amplitude difference is greater than or equal to the correction error; Determine the parameters of the equalizer according to the target frequency.

2. The method according to claim 1, characterized in that The parameters of the equalizer include: center frequency, gain, and quality factor. The center frequency refers to the center point of the frequency to be corrected. The gain refers to the amplitude change at the center frequency after frequency response correction. The quality factor is used to characterize the bandwidth of the gain's influence on the frequencies surrounding the center frequency. The determining the parameters of the equalizer according to the target frequency point includes: Determining the center frequency according to the target frequency point; Determining the gain according to the amplitude difference of the target frequency point; The quality factor is determined according to the center frequency and a bandwidth of the frequency response curve. The bandwidth of the frequency response curve is used to represent a frequency span in which the amplitude value of the center frequency is attenuated to half in the frequency response curve to be corrected.

3. The method according to claim 2, characterized in that The quality factor is positively correlated with the center frequency, and negatively correlated with the bandwidth of the frequency response curve.

4. The method according to claim 2, characterized in that The method further comprises: Determine a first frequency and a second frequency corresponding to the center frequency, wherein the first frequency refers to a frequency point corresponding to half of the amplitude value of the center frequency in a decreasing frequency direction, and the second frequency refers to a frequency point corresponding to half of the amplitude value of the center frequency in an increasing frequency direction; calculating a first frequency bandwidth between the center frequency and the first frequency, and calculating a second frequency bandwidth between the second frequency and the center frequency; The bandwidth of the frequency response curve is determined according to a target frequency bandwidth, where the target frequency bandwidth is a smaller value between the first frequency bandwidth and the second frequency bandwidth.

5. The method according to claim 1, wherein After determining the parameters of the equalizer according to the first spectrum data and the second spectrum data, the method further includes: generating third frequency response data according to the parameters of the equalizer, wherein the third frequency response data is used to reflect the frequency response curve of the equalizer; superimposing the third frequency response data and the first frequency response data to generate updated first frequency response data; determining updated first spectrum data according to the updated first frequency response data; When the amplitude difference between the updated first spectrum data and the second spectrum data meets the correction condition, the updated first spectrum data is used as the first spectrum data, and the step of determining the parameters of the equalizer based on the first spectrum data and the second spectrum data is performed again.

6. The method according to claim 5, characterized in that The parameters of the equalizer include: center frequency, gain, and quality factor. The center frequency refers to the center point of the frequency to be corrected. The gain refers to the amplitude change at the center frequency after frequency response correction. The quality factor is used to characterize the bandwidth of the gain's influence on the frequencies surrounding the center frequency. Generating third frequency response data according to the parameters of the equalizer includes: performing ratio processing on the center frequency and the sampling frequency to determine a first parameter, wherein the sampling frequency is related to the number of frequency points included in the first spectrum data; Performing exponential processing on the first constant according to the gain to determine a second parameter; performing ratio processing on the first parameter and the quality factor to determine a third parameter; The third frequency response data is generated according to the first parameter, the second parameter, and the third parameter.

7. The method according to claim 6, characterized in that Generating the third frequency response data according to the first parameter, the second parameter, and the third parameter includes: generating filter coefficients of the equalizer according to the first parameter, the second parameter, and the third parameter, wherein the filter coefficients are used to control the filter in the equalizer to affect the frequency response curve to be corrected; Frequency response processing is performed based on the filter coefficient to obtain the third frequency response data.

8. The method according to claim 1, characterized in that Determining first spectrum data according to the first frequency response data includes: Performing Fourier transform on the first frequency response data to determine initial spectrum data; performing smoothing processing on the initial spectrum data to determine smooth spectrum data; Based on the second spectrum data, the flat spectrum data is interpolated to determine the first spectrum data.

9. A frequency response correction device, characterized in that: The device comprises: a data acquisition module, configured to acquire first frequency response data, wherein the first frequency response data is used to represent a frequency response curve to be corrected, wherein the frequency response curve is used to reflect a trend of loudness changing with frequency; a spectrum determination module, configured to determine first spectrum data based on the first frequency response data, wherein the first spectrum data is used to reflect the properties of the frequency response curve to be corrected in the frequency direction; a parameter determination module, configured to determine parameters of an equalizer based on the first spectrum data and second spectrum data, wherein the second spectrum data is determined based on second frequency response data, the second frequency response data being used to represent a reference frequency response curve used for frequency response correction, and the equalizer being configured to control the frequency response curve to be corrected to approach the reference frequency response curve based on the parameters; wherein the first spectrum data includes n frequency points and a first amplitude value for each of the frequency points, and the second spectrum data includes the n frequency points and a second amplitude value for each of the frequency points, where n is a positive integer; The parameter determination module is used to calculate, for each of the n frequency points, the difference between the first amplitude value of the frequency point and the second amplitude value of the frequency point to obtain the amplitude difference of the frequency point; determine a target frequency point from the n frequency points based on the amplitude differences of the n frequency points, where the target frequency point refers to a frequency point whose amplitude difference is greater than or equal to the correction error; and determine the parameters of the equalizer based on the target frequency point.

10. A computer device, characterized in that: The computer device includes a processor and a memory, and the processor loads and executes computer instructions from the memory to implement the frequency response correction method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that The storage medium stores computer instructions, which are loaded and executed by a processor from the storage medium to implement the frequency response correction method according to any one of claims 1 to 8.

12. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. The computer instructions are loaded and executed by a processor from the computer-readable storage medium to implement the frequency response correction method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Frequency response correction method and related product

    CN114302301A

  • Frequency response curve correction method and device

    CN115840182A