Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
First, the nouns involved in the embodiments of the present application will be described:
1. The sound system is a system which converts sound wave signals of an original sound field into electric signals by using a microphone, processes the electric signals through some electronic devices according to certain requirements, and finally converts the electric signals into sound wave signals by using playing devices such as a loudspeaker and the like for playback.
In an embodiment of the present application, the sound system includes at least an electronic device for converting an electrical signal into an acoustic signal and playing the acoustic signal. Optionally, the sound system includes a playback device and an equalizer, and the playback device includes a speaker. The equalizer is used for adjusting the frequency response curve of the sound system so as to change the audio playing effect of the sound system and achieve the purpose of tuning.
2. And the equalizer is used for compensating the defect of the playing equipment or carrying out tone according to the preference of the user. The equalizer adjusts the gain of some frequency bands in the audio signal to make the sound of the frequency bands become larger or smaller, thereby adjusting the frequency response curve of the sound system and changing the audio playing effect of the playing device.
According to different action positions, the equalizer comprises at least two types of equalizer at the power amplifier end and equalizer at the sound source end. The equalizer at the sound source end comprises a hardware equalizer and a software equalizer.
Ft (Fourier Transform ) is one method by which a signal in the time domain (i.e., instant domain) can be converted into a signal in the frequency domain (i.e., frequency domain). The conversion of the time domain signal into a frequency domain signal causes some problems in the time domain that are not well handled, which can be handled in a relatively simple manner in the frequency domain.
The FFT fast Fourier transform (Fast Fourier Transform ) is an efficient time-frequency conversion algorithm for fast computation of the Fourier transform and its inverse. The FFT takes advantage of some mathematical properties of the fourier transform, so that its computational efficiency is greatly improved. Although FFT is mathematically equivalent to fourier transform, FFT has become a major tool in actually computing fourier transform due to its computational efficiency advantage.
FIG. 1 is a schematic diagram of an implementation environment for an embodiment of the present application. The solution implementation environment may include a computer device 10 and an audio system 20.
The computer device 10 may be an electronic device such as a PC (Personal Computer ), tablet, cell phone, wearable device, smart home appliance, in-vehicle terminal, aircraft, etc. The computer device 10 has at least arithmetic and memory functions. The computer device 10 is used to implement a frequency response correction function. For example, a target application is running in the computer device 10. The target application is used to complete the frequency response correction for sound system 20. The computer device 10 may also be a server, that is, the frequency response correction procedure provided by the embodiment of the present application is remotely completed by the server.
Sound system 20 is used to convert audio sources in audio files or video files into electrical signals and play corresponding sounds. The sound system includes at least a playing device 22 and an equalizer 24, the equalizer 24 is used to adjust the audio playing effect of the sound system 20, and the playing device 22 is used to play sound. Equalizer 24 may be in software or hardware.
There is a wired or wireless connection between the computer device 10 and the sound system 20. Alternatively, computer device 10 exists independently of sound system 20, or computer device 10 is integrated in sound system 20.
In one example, computer device 10 and sound system 20 are independent of each other. When frequency response correction is required, computer device 10 obtains source frequency response data and target frequency response data of sound system 20, determines equalizer parameters 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), and feeds back the equalizer parameters to equalizer 24 in sound system 20. So that after the frequency response correction, equalizer 24 uses the parameters of the equalizer to adjust the frequency response curve of sound system 20, thereby achieving the purpose of changing the audio playing effect of sound system 20.
In the process of performing the frequency response correction, the sound system 20 may be placed in a recording studio, so as to collect source frequency response data of the sound system under the condition of less interference, reduce environmental errors introduced in the process of performing the frequency response correction, and be helpful to improve the correction effect of the frequency response correction.
Sound system 20 may also be placed in an actual use environment (e.g., outdoors, indoors, at a performance site, etc.) during the frequency response correction process so that the frequency response correction process can determine parameters of the equalizer that are appropriate for the use environment. For specific procedures regarding this method, reference is made to the examples below.
The application scenario of the frequency response correction method provided by the application comprises, but is not limited to, at least one of the following:
(1) Before the sound system leaves the factory, the frequency response curve of the sound system is adjusted.
(2) In the use process of the sound system, the frequency response curve of the sound system is adjusted. For an audio system capable of accessing to the internet of things, the parameters of an equalizer in the audio system can be updated periodically by the frequency response correction method, so that the audio playing effect of the audio system can be optimized periodically. Illustratively, the user determines parameters of an equalizer in the sound system by the present frequency response correction method according to tuning needs.
It should be noted that the application scenario mentioned above represents only an example of the application scenario of the frequency response correction method, and is not limited to the application scenario of the frequency response correction method.
Fig. 2 is a schematic diagram of the inventive concept provided by an exemplary embodiment of the present application.
As shown in fig. 2, the loudness corresponding to different frequency points in a source frequency response curve used for representing source frequency response data is limited by component elements, sounding principles and the like of a playing device in a sound system, which may affect the playing effect of the sound system on audio files in certain styles, and the audio playing effect of the sound system needs to be improved.
The embodiment of the application can automatically determine the parameters of the equalizer according to the source frequency response data and the target frequency response data. The equalizer is used for gaining the source frequency response curve according to the equalizer parameters, and the corrected frequency response curve is close to the target frequency response curve, so that the aim of automatic tuning is fulfilled.
In addition, the frequency response correction method provided by the embodiment of the application has lower requirements on the technical threshold of the user in the tuning process, realizes automatic correction of the frequency response curve, and is beneficial to shortening the period of frequency response correction.
Fig. 3 is a flowchart of a frequency response correction method according to an exemplary embodiment of the present application. By way of example, the subject of execution of the method may be the computer device 10 in the implementation environment of the scheme shown in fig. 1. As shown in fig. 3, the method may include at least one of the following steps (310-330):
in step 310, first frequency response data is obtained, 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 along with frequency variation.
In some embodiments, the first frequency response data is used to reflect a frequency response curve of the sound system when playing audio. The frequency response curve is also referred to as a frequency response curve. The frequency response curve is understood to be a curve representation of the energy distribution in space of sound radiated by the sound system at different frequencies. That is, the first frequency response data is used to characterize the performance capabilities of the sound system for sounds of different frequencies.
Alternatively, the frequency response curve is a two-dimensional curve, wherein the positive x-axis direction represents the frequency from low to high and the positive y-axis direction represents the amplitude of the ripple from low to high. Illustratively, the frequency corresponds to the tone in the hearing of the human ear, the higher the frequency the brighter the tone, and the higher the frequency the lower the tone. The amplitude of the fluctuation corresponds to the loudness in the sense of hearing of the human ear, the greater the loudness corresponding to a certain frequency in the frequency response curve, the greater the sound at that frequency. Different frequency response curves can bring different auditory experiences to the user.
Optionally, the frequency response curve to be corrected is used to reflect the playing loudness of the sound system at different frequencies. The loudness corresponding to different frequencies in the frequency response curve to be corrected may be different due to the limitation of elements, structures and other factors of the playing device, and in order to improve the playing effect, tuning needs to be performed on the frequency response curve to be corrected.
In some embodiments, the type of first frequency response data includes, but is not limited to, at least one of a spectrum TXT (Text File), a System Scan test PCM (Pulse Code Modulation, pulse code Adjust) File, and the like. The first frequency response data is also referred to as a first frequency response profile.
In one example, the first frequency response data is a derived frequency spectrum TXT by the electroacoustic device. In another example, the first frequency response data is a PCM file collected by the sound receiving device, and the computing device treats the PCM file as the first frequency response data. For example, in the process of needing to perform frequency response correction, test audio is transmitted into the sound system, the test audio played by the sound system is collected through the radio equipment to obtain a PCM file, and then the PCM file is imported into the computer equipment to enable the computer equipment to obtain first frequency response data. Illustratively, the test audio comprises sine waves of different frequencies.
Step 320, determining first spectrum data according to the first frequency response data, where the first spectrum data is used to reflect the attribute of the frequency response curve to be corrected in the frequency direction.
Optionally, the first spectral data comprises frequency information and amplitude information of the first frequency response data. Illustratively, the first spectral data is a spectrogram (spectrogram) corresponding to the first frequency response data. The spectrogram comprises at least one amplitude spectrum, and the amplitude spectrum is used for representing the mapping relation between the amplitude and the frequency when the sound system plays the audio. The spectrogram may also include a phase spectrum, which is not limited herein.
In some embodiments, the manner in which the computer device determines the first spectral data from the first frequency response data is related to the type of the first frequency response data.
For example, in case the type of the first frequency response data is the frequency spectrum TXT, the computer device reads the first frequency response data from the first frequency response data, since the frequency information and the amplitude information are included in the frequency spectrum TXT. The method can accelerate the speed of acquiring the frequency response data, and is beneficial to shortening the time consumption for performing the frequency response correction process.
In an exemplary case, where the type of 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. For details of this step, reference is made to the following.
Step 330, determining parameters of the equalizer according to the first frequency spectrum data and the second frequency spectrum data, wherein the second frequency spectrum data is determined according to the second frequency response data, the second frequency response data is used for representing a reference frequency response curve used for frequency response correction, and the equalizer is used for controlling the frequency response curve to be corrected to be close to the reference frequency response curve based on the parameters.
In some embodiments, the second frequency response data is used to represent a target frequency response curve characterizing the frequency response correction. This target frequency response curve is also referred to as a reference frequency response curve. I.e. the second frequency response data is used to provide a correction criterion for the frequency response correction procedure. The aim of the frequency response correction is that after the frequency response correction the frequency response curve of the sound system is close to the target frequency response curve or that the frequency response curve of the sound system coincides with the target frequency response curve.
Optionally, the source of the second frequency response data includes, but is not limited to, at least one of a preset, user-specified. The second frequency response data is illustratively preset. For example, the preset second frequency response data is used to characterize a smooth reference frequency response curve. That is, in the reference frequency response curve, the loudness corresponding to each of the different frequencies is the same, or the difference between the loudness corresponding to each of the different frequencies is less than or corresponds to the first threshold. The first threshold may be a preset positive number.
Illustratively, the second frequency response data is user-specified. That is, the user-specified second frequency response data may be set based on the listening habits of the user. In this case, the loudness corresponding to the different frequency bands in the reference frequency response curve may be the same or different.
In one example, the user may record test audio played by the reference sound system to obtain second frequency response data. And performing frequency response correction through the second frequency response data, so that the audio playing effect of the corrected sound system can be close to that of the reference sound system. In this embodiment, the user is supported to indicate the reference frequency response curve by itself, so that after the source frequency response curve is corrected based on the reference frequency response curve, the audio playing effect of the sound system can conform to the listening habit of the user after the frequency response is corrected, and the user is supported to perform custom setting on the audio playing effect of the sound system, so that the flexibility of the frequency response correction method is improved.
In some embodiments, the type of second frequency response data includes, but is not limited to, at least one of spectrum TXT, PCM file, and the like. For details on the types of the two types of frequency response data, please refer to the above description.
In some embodiments, parameters of the equalizer are used to indicate the frequency response curve of the equalizer. That is, the equalizer generates a frequency response curve of the equalizer according to parameters of the equalizer, and the frequency response curve of the equalizer and the frequency response curve to be corrected are overlapped, so that the frequency response curve of the sound system approaches to the reference frequency response curve, thereby achieving the tuning function. The parameters of the equalizer can be understood as parameters that need to be used in the process of the equalizer performing gain on the source frequency response curve, where gain refers to changing the loudness of at least one frequency band in the source frequency response curve, such as increasing the loudness of frequency band 1, decreasing the loudness of frequency band 2, etc.
Optionally, the parameters of the equalizer include at least one of a center frequency, a gain amount, 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 equalizer parameters, please refer to the following examples.
Illustratively, the equalizer is configured to gain the loudness of at least one frequency band in the source frequency response curve. In at least one frequency band, equalizer parameters respectively corresponding to different frequency bands can be the same or different. The at least one frequency band is a frequency band with a larger difference between the first frequency response curve and the second frequency response curve.
Optionally, in determining the equalizer parameters, parameters of the equalizer corresponding to the at least one frequency band need to be determined separately. So that the frequency response curve of the sound system can be close to the reference frequency response curve in the at least one frequency band after the frequency response correction, the following examples are given for details of this procedure.
In summary, the embodiment of the application can automatically determine the parameters of the equalizer by only acquiring the source frequency response data and the target frequency response data, and the frequency response data of the audio system when playing the audio is close to the target frequency response data by means of the parameters of the equalizer. Through the mode, the threshold of the tuning process for the user is reduced, the automatic correction of the frequency response curve is realized, the frequency response correction efficiency is improved, and the labor cost is reduced.
Meanwhile, in the process of frequency response correction, frequency response data are converted into frequency spectrum data, and the calculation amount involved in determining parameters of the equalizer according to the frequency spectrum data is small. On one hand, the method is beneficial to shortening the time consumption for determining equalizer parameters, accelerating the frequency response correction speed and shortening the correction period of a frequency response curve, and on the other hand, the smaller calculation amount makes the requirement of the frequency response correction method on the equipment performance lower, is beneficial to improving the application scene of the frequency response correction method, and has better universality.
The method of determining the first spectral data is described in the following by means of several embodiments. The method is performed by a computer device.
In some embodiments, step 320, determining first spectrum data according to first frequency response data, where the first spectrum data is used to reflect an attribute of a frequency response curve to be corrected in a frequency direction, includes the substep 322 of performing fourier transform on the first frequency response data to determine initial spectrum data, the substep 324 of performing smoothing on the initial spectrum data to determine flat spectrum data, and the substep 326 of performing interpolation processing on the flat spectrum data based on second spectrum data to determine the first spectrum data.
In some embodiments, for a first frequency response number belonging to the PCM file type, the computer device performs a spectral data extraction process on the first frequency response data to obtain first spectral data. Illustratively, the computer device performs a fast fourier transform on the first frequency response data to obtain initial spectral data. The computer device performs a spectral data extraction process on the first frequency response data using kissfft to obtain initial spectral data.
Alternatively, the processing of the spectral data mainly involves smoothing of the spectral data, e.g., octive 1/3, octive 1/6, etc. The smoothing process is used for generating k×c frequency points based on c frequency points included in the initial spectrum data, and k is a positive integer.
Optionally, interpolation processing of the frequency spectrum data is used for the frequency values and the points of the frequency response curve to be corrected and the target frequency response curve are consistent. The interpolation processing is used for adding a new frequency point between two adjacent frequency points included in the gentle frequency spectrum data, and determining the amplitude value of the new frequency point according to the amplitude values respectively corresponding to the two adjacent frequency points.
The computer equipment determines the total number of frequency points in the second frequency spectrum data, determines the number of frequency points to be interpolated according to the total number of frequency points in the second frequency spectrum data, determines the amplitude value corresponding to at least one interpolation frequency point and each interpolation frequency point respectively according to the number of frequency points to be interpolated and the flat frequency spectrum data, and adds the amplitude value corresponding to at least one interpolation frequency point and each interpolation frequency point respectively into the flat frequency spectrum data to obtain first frequency spectrum data.
For example, the computer device determines the number of frequency points to be interpolated according to the total number of frequency points in the second frequency spectrum data, including determining the total number of frequency points in the flat frequency spectrum data, and subtracting the total number of frequency points in the flat frequency spectrum data from the total number of frequency points in the second frequency spectrum data to obtain the number of frequency points to be interpolated.
For example, the computer equipment determines at least one interpolation frequency point and the corresponding amplitude value of each interpolation frequency point according to the number of frequency points to be interpolated and the gentle frequency spectrum data, and the method comprises the steps that the computer equipment selects the number of frequency point pairs of the frequency points to be interpolated from the frequency points included in the gentle frequency spectrum data, and the computer equipment determines the amplitude value of the frequency points to be processed according to the amplitude values of two frequency points included in the frequency point pairs, wherein the frequency point pairs comprise two adjacent frequency points, and a frequency interval between the two frequency points in the frequency point pairs to be processed.
For example, the computer equipment determines at least one interpolation frequency point and the amplitude corresponding to each interpolation frequency point according to the number of frequency points to be interpolated and the gentle frequency spectrum data, and comprises determining the number of frequency points to be processed of the frequency points to be interpolated according to the gentle frequency spectrum data and the second frequency spectrum data, wherein the frequency points to be processed are frequency points which are included in the second frequency spectrum data and are not included in the gentle frequency spectrum data, and for each frequency point to be processed in the at least one frequency point to be processed, the two frequency points closest to the frequency point to be processed are found out from the gentle frequency spectrum data, and the amplitude of the frequency point to be processed is determined according to the amplitudes of the two frequency points.
By the method, the total number of frequency points of the first frequency spectrum data and the second frequency spectrum data can be aligned, and accuracy of parameters of the equalizer determined later can be improved.
In some embodiments, the number of points of the spectral data refers to the number of sampling points in a 0-2 pi period during the fast Fourier transform. The number of points of 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 obtained spectrum data after fourier transform. Illustratively, if the number of points of the spectrum data is equal to 64, it means that 64 spectrums are included in the spectrum data, that is, 64 frequency points and magnitudes corresponding to the 64 frequency points are included in the spectrum data.
The method for determining the parameters of the equalizer is described in several embodiments, and the method is implemented by a computer device.
In some embodiments, the first spectral data includes n bins and a first amplitude value for each bin, and the second spectral data includes n bins and a second amplitude value for each bin, n being a positive integer.
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 points, where m and p are positive integers greater than or equal to n.
The frequency point refers to an absolute frequency value. The total number of frequency bins included in the first spectral data and the second spectral data may be related to the number of sampling points in the spectral conversion process. The application does not limit the total number of frequency points respectively included in the first frequency spectrum data and the second frequency spectrum data.
Illustratively, at least n identical frequency points are included between the m frequency points and the p frequency points. E.g. n refers to the smaller of m and p.
In one example, in view of improving the utilization efficiency of each frequency point included in the spectrum data and improving the accuracy of the frequency response correction process, n=m=p, that is, the number of frequency points included in the first spectrum data and the second spectrum data are the same, and all the frequency points participate in the process of determining the parameters of the equalizer.
In another example, in determining parameters of the equalizer, the computer device picks n common frequency points from the first spectral data and the second spectral data and determines parameters of the equalizer based on the n frequency points. Illustratively, the computer device determines, from the frequency bin intervals, n frequency bins that the first spectral data and the second spectral data collectively include. For example, for any two frequency points in the n frequency points, the frequency span between the two frequency points is greater than or equal to the second threshold. The second threshold is used to characterize the minimum frequency span between two frequency bins. Optionally, the second threshold is preset.
By controlling the frequency span among n frequency points, the influence on other frequency bands in the process of gaining the frequency band where a certain frequency point is located can be reduced. The method has the advantages that the gain of the frequency band where a certain frequency point is located is avoided, the loudness of other frequency bands is caused to fluctuate greatly, the gain of other frequency bands is required to be adjusted, the efficiency of frequency response correction is improved, and the degree that the corrected frequency response curve is close to the reference frequency response curve is improved.
In some embodiments, step 330, determining parameters of the equalizer from the first spectral data and the second spectral data, may include the following sub-steps.
In step 332, for each of the n frequency points, a difference between the first amplitude value of the frequency point and the second amplitude value of the frequency point is calculated, so as to obtain an amplitude difference of the frequency point.
In some embodiments, the first spectrum data includes at least one spectrum, each spectrum corresponding to a frequency amplitude, the frequency amplitude being a first amplitude difference of the frequency bin. Illustratively, the amplitude difference of the frequency bins is equal to the second amplitude value minus the first amplitude value. The amplitude difference of the frequency points is used for representing the amplitude difference of the first frequency response curve at the frequency points of the second frequency response curve, and the amplitude difference is a rational number. The computer device can sequentially calculate the amplitude differences of n frequency points, or can calculate the amplitude differences of a plurality of frequency points in parallel at a time.
In step 334, a target frequency point is determined from the n frequency points according to the amplitude differences of the n frequency points, where the target frequency point is a frequency point with the amplitude difference greater than or equal to the correction error.
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 except the target frequency point in the n frequency points. For example, the absolute value of the amplitude difference of the target frequency point is the largest of the amplitude differences of the n frequency bands. For example, n=4, the amplitude differences of the 4 frequency points are-10, 15, 10 and-20 respectively, and the computer equipment takes the frequency point with the amplitude difference of-20 as the target frequency point.
The amplitude difference of the frequency points has positive and negative, and therefore, the amplitude difference of the target frequency point being greater than or equal to the correction error means that the absolute value of the amplitude difference of the target frequency point is greater than or equal to the correction error. For example, if the difference in amplitude of a certain frequency point is equal to-5 and the correction error is equal to 3, it means that the difference in amplitude of the frequency point is greater than or equal to the correction error, that is, the frequency point may be regarded as the target frequency point.
Optionally, the computer device determines the target frequency point from the n frequency points according to a quantitative relationship between the amplitude difference and the correction error. Illustratively, the computer apparatus selects, as the target frequency point, a frequency point having the largest absolute value of the amplitude difference from the n frequency points.
The correction error may be preset, e.g., the correction error is equal to a decibels (dB), a being a positive number. For example, the correction error is any one value between 1-3 dB. Illustratively, the correction error affects how close the corrected frequency response curve is to the reference frequency response curve. The smaller the correction error, the closer the corrected frequency response curve is to the reference frequency response curve, and the larger the correction error, the larger the difference between the corrected frequency response curve and the reference frequency response curve.
The correction error may be set by the user according to actual needs, for example. For example, when the frequency response correction needs to be completed quickly, the user may set a larger correction error, such as setting the correction error to 3dB. For example, when an accurate frequency response correction is required, the user may set a smaller correction error, such as setting the correction error to 1dB. The correction error is set according to actual needs, and the present application is not limited herein.
In some embodiments, the computer device determines a target frequency point from the n frequency points according to the amplitude differences of the n frequency points, including that the computer device selects an amplitude difference with the largest absolute value from the amplitude differences of the n frequency points, and if the absolute value of the amplitude difference is greater than or equal to the correction error, the frequency point with the amplitude difference in the n frequency points is used as the target frequency point. If the absolute value of the amplitude difference is smaller than the correction error, the absolute values of the amplitude differences of the n frequency points are smaller than the correction error, namely the frequency response curve of the sound system is close to the reference frequency response curve, and correction of the frequency response curve is not needed. In other words, in the case where the target frequency point does not exist among the n frequency points, the frequency response correction process ends. The computer equipment determines the parameters of the equalizer corresponding to each target frequency point determined in the frequency response correction process as the parameters of the equalizer.
In a substep 336, parameters of the equalizer are determined based on the target frequency bin.
Optionally, in the case that one target frequency point exists in the n frequency points, the computer device determines the parameters of the equalizer according to the one target frequency point. And according to the parameters of the equalizer determined by the target frequency point, adjusting the loudness of the corresponding frequency band of the target frequency point in the frequency response curve to be corrected. For example, the computer device determines a frequency point, of the n frequency points, where the absolute value of the amplitude difference is the largest and the absolute value of the amplitude difference is greater than or equal to the correction error, as a target frequency point, and then, the computer device determines a parameter of the equalizer based on the target frequency point.
Optionally, under the condition that a plurality of target frequency points are determined from n frequency points, the computer equipment determines parameters of equalizers corresponding to the f target frequency points respectively at one time, and f is a positive integer smaller than the total number of the target frequency points. Illustratively, the computer device determines f target bins from the plurality of target bins according to a third threshold, in which case the value of f is associated with the third threshold and the value of f is associated with the plurality of target bins. For example, a frequency span between any two of the f target frequency bins is greater than or equal to a third threshold. The computer device then determines parameters of the equalizer based on the f target frequency points. In this case, parameters of the equalizer include parameters corresponding to each of the f target frequency points.
For unselected target frequency points in the plurality of target frequency points, the computer device needs to generate updated first frequency response data according to the equalizer parameters determined at this time, and determine whether the unselected target frequency points can be used as target frequency points according to the updated first frequency response data, and for specific content of the process, please refer to the following embodiments.
Because the equalizer can influence the frequency band including the target frequency point when the equalizer gains the target frequency point, the target frequency point with larger frequency span is selected, on one hand, the method is beneficial to avoiding that the determined equalizer parameter repeatedly gains the frequency band including a certain target frequency point, so that the frequency response curve of the frequency band including the target frequency point cannot be close to the reference curve after the frequency response correction, and the method is beneficial to improving the accuracy of the frequency response correction process. On the other hand, for two target frequency points with smaller frequency span, the parameters of the equalizer are determined according to one frequency point of the two target frequency points, so that the determined parameters of the equalizer can also influence the frequency response curve of the other target frequency point of the two frequency points, and the frequency response curve of the frequency band where the other target frequency point is positioned can be close to the reference frequency response curve, thereby reducing the times of determining the parameters of the equalizer and being beneficial to improving the efficiency of frequency response correction.
Optionally, in the case that a plurality of target frequency points are determined from the n frequency points, the computer device selects one target frequency point from the plurality of target frequency points, and determines the parameters of the equalizer according to the target frequency point. The computer device uses the determined equalizer parameters to adjust the frequency response curve to be corrected to obtain a corrected frequency response curve, and re-executes from step 320 based on the updated first frequency response data corresponding to the corrected frequency response curve until the target frequency point cannot be determined in sub-step 324, for details of this step, please refer to the following embodiments.
According to the method, based on the frequency points with the amplitude difference larger than or equal to the correction error, the parameters of the equalizer are determined, so that the frequency response curve of the frequency band corresponding to the frequency points can be corrected through the equalizer, the corrected frequency response curve of the frequency band is close to the curve part corresponding to the frequency band in the reference frequency response curve, and automatic frequency response correction is realized. No complex calculations are involved in this embodiment, and the determination helps to efficiently accomplish the frequency response correction.
The process of determining parameters of the equalizer based on the target frequency point is described in several embodiments.
In some embodiments, the equalizer parameters include a center frequency, which refers to the frequency center point to be corrected, a gain amount, which refers to the amplitude variation at the center frequency after frequency response correction, and a quality factor, which characterizes the bandwidth of the impact of the gain amount on the surrounding frequencies of the center frequency.
In step 336, parameters of the equalizer are determined according to the target frequency point, including determining a center frequency according to the target frequency point, determining a gain amount according to an amplitude difference of the target frequency point, and determining a quality factor according to the center frequency and a bandwidth of a frequency response curve, wherein the bandwidth of the frequency response curve is used for representing a frequency span in which an amplitude value of the center frequency is attenuated to be half in the frequency response curve to be corrected.
Alternatively, the center frequency is also referred to as a center frequency point. Illustratively, the computer device determines the target frequency point as the center frequency.
Optionally, the gain is used to adjust the amplitude value of the center frequency, and the adjusted amplitude value of the center frequency is equal to the adjusted amplitude value of the center frequency plus the gain. The gain amount and the amplitude difference of the target frequency point are in positive correlation. That is, the larger the amplitude difference of the target frequency point is, the larger the gain amount is, and the smaller the amplitude difference of the target frequency point is, the smaller the gain amount is. Illustratively, the computer device takes the difference in the magnitudes of the target frequency points as the gain amount.
In some embodiments, the bandwidth of the frequency response curve refers to a frequency band of the frequency response curve to be corrected that includes the center frequency. 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, where the cutoff frequency refers to the signal frequency attenuated by half at the loudness of the center frequency in the frequency response curve to be corrected.
In some embodiments, the figure of merit is positively correlated with the center frequency and the figure of merit is negatively correlated with the bandwidth of the frequency response curve. Optionally, the quality factor is equal to the ratio of the center frequency to the bandwidth of the frequency response curve. Illustratively, the larger the value of the figure of merit, the smaller the effect of the gain amount on the frequency band around the center frequency, and the smaller the value of the figure of merit, the larger the effect of the gain amount on the frequency band around the center frequency.
In the embodiment of the application, the parameters of the equalizer of the passband frequency band to which the target frequency belongs can be rapidly determined in a simpler mode, so that the equalizer corrects the frequency response curve of the sound system according to the parameters, and the corrected frequency response curve is beneficial to reducing the difference between the corrected frequency response curve and the partial frequency response curve of the passband frequency band corresponding to the reference frequency response curve.
The method for determining the bandwidth of the frequency response curve is described in the following by means of several embodiments. The method is implemented by computer equipment.
In some embodiments, the frequency response correction method further includes determining a first frequency and a second frequency corresponding to the center frequency, the first frequency being a frequency point corresponding to half of an amplitude value of the center frequency in a decreasing frequency direction, the second frequency being a frequency point corresponding to half of an 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, and determining a bandwidth of the frequency response curve according to a target frequency bandwidth, the target frequency bandwidth being smaller values of the first frequency bandwidth and the second frequency bandwidth.
Optionally, the first frequency refers to a lower cut-off frequency, the second frequency refers to an upper cut-off frequency, the first frequency is less than the center frequency, and the second frequency is greater than the center frequency.
In some embodiments, the computer device determines the bandwidth of the frequency response curve from 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=fh-fl, where fl represents the first frequency and fh represents the second frequency.
Since the frequency response curve to be corrected may not be symmetrical on both sides of the center frequency, in order to improve accuracy of the bandwidth of the determined frequency response curve, the computer device determines the bandwidth of the frequency response curve according to the frequency bandwidth. The computer device illustratively has a difference between the center frequency and the first frequency as a first frequency bandwidth, a difference between the second frequency and the center frequency as a second frequency bandwidth, the computer device determines a bandwidth of the frequency response curve based on the first frequency bandwidth and the second frequency bandwidth.
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 according to the target frequency. The computer device determines the target frequency bandwidth from a smaller value of the first frequency bandwidth and the second frequency bandwidth, and the computer device determines twice the target frequency bandwidth as the bandwidth of the frequency response curve.
In this case, the bandwidth of the frequency response curve is calculated by the formula w=2×min (fh-fc,fc-fl), where w represents the bandwidth of the frequency response curve, min (fh-fc,fc-fl) represents a smaller value determined from fh-fc,fc-fl, fl represents a first frequency, fh represents a second frequency, and fc represents a center frequency.
The smaller frequency bandwidth of the cut-off frequency and the center frequency is selected as the target bandwidth, so that the frequency band width corresponding to the determined frequency response curve bandwidth is facilitated, and the influence of other frequency bands except the passband frequency band of the center frequency in the frequency response curve to be corrected of the equalizer parameter is facilitated to be reduced. This approach helps to reduce repetitive correction for certain passband bands and helps to speed up the efficiency of frequency response correction.
The following describes, by way of an example, a process of determining parameters of an equalizer corresponding to a target frequency point. The execution main body of the embodiment is a computer device, and the embodiment mainly includes the following steps:
And step A10, acquiring first frequency response data. Optionally, the computer device obtains first frequency response data recorded by the sound system in the process of playing the test audio through the radio device. The radio reception device transmits the first frequency response data to the computer device via a wired or wireless network. The type of the first frequency response data may be a PCM file.
Optionally, after the frequency response correction is started, the computer device also needs to acquire second frequency response data. The second frequency response data may be user-defined or preset. For example, the second frequency response data is used to characterize a smooth frequency response curve. The second frequency response data may be of the same type as the first frequency response data or of a different type from the first frequency response data.
For example, in the case that the type of 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 in this step is similar to the first spectrum data acquisition method, and will not be described here.
For example, in case the second spectral data is preset, the second spectral data may be stored in the computer device to reduce unnecessary computation.
And step A20, carrying out Fourier transform on the first frequency response data to obtain initial frequency spectrum data.
Optionally, the computer device performs a fast fourier transform on the first frequency response data based on the kissfft open source program to obtain the initial spectrum data. The initial frequency spectrum data comprises at least one frequency point and amplitude values corresponding to the frequency points respectively.
And step A30, performing smoothing processing on the initial spectrum data to obtain gentle spectrum data.
And step A40, carrying out interpolation processing on the gentle spectrum data based on the second spectrum data to obtain the first spectrum data.
It should be noted that, the step a30 and the step a40 are optional execution steps. For example, after the computer device performs step a20, the initial spectrum data may be directly taken as the first spectrum data. For another example, in the case where the number of points of the initial spectrum data and the second spectrum data is the same, the computer device may not perform step a40. I.e. the flat spectral data determined in step a30 is taken as first spectral data.
For another example, the computer device may not perform step a30. That is, after step a20 is performed, step a40 is directly performed, and interpolation processing is performed on the initial spectrum data based on the second spectrum data, to obtain the first spectrum data.
Alternatively, the execution order between the step a30 and the step a40 may be exchanged, and the present application is not limited to the execution order of the step a30 and the step a 40.
And step A50, calculating the difference value between the first amplitude value of the frequency point and the second amplitude value of the frequency point for each frequency point in the n frequency points to obtain the amplitude difference of the frequency point, and determining the target frequency point from the n frequency points according to the amplitude difference of the n frequency points.
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 m frequency points included in the first spectrum data.
Illustratively, the amplitude difference of the frequency bins is equal to the first amplitude value minus the second amplitude value.
And step A60, determining the center frequency according to the target frequency point, and determining the gain according to the amplitude difference of the target frequency point. The computer device determines the target frequency point as a center frequency, and the amplitude difference of the target frequency point as a gain amount.
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, calculating a second frequency bandwidth between the second frequency and the center frequency, and determining the bandwidth of the frequency response curve according to the target frequency bandwidth.
Alternatively, the bandwidth calculation formula of the frequency response curve is w=2×min (fh-fc,fc-fl). For the explanation of each parameter in the formula, please refer to the above embodiment, and the description is omitted here.
Step A80, determining the quality factor according to the center frequency and the bandwidth of the frequency response curve.
Alternatively, the figure of merit is calculated by q=fc/w, where q represents the figure of merit, fc represents the center frequency, and w represents the bandwidth of the frequency response curve.
The embodiment of the application can automatically determine the parameters of the equalizer, even users who do not know tuning can quickly correct the frequency response curve of the sound system, greatly reduce the labor cost and the debugging period, and is beneficial to improving the production efficiency.
Fig. 4 is a schematic diagram of a frequency response correction method according to another embodiment of the application. By way of example, the subject of execution of the method may be the computer device 10 in the implementation environment of the scheme shown in fig. 1. As shown in fig. 4, the method may include at least one of the following steps (310-370):
in step 310, first frequency response data is obtained, where the first frequency response data is used to characterize a frequency response curve to be corrected.
Step 320, performing time-frequency conversion on the first frequency response data to obtain first frequency spectrum data.
Step 330, determining parameters of the equalizer according to the first spectrum data and the second spectrum data.
For details of steps 310, 320 and 330, please refer to the above embodiments, and the details are not described here. In the case of a large difference between the source frequency response curve and the reference frequency response curve, equalizer parameters corresponding to the frequency bands respectively need to be determined so that the corrected frequency response curve can approach the reference frequency response curve in each frequency band. In one possible embodiment, this is achieved by performing at least steps 320 and 330 in a loop.
The execution and stop conditions of the cyclic process are described in the following by several examples.
Step 340, generating third frequency response data according to the parameters of the equalizer, wherein the third frequency response data is used for reflecting the frequency response curve of the equalizer.
In some embodiments, the third frequency response data is generated by a computer device based on a simulation of parameters of the equalizer. Compared with directly acting the parameters of the equalizer on the equalizer in the sound system, re-recording and acquiring updated first audio data, the frequency response curve of the equalizer is simulated in the computer equipment, so that the efficiency of frequency response correction is improved.
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 for characterizing a frequency response curve of the equalizer, and as can be seen from the above, the type of the third frequency response data includes at least one of a spectrum TXT file, a PCM file, and the like.
For the generation process of generating the third frequency response data, please refer to the following embodiments.
And 350, superposing the third frequency response data and the first frequency response data to generate updated first frequency response data.
Since the third frequency response data is used for characterizing the frequency response curve of the equalizer, and the first frequency response data is used for characterizing the frequency response curve to be corrected, step 350 is used for adding the frequency response curve to be corrected and the frequency response curve of the equalizer, so as to obtain the updated frequency response curve to be corrected.
The computer device superimposes the third frequency response data and the first frequency response data to generate updated first frequency response data, wherein the computer device acquires a first sub-frequency response curve of any frequency band from the first frequency response data, acquires a second sub-frequency response curve of the frequency band from the third frequency response data, and superimposes the first sub-frequency response curve and the second sub-frequency response curve in the loudness direction to obtain an updated sub-frequency response curve of the frequency band. And splicing the sub-frequency response curves according to the frequency direction to obtain an updated frequency response curve to be corrected, namely obtaining updated first frequency response data.
That is, in this step, the computer device superimposes the frequency response curve of the equalizer and the frequency response curve to be corrected, resulting in an updated frequency response curve to be corrected.
Step 360, determining updated first frequency spectrum data according to the updated first frequency spectrum data.
This step is similar to step 320, and please refer to the above embodiment, and detailed description is omitted here.
And step 370, in the case that the amplitude difference between the updated first spectrum data and the second spectrum data satisfies the correction condition, the step of determining the parameters of the equalizer according to the first spectrum data and the second spectrum data is performed again with the updated first spectrum data as the first spectrum data.
The correction condition is used to determine whether to continue the frequency response correction process. Optionally, the correction condition is related to a difference between the updated first spectral data and the second spectral data.
The updated first spectrum data and the second spectrum data each include n frequency points and n frequency points corresponding to amplitude values respectively, and the correction condition is that at least one frequency point to be corrected exists in the n frequency points, and an absolute value of a 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 a correction error. For the correction error, the first amplitude value and the second amplitude value, please refer to the above embodiments, and the description thereof is omitted.
After determining the updated first spectral data, the computer device determines parameters of the equalizer based on the updated first spectral data and the second spectral data. Optionally, the equalizer parameters determined in step 330 and step 370 are used to gain different frequency bands.
In some embodiments, the computer device again performs the step of determining parameters of the equalizer based on the first spectral data and the second spectral data, including, for each of the n frequency bins, calculating a difference between a first amplitude value of the frequency bin and a second amplitude value of the frequency bin, resulting in an amplitude difference of the frequency bin, and determining a target frequency bin from the n frequency bins based on the amplitude differences of the n frequency bins. For the specific process of this step, please refer to the above embodiment, and a detailed description is omitted here.
And determining parameters of the equalizer according to the target frequency point. Alternatively, in the case where the target frequency point is not included in the n frequency points, it is indicated that the frequency response correction is not necessary. That is, the current cyclic process has not satisfied the correction condition. In this case, the equalizer parameters determined according to the target frequency point in each cycle completed by the computer device are summarized to obtain the parameters of the total equalizer. The computer device transmits the parameters of the total equalizer to the equalizer, so that the equalizer generates a gain curve of the equalizer according to the parameters of the total equalizer before the parameters are played by the playing device, the frequency response curve of the sound system is changed, and the effect of improving the tone of the sound system is obtained.
Next, description will be made of a method for generating third frequency response data by several embodiments, and an execution subject of this embodiment is a computer device.
In some embodiments, the equalizer parameters include a center frequency, which refers to the frequency center point to be corrected, a gain amount, which refers to the amplitude variation at the center frequency after frequency response correction, and a quality factor, which characterizes the bandwidth of the impact of the gain amount on the surrounding frequencies of the center frequency. For details of the equalizer parameters, please refer to the above embodiments, and detailed descriptions thereof are omitted herein.
In some embodiments, step 340, generating third frequency response data according to parameters of the equalizer, may include the following sub-steps.
In a sub-step 342, ratio processing is performed according to the center frequency and the sampling frequency, and the first parameter is determined, where the sampling frequency is related to the number of frequency points included in the first spectrum data.
In a substep 344, the first constant is exponentially processed according to the gain to determine the second parameter.
In a substep 346, a ratio process is performed based on the first parameter and the figure of merit to determine a third parameter.
In a substep 348, third frequency response data is generated based on the first parameter, the second parameter, and the third parameter.
Optionally, the first parameter has a positive correlation with the center frequency, and the first parameter has a negative correlation with the sampling frequency. The first parameter is calculated by the following formula w0=2.0 pi×fc/fs, where W0 represents the first parameter, fc represents the center frequency, and fs represents the sampling frequency.
Optionally, the second parameter has a positive correlation with the gain amount. The second parameter is illustratively calculated by the formula a=pow (10.0, gain/40.0), where a represents the second parameter, gain represents the gain amount, pow (10.0, gain/40.0) represents gain/40.0 to the power of 10.
Optionally, the third parameter has a positive correlation with the first parameter, and the third parameter has a negative correlation with the quality factor. Illustratively, the first parameter is calculated by the formula alpha=sin (w 0)/(2.0×q), where alpha represents the third parameter, w0 represents the first parameter, and q represents the figure of merit.
In some embodiments, sub-step 348 generates third frequency response data based on the first parameter, the second parameter, and the third parameter, including the computer device generating filter coefficients of the equalizer based on the first parameter, the second parameter, and the third parameter, the filter coefficients being used to control a filter in the equalizer to affect a 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.
In some embodiments, the equalizer includes a plurality of filters, different filters being used to gain the frequency response curves for different frequency bands. That is, during the actual operation of the equalizer, the filter in the equalizer generates the frequency response curves of the equalizer corresponding to different frequency bands, so as to gain the source frequency response curve of the playback device, thereby changing the audio playback effect of the sound system.
Exemplary types of filters include, but are not limited to, at least one of FIR (Finite Impulse Respond, finite Impulse response) digital filters, IIR (Infinite Impulse Response ) filters, and the like. The type of filter included in the equalizer is related to the actual situation of the sound system, and the present application is not limited herein.
The method of generating the third frequency response data from the parametric simulation of the equalizer is not exactly the same for different types of filters. Next, a method of generating third frequency response data will be described taking as an example an IIR digital filter as an example a filter included in the equalizer.
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.
The first filter coefficient and the first parameter are in positive correlation and negative correlation, the second filter coefficient and the first parameter are in positive correlation and positive correlation, the fifth filter coefficient and the first parameter are in negative correlation and positive correlation, and the sixth filter coefficient and the first parameter are in negative correlation and negative correlation.
The first filter coefficient is illustratively calculated by the following formula a0=1.0+alpha/A, where a0 represents the first filter coefficient, alpha represents the first parameter, and A represents the second parameter.
The calculation formula of the second filter coefficient is shown in the following example, b0=1.0+alpha×a, where b0 represents the second filter coefficient, and other parameters are referred to in the above embodiment.
The third filter coefficient is calculated by a formula of a1= -2.0 x cos (w 0), where a1 represents the third filter coefficient and w0 represents the third parameter.
For example, the fourth filter coefficient is calculated by the following formula b1= -2.0 x cos (w 0), wherein b1 represents the fourth filter coefficient, and other parameters are referred to in the above embodiments.
The calculation formula of the fifth filter coefficient is shown as follows, wherein a2=1.0-alpha/A, a2 represents the fifth filter coefficient, and other parameters are referred to in the above embodiments.
The sixth filter coefficient is calculated by the following formula b2=1.0-alpha, wherein b2 represents the sixth filter coefficient, and other parameters are described in the above embodiments.
Optionally, the transfer function of the filter is calculated by 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. Illustratively, the transfer function H (z) of the filter is calculated as follows:
optionally, the computer device generates the third frequency response data according to a transfer function of the filter.
For example, the computer device generates third frequency response data with reference to the freqz functions of matlab.
Fig. 5 shows a schematic diagram of a frequency response correction procedure provided by an exemplary embodiment of the present application. The frequency response correction process is described below by way of one example in connection with fig. 5. The execution subject of this example is a computer device, and this example may include the following steps.
And step B10, acquiring correction parameters, wherein the correction parameters comprise various parameters required to be used in the correction process. Optionally, the correction parameters include, but are not limited to, at least one of correction errors, number of equalizer segments in the sound system to be corrected, frequency interval to be corrected, reference level. The number of segments of the equalizer is used for characterizing which frequency bands the equalizer can gain, and the interval to be corrected is used for indicating frequency response curves of the sound system to be corrected on which frequency bands. The interval to be corrected may be, for example, 150-5000kHz.
And step B20-a, acquiring first frequency response data. The computer device illustratively imports the first frequency response data from outside. For the description of the first frequency response data, please refer to the above embodiment, and the description is omitted herein.
And step B20-B, obtaining second frequency response data. The present application is not limited to the execution sequence of the steps B20-a and B20-B.
And step B30-a, determining first frequency spectrum data according to the first frequency response data. Optionally, the computer device reads the first spectrum data from the first spectrum data when the first spectrum data is the spectrum TXT, and performs operations such as fast fourier transform on the PCM file when the first spectrum data is the PCM file to obtain the first spectrum data. Please refer to the above embodiments for specific details.
And step B30-B, determining second frequency spectrum data according to 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 here.
And B40, the first frequency spectrum data comprise n frequency points and a first amplitude value of each frequency point, the second frequency spectrum data comprise n frequency points and a second amplitude value of each frequency point, and for each frequency point in the n frequency points, a difference value between the first amplitude value of the frequency point and the second amplitude value of the frequency point is calculated to obtain an amplitude difference of the frequency point.
And step B50, determining a target frequency point from the n frequency points according to the amplitude differences of the n frequency points, wherein the target frequency point refers to the frequency point with the amplitude difference larger than or equal to the correction error. Alternatively, this step may be understood as selecting the amplitude difference having the largest absolute value from among the amplitude differences of the n frequency points, and determining the amplitude difference as the target amplitude difference. The frequency point corresponding to the target amplitude difference is the target frequency point.
And step B60, determining parameters of the equalizer according to the target frequency point. For details of this step, please refer to the above embodiments, and detailed descriptions thereof are omitted herein.
And step B70, generating third frequency response data according to the parameters of the equalizer, wherein the third frequency response data is used for reflecting the frequency response curve of the equalizer.
And step B80, overlapping the third frequency response data and the first frequency response data to generate updated first frequency response data.
And step B90, when the amplitude difference between the updated first spectrum data and the second spectrum data meets the correction condition, taking the updated first spectrum data as the first spectrum data, and executing the step of determining the parameters of the equalizer according to the first spectrum data and the second spectrum data again.
Optionally, after generating the updated first spectrum data, the computer device recalculates the amplitude differences of the n frequency bins and selects the amplitude difference with the largest absolute value from the amplitude differences of the n frequency bins. If the absolute value of the selected amplitude difference is greater than or equal to the correction error, the frequency point corresponding to the selected amplitude difference is determined as the target frequency point, and then the computer device performs step B60 to determine the equalizer parameters related to the target frequency point. The parameters of the equalizer related to the target frequency point are used for gain in the frequency band where the target frequency point is located in the frequency response curve to be corrected.
If the absolute value of the selected amplitude difference is less than the correction error, the frequency response correction process ends. The computer device uses the determined equalizer parameters as the overall equalizer parameters in the process of executing step B60-step B90, and transmits the equalizer parameters to the sound system.
The embodiment of the application automatically realizes the frequency response correction, greatly reduces the labor cost and the debugging period required in the frequency response correction process, and is beneficial to improving the production efficiency.
Fig. 6 shows a block diagram of a frequency response correction apparatus provided by an exemplary embodiment of the present application. The apparatus may be implemented as all or part of a computer device by software, hardware, or a combination of both. The apparatus 600 may include a data acquisition module 610, a spectrum determination module 620, and a parameter determination module 630.
The data acquisition module 610 is configured to acquire first frequency response data, where the first frequency response data is used to characterize a frequency response curve to be corrected, and the frequency response curve is used to reflect a trend of loudness along with frequency variation.
The spectrum determining 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 an attribute of the frequency response curve to be corrected in a frequency direction.
A parameter determining module 630, configured to determine parameters of an equalizer according to the first spectrum data and second spectrum data, where the second spectrum data is determined according to second frequency response data, the second frequency response data is used to characterize a reference frequency response curve used for frequency response correction, and the equalizer is configured to control the frequency response curve to be corrected to approach the reference frequency response curve based on the parameters.
In some embodiments, the first spectrum data comprises n frequency points and a first amplitude value of each frequency point, the second spectrum data comprises n frequency points and a second amplitude value of each frequency point, n is a positive integer, the parameter determining module 630 comprises an amplitude difference calculating unit, a parameter determining unit and a parameter determining unit, wherein the amplitude difference calculating unit is used for calculating a difference value between the first amplitude value of each frequency point and the second amplitude value of each frequency point to obtain the amplitude difference of the frequency point, the frequency point meter determining unit is used for determining a target frequency point from the n frequency points according to the amplitude difference of the n frequency points, and the target frequency point is a frequency point with the amplitude difference being larger than or equal to a correction error, and the parameter determining unit is used for determining the parameter of the equalizer according to the target frequency point.
In some embodiments, the parameters of the equalizer comprise a center frequency, a gain amount and a quality factor, wherein the center frequency refers to a frequency center point to be corrected, the gain amount refers to amplitude variation at the center frequency after frequency response correction, the quality factor is used for representing the influence bandwidth of the gain amount on surrounding frequencies of the center frequency, the parameter determining unit is used for determining the center frequency according to the target frequency point, the gain amount is determined according to the amplitude difference of the target frequency point, the quality factor is determined according to the center frequency and the bandwidth of the frequency response curve, the bandwidth of the frequency response curve is used for representing the frequency span in which the amplitude value of the center frequency is attenuated to be half.
In some embodiments, the figure of merit is positively correlated with the center frequency and the figure of merit is negatively correlated with the bandwidth of the frequency response curve.
In some embodiments, the apparatus 600 further comprises a bandwidth determining module configured to determine a first frequency and a second frequency corresponding to the center frequency, the first frequency being a frequency bin corresponding to half of an amplitude value of the center frequency in a decreasing frequency direction, the second frequency being a frequency bin corresponding to half of an amplitude value of the center frequency in an increasing frequency 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 a bandwidth of the frequency response curve according to a target frequency bandwidth, the target frequency bandwidth being a smaller value of the first frequency bandwidth and the second frequency bandwidth.
In some embodiments, the device further comprises a frequency response generating module, a data superposition module, a spectrum updating module and a circulation executing module, wherein the frequency response generating module is used for generating third frequency response data according to parameters of the equalizer, the third frequency response data is used for reflecting a frequency response curve of the equalizer, the data superposition module is used for superposing the third frequency response data and the first frequency response data to generate updated first frequency response data, the spectrum updating module is used for determining the updated first frequency response data according to the updated first frequency response data, and the circulation executing module is used for executing the steps of determining parameters of the equalizer according to the first frequency response data and the second frequency response data again by taking the updated first frequency response data as the first frequency response data under the condition that an amplitude difference between the updated first frequency response data and the second frequency response data meets a correction condition.
In some embodiments, the equalizer comprises a center frequency, a gain amount and a quality factor, wherein the center frequency refers to a frequency center point to be corrected, the gain amount refers to amplitude change at the center frequency after frequency response correction, the quality factor is used for representing influence bandwidth of the gain amount on surrounding frequencies of the center frequency, the frequency response generation module comprises a parameter determination unit used for carrying out ratio processing according to the center frequency and a sampling frequency, determining a first parameter, wherein the sampling frequency is related to frequency points included in the first frequency spectrum data, carrying out exponential processing according to the gain amount, determining a second parameter, carrying out ratio processing according to the first parameter and the quality factor, and determining a third parameter, and the data calculation unit is used for generating the third frequency response data according to the first parameter, the second parameter and the third parameter.
In some embodiments, the data calculation unit is configured to generate a filter coefficient of the equalizer according to the first parameter, the second parameter, and the third parameter, where the filter coefficient is used to control a filter in the equalizer to affect the frequency response curve to be corrected, and perform frequency response processing based on the filter coefficient to obtain the third frequency response data.
In some embodiments, the spectrum generating 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 flat spectrum data, and perform interpolation on the flat spectrum data based on the second spectrum data to determine the first spectrum data.
It should be noted that, in the apparatus provided in the foregoing embodiment, when implementing the functions thereof, only the division of the foregoing functional modules is used as an example, in practical application, the foregoing functional allocation may be implemented by different functional modules, that is, the content structure of the device is divided into different functional modules, so as to implement all or part of the functions described above. In addition, the embodiments of the apparatus and the method provided in the foregoing embodiments belong to the same concept, and the specific implementation process is detailed in the method-side embodiment, which is not described herein again. The beneficial effects of the device provided in the foregoing embodiments are described with reference to the method side embodiments, and are not repeated herein.
Fig. 7 shows a block diagram of a computer device according to an exemplary embodiment of the present application.
In general, computer device 700 includes a processor 701 and a memory 702.
Processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 701 may be implemented in at least one hardware form of DSP (DIGITAL SIGNAL Processing), FPGA (Field Programmable GATE ARRAY ), PLA (Programmable Logic Array, programmable logic array). The processor 701 may also include a main processor, which is a processor for processing data in a wake-up state, also referred to as a CPU (Central Processing Unit ), and a coprocessor, which is a low-power processor for processing data in a standby state. In some embodiments, the processor 701 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 701 may also include an AI (ARTIFICIAL INTELLIGENCE ) processor for processing computing operations related to machine learning.
Memory 702 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 702 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 702 stores a computer program that is loaded and executed by processor 701 to implement the frequency response correction method provided by the method embodiments described above.
The embodiment of the application also provides a computer readable storage medium, and the storage medium stores a computer program, and the computer program is loaded and executed by a processor to realize the frequency response correction method provided by each method embodiment or realize the training method of the frequency response correction model provided by each method embodiment.
The computer readable medium may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes 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 Memory technology, CD-ROM, DVD (Digital Video Disc, high density digital video disc) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage medium is not limited to the ones described above.
Embodiments of the present application also provide a computer program product, where the computer program product includes computer instructions stored in a computer readable storage medium, and a processor reads and executes the computer instructions from the computer readable storage medium to implement the frequency response correction method provided in the foregoing method embodiments.
It should be understood that references herein to "a plurality" are to two or more. "and/or" describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate that there are three cases of a alone, a and B together, and B alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
The foregoing description of the preferred embodiments of the application is not intended to limit the application to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and principles of the application are intended to be included within the scope of the application.