Audio compression method and device
By adding a spectrum compensation filter before the dynamic range compressor of the audio signal, the problem of distortion during the compression process is solved, the audio playback quality is improved, and the gain in the high volume band is not reduced.
Patent Information
- Application Number
- CN202410983822.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-07-22
AI Technical Summary
Existing audio signals are prone to distortion during dynamic range compression, especially when the low frequency gain is reduced at high volumes, which affects the audibility, and audio signals of different amplitudes are difficult to effectively compress to the same dynamic range.
Add a spectrum compensation filter before the dynamic range compressor (DRC), and filter the audio signal in the distorted frequency band to make its spectrum smoother, and then calculate the compression coefficient and perform compression processing, so as not to reduce the gain of the large volume band In the case, expand the compression range and reduce distortion.
It effectively reduces the distortion of the audio signal during playback, improves the audio playback quality, ensures that the gain in the high volume frequency band does not significantly reduce, and at the same time expands the compression range.
Smart Images

Figure CN119007736A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of audio processing technology, and in particular, relates to an audio compression method and device. Background Art
[0002] The Dynamic Range Compressor (DRC) is the core audio processor in audio playback devices (such as headphones, speakers, mobile phones, etc.), which is used to compress the dynamic range of the audio signal to be played (i.e., the logarithm of the ratio of the maximum amplitude and the minimum amplitude of the audio signal) to a specified dynamic range. That is, when the volume (i.e., loudness) is high, the signal amplitude is attenuated to a threshold (the compression coefficient set in the DRC), and when the volume is low, the signal amplitude is appropriately increased to balance the volume of the audio signal, so as to reduce the dynamic range of the audio signal to control the peak value of the audio signal not to exceed the acoustic output threshold of the audio playback device (i.e., the maximum digital signal output supported by the hardware of the audio playback device in the corresponding frequency band). In this way, the audio signal output by the audio playback device can better adapt to the playback environment and improve audibility, while avoiding excessive volume differences in the audio signal and protecting the audio playback device from damage.
[0003] However, the amplitudes of different audio signals are not the same. When audio signals of different amplitudes are compressed to the same dynamic range, although the peak of the audio signal with a large amplitude is compressed within the acoustic output threshold, the amplitude of some frequency bands still exceeds the acoustic output threshold and cannot be adjusted, resulting in distortion of these frequency bands. If the compression range is simply expanded and the amplitude of the audio signal is reduced, the low-frequency gain will be reduced at high volume, which may also cause distortion and affect audibility. Summary of the invention
[0004] The present application provides an audio compression method and device, which can reduce the distortion of audio signals during playback and improve the playback quality.
[0005] In a first aspect, the present application provides an audio compression method, applied to an audio playback device, the method comprising:
[0006] Acquire a first audio signal to be processed;
[0007] Applying a spectrum compensation filter to the first audio signal for filtering based on a preset target spectrum to obtain a second audio signal, wherein the target spectrum is related to a distortion frequency band of the audio playback device;
[0008] Processing the second audio signal by a preset dynamic range compressor DRC to obtain a compression coefficient;
[0009] According to the compression coefficient, a compressed signal is output.
[0010] In a possible implementation manner, obtaining the first audio signal to be processed includes:
[0011] Obtaining the original audio signal to be played;
[0012] Input the original audio signal to be played into a sound effect processing module for processing to obtain a third audio signal, wherein the third audio signal is used as the first audio signal, and the sound effect processing module includes at least one sound effect processor;
[0013] Outputting a compressed signal according to the compression coefficient comprises:
[0014] The third audio signal is compressed according to the compression coefficient, and the compressed signal is output.
[0015] In a possible implementation manner, a method for acquiring the target spectrum and the spectrum compensation filter includes:
[0016] Turning off the audio compensation filter and, after debugging the sound effect processing module, detecting the distortion frequency band of the audio playback device;
[0017] Determining the target spectrum according to the distorted frequency band;
[0018] The spectrum compensation filter is obtained by debugging according to the target spectrum.
[0019] In a possible implementation manner, a method for acquiring the target spectrum and the spectrum compensation filter includes:
[0020] Turning off the audio compensation filter and, after debugging the sound effect processing module, detecting the acoustic output threshold curve of the audio playback device;
[0021] Determining a compression curve based on a difference between an acoustic output threshold curve and a frequency response curve of an audio signal output by the sound effect processing module;
[0022] Determining the target spectrum according to the compression curve;
[0023] The spectrum compensation filter is obtained by debugging according to the target spectrum.
[0024] In a possible implementation manner, the first audio signal is an original audio signal to be played, or the first audio signal is an audio signal obtained by attenuating the original audio signal to be played according to a preset threshold.
[0025] In a possible implementation manner, outputting a compressed signal according to the compression coefficient includes:
[0026] compressing the original audio signal to be played according to the compression coefficient, and outputting the compressed signal;
[0027] The target spectrum and the spectrum compensation filter are obtained as follows:
[0028] Turning off the audio compensation filter and testing the acoustic output threshold curve of the audio playback device;
[0029] Determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging;
[0030] Determining the target spectrum according to the compression curve;
[0031] The spectrum compensation filter is obtained by debugging according to the target spectrum.
[0032] In a possible implementation manner, outputting a compressed signal according to the compression coefficient includes:
[0033] Inputting the original audio signal to be played into a sound effect processing module for processing to obtain a third audio signal, wherein the sound effect processing module includes at least one sound effect processor;
[0034] compressing the third audio signal according to the compression coefficient, and outputting the compressed signal;
[0035] The target spectrum and the spectrum compensation filter are obtained as follows:
[0036] After closing the audio compensation filter and the sound effect processing module, detecting an acoustic output threshold curve of the audio playback device;
[0037] Determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging;
[0038] Determining the target spectrum according to the compression curve;
[0039] The spectrum compensation filter is obtained by debugging according to the target spectrum.
[0040] In a possible implementation, determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging includes:
[0041] The compression curve is determined based on a difference between the acoustic output threshold curve and a frequency response curve of the original audio signal used for debugging.
[0042] In a possible implementation, determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging includes:
[0043] The compression curve is determined based on a difference between the acoustic output threshold curve and a frequency response curve of a fourth audio signal, wherein the fourth audio signal is an audio signal obtained by attenuating the original audio signal used for debugging according to the preset threshold.
[0044] In a possible implementation, the sound effect processing unit includes an equalizer.
[0045] In a possible implementation, the DRC is debugged as follows:
[0046] Parameter adjustment is performed according to the audio signal output by the audio compensation filter.
[0047] In a possible implementation manner, the spectrum compensation filter is an IIR filter or a FIR filter.
[0048] In a second aspect, the present application provides an audio playback device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in the first aspect or any possible implementation of the first aspect is implemented.
[0049] In a third aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in the first aspect or any possible implementation of the first aspect is implemented.
[0050] In a fourth aspect, the present application provides a computer program product, which, when executed by a processor, implements the method described in the first aspect or any possible implementation of the first aspect.
[0051] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the present application provides an audio compression method, which adds a spectrum compensation filter before DRC. That is, the amplitude of the audio signal in the corresponding area of the distortion frequency band is first filtered, so that the spectrum of the processed signal is the target spectrum, and the processed signal is input into the DRC to calculate the compression coefficient. When the compression coefficient is used to compress the audio signal to be output, the compression range can be expanded without significantly reducing the gain of the high-volume frequency band, thereby reducing the distortion during playback and improving the playback quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0053] Figure 1 A schematic diagram of a framework of an audio processing system in the related art;
[0054] Figures 2 to 5 It is a schematic diagram of the compression effect of the frequency response curve in the related art;
[0055] Figure 6 A flowchart of an audio compression method provided in an embodiment of the present application;
[0056] Figure 7 A schematic diagram of a framework of an audio processing system provided in one embodiment of the present application;
[0057] Figures 8 to 9 A schematic diagram of the compression effect of a frequency response curve provided in an embodiment of the present application;
[0058] Fig.10 A schematic diagram comparing a frequency response curve and an acoustic output threshold curve provided in an embodiment of the present application;
[0059] Fig.11 A schematic diagram of a compression curve provided in an embodiment of the present application;
[0060] Fig.12 A schematic diagram of a framework of an audio processing system provided by another embodiment of the present application;
[0061] Fig.13 A schematic diagram comparing a frequency response curve and an acoustic output threshold curve provided in another embodiment of the present application;
[0062] Fig.14 A schematic diagram of a compression curve provided by another embodiment of the present application;
[0063] Fig.15 A schematic diagram of a framework of an audio processing system provided by another embodiment of the present application;
[0064] Fig.16 A schematic diagram of the structure of an audio compression device provided in an embodiment of the present application;
[0065] Fig.17 A schematic diagram of the structure of an audio playback device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] As described in the background technology, audio playback devices generally adjust the dynamic range of audio signals through DRC to achieve loudness adjustment of audio signals. In related technologies, DRC is usually set after the sound effect processor. The sound effect processor is used to adjust the acoustic effect of the audio signal. Different sound effect processors can be used to obtain different playback effects.
[0067] For example, the audio effect processor may include but is not limited to an equalizer, a reverberator, a tone controller, a special effect device, etc. Among them, the equalizer (EQ) is a set of filters in the audio playback device, which is used to adjust the frequency response curve of the original audio signal so that the audio output by the audio playback device achieves the expected acoustic effect (such as bass enhancement, treble enhancement, noise reduction, etc.). The reverberator is used to make the audio output by the audio playback device have a spatial effect. The tone controller can change the timbre and / or pitch of the original audio signal to achieve the function of voice change.
[0068] Different audio playback devices have different acoustic structure designs, so the sound processors debugged based on the reference standards of the target acoustic effects are also different.
[0069] For example, Figure 1 The schematic diagram of a commonly used audio processing system architecture in the prior art is shown in FIG. The data obtained by processing the original audio signal by the equalizer (the audio signal output by the sound effect processor is referred to as the third audio signal in this application) is input into the DRC for processing to obtain the corresponding compression coefficient, and then the third audio signal is compressed by the compression coefficient, and finally the compressed signal is sent to the speaker for playback.
[0070] DRC includes pre-debugged compression parameters, for example, including but not limited to threshold, compression ratio, attack time, release time, etc. Based on the compression parameters, DRC can determine the compression amount corresponding to each frequency band of the third audio signal. For example, when the gain (in dBFs) of the third audio signal exceeds the threshold, DRC starts compression within the attack time, and attenuates the gain of the corresponding frequency band in the third audio signal to below the threshold according to the compression ratio, thereby determining the compression amount of the frequency band. Until the gain of the third audio signal is lower than the threshold, DRC releases the compression within the release time. The compression coefficient includes at least the compression amount corresponding to each frequency band in the third audio signal whose gain exceeds the threshold.
[0071] For example, Figure 2 As shown in FIG. 1 , assuming that the threshold value in the DRC is -5dBFs, curve a is the frequency response curve of the third audio signal (where the horizontal axis is frequency and the vertical axis is gain), where the gain corresponding to 45Hz to 80Hz exceeds -5dBFs. Then, after compressing the gain corresponding to 45Hz to 80Hz in the third audio signal based on the compression coefficient output by the DRC, the frequency response curve of the compressed signal 1 obtained is shown in curve b, where the gain corresponding to 45Hz to 80Hz in the compressed signal 1 is compressed to below -5dBFs. Figure 3As shown, assuming that the dotted line represents the acoustic output threshold curve of the audio playback device, then under ideal conditions, the gain of the compressed signal 1 obtained after the equalizer and DRC processing in each frequency band should not exceed the acoustic output threshold of the audio playback device.
[0072] However, since the compression parameters of DRC are fixed values obtained through debugging, it is difficult to meet the compression effect of a large number of audio signals with different amplitudes. In addition, since the maximum digital signal allowed to be output by the audio playback device fluctuates within the entire frequency band rather than being a fixed value, the acoustic output threshold often presents a curve with frequency changes (for example, Figure 3 The acoustic output threshold curve shown in Figure 1 is different from the threshold in DRC. Therefore, after a large-amplitude audio signal is compressed, the gain corresponding to each frequency band may not exceed the threshold in DRC, but the gain corresponding to some frequency bands still exceeds the acoustic output threshold, resulting in distortion during playback.
[0073] For example, Figure 4 As shown, compared with the original audio signal of the compressed signal 1, the larger amplitude audio signal is processed by the equalizer and DRC to obtain the compressed signal 2. Although the compressed signal 2 is in the high volume frequency band (such as Figure 4 The gain corresponding to the 45Hz~80Hz) shown in the figure is compressed to within the acoustic output threshold through DRC, but the adjacent frequency bands of the high-volume frequency band (for example, 35Hz, 100Hz) are not compressed because they do not exceed the DRC threshold. Therefore, they still exceed the acoustic output threshold corresponding to the audio playback device in the adjacent frequency band, resulting in distortion of the audio signal output in the adjacent frequency band.
[0074] In some schemes, a larger compression range is used to compress the gain of all frequency bands of the audio signal to within the acoustic output threshold. Figure 5 As shown in Figure 3, the DRC internal threshold is set to -6dBFs, and the larger audio signal is processed by the equalizer and DRC to obtain the compressed signal 3. It can be seen that compared with Figure 4 Although the gains of the compressed signals 2 and 3 shown in the figure do not exceed the corresponding acoustic output thresholds in all frequency bands, the gains of the high-volume frequency bands are significantly reduced, resulting in insufficient hearing and may also cause distortion in the high-volume frequency bands.
[0075] To this end, the present application provides an audio compression method that can expand the compression range without significantly reducing the gain of the high-volume frequency band, reduce distortion during playback, and improve playback quality.
[0076] See also Figure 6, is a flowchart of an audio compression method provided in an embodiment of the present application. The audio compression method is applied to an audio playback device, which may be a headset, a speaker, or any electronic device that can play audio or a video containing audio (e.g., a mobile phone, a computer, a tablet, a television, etc.). Figure 6 As shown, the audio compression method provided by the present application may include:
[0077] S601: Acquire a first audio signal to be processed.
[0078] The first audio signal may be a third audio signal output by the sound effect processor, or may be an original audio signal to be played, or may be a signal obtained by attenuating the original audio signal to be played.
[0079] S602: Apply a spectrum compensation filter to the first audio signal for filtering based on a preset target spectrum to obtain a second audio signal, where the target spectrum is related to a distortion frequency band of the audio playback device.
[0080] The present application adds a spectrum compensation filter before the DRC to filter the first audio signal to be input into the DRC for processing, and adjusts the amplitude of the first audio signal corresponding to the distortion frequency band of the audio playback device so that the spectrum of the adjusted second audio signal is the target spectrum.
[0081] The spectrum compensation filter may be any filter that can attenuate the amplitude of a digital signal, for example, an infinite impulse response (IIR) filter or a finite impulse response (FIR) filter.
[0082] The distortion frequency band of an audio playback device refers to the frequency range where distortion occurs when the audio playback device plays a swept frequency signal (i.e., a pure tone signal with the largest amplitude) at the maximum volume (i.e., the amplitude is 0dBFS). The filtering range of the spectrum compensation filter can be the same as the distortion frequency band, or include the distortion frequency band. Specifically, adaptive debugging can be performed according to the actual compression effect requirements.
[0083] In the embodiment of the present application, after the spectrum of the first audio signal is compensated by the spectrum compensation filter, the amplitude corresponding to the distortion frequency band in the first audio signal is compressed, that is, compared with the spectrum of the first audio signal, the waveform of the spectrum of the second audio signal in the distortion frequency band is smoother.
[0084] S603: Process the second audio signal using a preset DRC to obtain a compression coefficient.
[0085] In the embodiment of the present application, since a spectrum compensation filter is added before the DRC, the parameters in the DRC (such as threshold, compression rate, effective time, release time, etc.) are obtained by debugging the audio signal output by the spectrum compensation filter. Since the waveform of the audio signal processed by the spectrum compensation filter is smoother, the debugged DRC can obtain a larger compression range when calculating the compression coefficient corresponding to the second audio signal.
[0086] S604: Obtain an output compressed signal according to the compression coefficient.
[0087] In an embodiment of the present application, after the audio playback device obtains the compression coefficient corresponding to the second audio signal, it can compress the audio signal to be played to obtain a compressed signal. For example, when a sound effect processor is provided in the audio processing system of the audio playback device, the audio playback device can use the compression coefficient to compress the audio signal output by the sound effect processor to obtain a compressed signal. When there is no sound effect processor in the audio processing system, the audio playback device can use the compression coefficient to compress the original audio signal to be played to obtain a compressed signal. The obtained compressed signal will be sent to the speaker of the audio playback device for playback.
[0088] The audio compression method provided in the embodiment of the present application adds a spectrum compensation filter before the DRC, first performs spectrum compensation on the first audio signal, filters the amplitude of the first audio signal in the corresponding area of the distortion frequency band, inputs the processed signal into the DRC to calculate the compression coefficient, and uses the compression coefficient to compress the output audio signal. It can expand the compression range without significantly reducing the gain of the high-volume frequency band, reduce distortion during playback, and improve playback quality.
[0089] The following specific embodiments are used to exemplify the audio compression method provided by the present application. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0090] In addition, the DRC, sound effect processor, and filter in this article are concepts well known to those skilled in the art, and their parameter debugging methods and signal processing flows are also well known to those skilled in the art. Therefore, this application does not specifically give the specific debugging process and signal processing flow of the DRC, sound effect processor, and filter.
[0091] For an audio processing system including an audio effect processor, in one example, the spectrum compensation filter may be disposed between the audio effect processor and the DRC, and the first audio signal may be a third audio signal output by the audio effect processor.
[0092] For example, an audio processing system can Figure 7As shown, it includes an audio processing module, a spectrum compensation filter, a DRC and a compression module. The audio processing module includes at least one audio processor, such as an equalizer, a reverberator, a tone controller, a special effect device, etc.
[0093] After the original audio signal to be played is input into the audio processing system, it is first processed by the sound effect processing module to obtain the third audio signal. The third audio signal is respectively input into the compression module and the spectrum compensation filter. The spectrum compensation filter performs spectrum compensation on the third audio signal output by the sound effect processing module, and adjusts the amplitude of the third audio signal in the corresponding area of the distortion frequency band to obtain the second audio signal. The second audio signal is input into the DRC, and the compression coefficient corresponding to the second audio signal is calculated according to the parameters obtained in advance. The obtained compression coefficient is input into the compression module, and the compression module uses the compression coefficient to compress the third audio signal to be output to obtain a compressed signal, which will be sent to the speaker for playback.
[0094] For example, assuming that the distortion frequency band of the audio playback device is 30 Hz-100 Hz, and the filtering range of the spectrum compensation filter is 20 Hz-200 Hz, Figure 8 As shown, compared with the frequency response curve of the third audio signal output by the sound effect processor, the frequency response curve of the second audio signal obtained after the spectrum compensation filter performs spectrum compensation on the third audio signal has a relatively smooth waveform corresponding to the distortion frequency band.
[0095] It is understandable that in the embodiment of the present application, the parameters in the DRC are obtained by debugging the audio signal output by the spectrum compensation filter. Since the waveform corresponding to the distortion frequency band of the audio signal output by the spectrum compensation filter is smoother than that of the audio signal output by the sound effect processor, the debugged DRC can obtain a larger compression range when calculating the compression coefficient.
[0096] For example, Figure 8 As shown in the figure, the threshold value B obtained by debugging the audio signal output by the sound effect processor is greater than the threshold value A obtained by debugging the audio signal output by the spectrum compensation filter. It can be seen that when the compression coefficient corresponding to the third audio signal is calculated by threshold value B, the compression range is 35Hz to 100Hz. When the compression coefficient corresponding to the second audio signal is calculated by threshold value A, the compression range is 20Hz to 200Hz. That is, due to the change in the spectrum of the audio signal input to the DRC, the compression range of the DRC becomes larger.
[0097] Taking the amplitude corresponding to 100 Hz as an example, after compensation by the spectrum compensation filter, the amplitude corresponding to 100 Hz decays from y1 to y2. When the third audio signal is input into the DRC to calculate the corresponding compression coefficient, since the amplitude corresponding to the third audio signal at 100 Hz does not exceed the threshold B, the compression amount gain is 0. When the compression module compresses the third audio signal using the compression coefficient, the amplitude corresponding to 100 Hz will not be compressed.
[0098] When the second audio signal is input into the DRC to calculate the compression coefficient, since the amplitude of the second audio signal at 100Hz exceeds the threshold A, the compression amount gain is y2-A. After that, the compression module compresses the third audio signal using the compression coefficient, and the amplitude of the compressed signal at 100Hz is:
[0099] y1-gain=y1-(y2-A)
[0100] It can be seen that due to the expansion of the compression range, the third audio signal obtains more compression in the area corresponding to the distortion frequency band, thereby further ensuring that the amplitude of the compressed signal in the distortion frequency band is within the range limited by the acoustic output threshold, thereby reducing the distortion of the compressed signal when it is played.
[0101] like Fig. 9 As shown, the original audio signals to be played with different amplitudes are respectively used as follows Figure 1 The frequency response curve obtained when the audio processing system shown is compressed (such as Fig. 9 The curves c1, d1, e1 and f1 shown in (a) of FIG. 1 and the frequency response curve obtained when the audio processing system provided by the present application is compressed (such as Fig. 9 The comparison diagram between the curves c2, d2, e2 and f2 shown in (b) of FIG. 1 and the acoustic output threshold curve. It can be seen that the compressed signals obtained by the audio processing system provided by the present application are all compressed to within the acoustic output threshold. And because the waveform corresponding to the spectrum of the second audio signal in the distortion frequency band is smoother, the compression amount calculated by DRC changes slightly with the change of frequency, thus ensuring that the gain of the large volume frequency band is not significantly reduced, ensuring the loudness of the large audio frequency band.
[0102] For example Figure 7The audio processing system shown in the figure can first turn off the spectrum compensation filter and debug the sound effect processing module when debugging the spectrum compensation filter. When the sound effect processing module is debugged, the distortion frequency band of the audio playback device is detected, that is, the frequency range in which distortion occurs is detected by playing the swept frequency signal at the maximum volume. According to the obtained distortion frequency band, the target spectrum can be determined (that is, the spectrum that can make the amplitude of the output signal corresponding to the distortion frequency band not exceed the acoustic output threshold). The initial filtering range of the spectrum compensation filter is set according to the target spectrum. After that, the spectrum compensation filter can be started, the original audio signal used for debugging is input into the audio processing system, and the compressed signal output by the audio processing system is detected. According to the detection result, the filtering range of the spectrum compensation filter is adjusted, and the final filtering range of the spectrum compensation filter is obtained, and a much-debugged spectrum compensation filter is obtained.
[0103] Optionally, after the sound effect processing module is debugged, the acoustic output threshold curve of the audio playback device can be detected, and the compression curve can be determined based on the difference between the acoustic output threshold curve and the frequency response curve of the audio signal output by the sound effect processing module; illustratively, the frequency response curve of the audio signal (as shown in the figure, represented as F1) output after the original audio signal used for debugging is processed by the modulated sound effect processing module, and the acoustic output threshold curve of the audio playback device can be as follows: Fig.10 After subtracting the frequency response curve from the acoustic output threshold curve, we get Fig.11 It can be understood that the compression curve represents the frequency band of the audio signal output by the sound effect processing module that needs to be compressed, that is, the distortion frequency band of the audio playback device.
[0104] After that, the target spectrum can be set according to the compression curve. Then, the initial filtering range of the spectrum compensation filter is set according to the target spectrum, and the filtering range is adjusted by repeatedly testing the compression effect of the compressed signal to determine the final filtering range of the spectrum compensation filter, so as to obtain a debugged spectrum compensation filter.
[0105] In another example, the spectrum compensation filter can also be set independently of the sound effect processor. The first audio signal can be the original audio signal to be played. Optionally, considering that the maximum amplitude of the audio signal that can be processed by most audio playback devices cannot be greater than 0dBFS, and the amplitude of some original audio signals in some frequency bands may be greater than 0dBFS, the first audio signal can also be a signal obtained after attenuation processing is performed on the original audio signal to be played in all frequency bands. In this case, the waveform of the frequency response curve of the first audio signal is the same as the waveform of the frequency response curve of the original audio signal to be played.
[0106] For example, an audio processing system can also Fig.12As shown, it includes a sound effect processing module, a spectrum compensation filter, an attenuation module, a DRC and a compression module. After the original audio signal to be played is input into the audio processing system, it is input into the attenuation module and the sound effect processing module respectively. The attenuation module first attenuates the original audio signal to be played according to a preset threshold value to obtain a first audio signal. The spectrum compensation filter performs spectrum compensation on the first audio signal, adjusts the amplitude of the first audio signal in the corresponding area of the distortion frequency band, and obtains a second audio signal. The second audio signal is input into the DRC, and the compression coefficient corresponding to the second audio signal is calculated according to the parameters obtained in advance. After the original audio signal to be played is processed by the sound effect processing module, a third audio signal is obtained. The obtained compression coefficient and the third audio signal are input into the compression module, and the compression module uses the compression coefficient to compress the third audio signal to be output to obtain a compressed signal, which will be sent to the speaker for playback.
[0107] When debugging the spectrum compensation filter, the acoustic output threshold curve of the audio playback device can be detected when the audio compensation filter and the sound effect processing module are turned off. The original audio signal used for debugging is input into the audio processing system, and the attenuation module attenuates the original audio signal used for debugging according to the preset threshold attenuation to obtain a fourth audio signal. The compression curve is determined based on the difference between the acoustic output threshold curve and the frequency response curve of the fourth audio signal.
[0108] For example, Fig.13 After subtracting the frequency response curve of the fourth audio signal and the acoustic output threshold curve of the audio playback device, the following is obtained: Fig.14 It can be understood that the compression curve represents the frequency band of the original audio signal that needs to be compressed, that is, the distortion frequency band of the audio playback device.
[0109] Optionally, the frequency response curve of the original audio signal used for debugging in the audio processing system may be directly obtained, and the compression curve may be determined according to the difference between the acoustic output threshold curve and the frequency response curve of the original audio signal.
[0110] After obtaining the compression curve, the target spectrum can be set according to the compression curve, and then the initial filtering range of the spectrum compensation filter can be set according to the target spectrum. By repeatedly testing the compression effect of the compressed signal, the filtering range is adjusted to determine the final filtering range of the spectrum compensation filter, and a debugged spectrum compensation filter is obtained.
[0111] It is worth mentioning that Figure 7 In the audio processing system shown, the parameters of the spectrum compensation filter are changed based on the changes in the parameters of the audio effect processor. Fig.12In the audio processing system shown, the sound effect processor and the spectrum compensation filter can be debugged separately, and changes in the parameters of the sound effect processor do not affect the spectrum compensation filter, avoiding the need to synchronously modify the spectrum compensation filter when adjusting the parameters of the sound effect processor.
[0112] In another scenario, the audio processing system may not include any audio effect processor. The first audio signal may be an original audio signal to be played, or the first audio signal may be a signal obtained by performing attenuation processing on the original audio signal to be played in all frequency bands.
[0113] like Fig.15 As shown, another audio processing system provided by the present application includes a spectrum compensation filter, an attenuation module, a DRC and a compression module. After the original audio signal to be played is input into the audio processing system, it is input into the attenuation module and the compression module respectively. The attenuation module first attenuates the original audio signal to be played according to a preset threshold value to obtain a first audio signal. The spectrum compensation filter performs spectrum compensation on the first audio signal to obtain a second audio signal. The second audio signal is input into the DRC, and the compression coefficient corresponding to the second audio signal is calculated according to the parameters obtained in advance. The obtained compression coefficient is input into the compression module, and the compression module uses the compression coefficient to compress the original audio signal to be played to obtain a compressed signal, which will be sent to the speaker for playback.
[0114] Accordingly, when debugging the spectrum compensation filter, the acoustic output threshold curve of the audio playback device can be detected when the audio compensation filter is turned off. The original audio signal used for debugging is input into the audio processing system, and the attenuation module attenuates the original audio signal used for debugging according to the preset threshold attenuation to obtain a fourth audio signal. The compression curve is determined based on the difference between the acoustic output threshold curve and the frequency response curve of the fourth audio signal. Alternatively, the compression curve is directly determined based on the difference between the frequency response curve of the original audio signal in the audio processing system and the acoustic output threshold curve. After that, the target spectrum can be set according to the compression curve, and then the initial filtering range of the spectrum compensation filter can be set according to the target spectrum. By repeatedly testing the compression effect of the compressed signal, the filtering range is adjusted, and the final filtering range of the spectrum compensation filter is determined to obtain a debugged spectrum compensation filter.
[0115] In summary, by adding a spectrum compensation filter before DRC, the gain of the high-volume frequency band can be expanded without significantly reducing the gain, thereby reducing the distortion of the compressed signal when it is played.
[0116] Based on the same inventive concept, as an implementation of the above method, an embodiment of the present application provides an audio compression device, and the device embodiment corresponds to the above method embodiment. For ease of reading, the device embodiment will no longer repeat the details of the above method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents in the above method embodiment.
[0117] Fig.16 A schematic diagram of the structure of the audio compression device provided in the embodiment of the present application is shown in FIG. Fig.16 As shown, the device provided in this embodiment includes:
[0118] An acquisition unit, configured to acquire a first audio signal to be processed;
[0119] a spectrum compensation unit, configured to filter the first audio signal input based on a preset target spectrum to obtain a second audio signal, wherein the target spectrum is related to a distortion frequency band of the audio playback device;
[0120] A dynamic range compression unit, configured to process the second audio signal to obtain a compression coefficient;
[0121] The compression unit is used to output a compressed signal according to the compression coefficient.
[0122] Optionally, obtaining the first audio signal to be processed includes:
[0123] Obtaining the original audio signal to be played;
[0124] Input the original audio signal to be played into a sound effect processing module for processing to obtain a third audio signal, wherein the third audio signal is used as the first audio signal, and the sound effect processing module includes at least one sound effect processor;
[0125] Outputting a compressed signal according to the compression coefficient comprises:
[0126] The third audio signal is compressed according to the compression coefficient, and the compressed signal is output.
[0127] Optionally, the target spectrum and the spectrum compensation filter are acquired by:
[0128] Turning off the audio compensation filter and, after debugging the sound effect processing module, detecting the distortion frequency band of the audio playback device;
[0129] Determining the target spectrum according to the distorted frequency band;
[0130] The spectrum compensation filter is obtained by debugging according to the target spectrum.
[0131] Optionally, the target spectrum and the spectrum compensation filter are acquired by:
[0132] Turning off the audio compensation filter and, after debugging the sound effect processing module, detecting the acoustic output threshold curve of the audio playback device;
[0133] Determining a compression curve based on a difference between an acoustic output threshold curve and a frequency response curve of an audio signal output by the sound effect processing module;
[0134] Determining the target spectrum according to the compression curve;
[0135] The spectrum compensation filter is obtained by debugging according to the target spectrum.
[0136] Optionally, the first audio signal is an original audio signal to be played, or the first audio signal is an audio signal obtained by attenuating the original audio signal to be played according to a preset threshold.
[0137] Optionally, outputting a compressed signal according to the compression coefficient includes:
[0138] compressing the original audio signal to be played according to the compression coefficient, and outputting the compressed signal;
[0139] The target spectrum and the spectrum compensation filter are obtained as follows:
[0140] Turning off the audio compensation filter and testing the acoustic output threshold curve of the audio playback device;
[0141] Determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging;
[0142] Determining the target spectrum according to the compression curve;
[0143] The spectrum compensation filter is obtained by debugging according to the target spectrum.
[0144] Optionally, outputting a compressed signal according to the compression coefficient includes:
[0145] Inputting the original audio signal to be played into a sound effect processing module for processing to obtain a third audio signal, wherein the sound effect processing module includes at least one sound effect processor;
[0146] compressing the third audio signal according to the compression coefficient, and outputting the compressed signal;
[0147] The target spectrum and the spectrum compensation filter are obtained as follows:
[0148] After closing the audio compensation filter and the sound effect processing module, detecting an acoustic output threshold curve of the audio playback device;
[0149] Determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging;
[0150] Determining the target spectrum according to the compression curve;
[0151] The spectrum compensation filter is obtained by debugging according to the target spectrum.
[0152] Optionally, determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging includes:
[0153] The compression curve is determined based on a difference between the acoustic output threshold curve and a frequency response curve of the original audio signal used for debugging.
[0154] Optionally, determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging includes:
[0155] The compression curve is determined based on a difference between the acoustic output threshold curve and a frequency response curve of a fourth audio signal, wherein the fourth audio signal is an audio signal obtained by attenuating the original audio signal used for debugging according to the preset threshold.
[0156] Optionally, the sound effect processing module includes an equalizer.
[0157] Optionally, the debugging method of the dynamic range compression unit is:
[0158] Parameter adjustment is performed according to the audio signal output by the audio compensation filter unit.
[0159] Optionally, the spectrum compensation filter unit is an IIR filter or a FIR filter.
[0160] The audio compression device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0161] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0162] Based on the same inventive concept, an embodiment of the present application also provides an audio playback device. Fig.17 A schematic diagram of the structure of an audio playback device provided in an embodiment of the present application, such as Fig.17 As shown, the audio playback device provided in this embodiment includes: a memory 210 and a processor 220, the memory 210 is used to store computer programs; the processor 220 is used to execute the method described in the above method embodiment when calling the computer program.
[0163] The audio playback device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0164] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in the above method embodiment is implemented.
[0165] The embodiment of the present application also provides a computer program product. When the computer program product is run on an audio playback device, the audio playback device implements the method described in the above method embodiment when executing the computer program product.
[0166] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0167] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media can include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0168] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0169] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0170] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0171] In the description of this application, unless otherwise specified, " / " indicates that the objects associated with each other are in an "or" relationship, for example, A / B can represent A or B; "and / or" in this application is merely a description of the association relationship between associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
[0172] Furthermore, in the description of this application, unless otherwise specified, "plurality" means two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0173] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0174] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0175] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0176] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An audio compression method, applied to an audio playback device, characterized in that: The method comprises: Acquire a first audio signal to be processed; Applying a spectrum compensation filter to the first audio signal for filtering based on a preset target spectrum to obtain a second audio signal, wherein the target spectrum is related to a distortion frequency band of the audio playback device; Processing the second audio signal by a preset dynamic range compressor DRC to obtain a compression coefficient; According to the compression coefficient, a compressed signal is output.
2. The method according to claim 1, characterized in that The obtaining of a first audio signal to be processed includes: Obtaining the original audio signal to be played; Input the original audio signal to be played into a sound effect processing module for processing to obtain a third audio signal, wherein the third audio signal is used as the first audio signal, and the sound effect processing module includes at least one sound effect processor; Outputting a compressed signal according to the compression coefficient comprises: The third audio signal is compressed according to the compression coefficient, and the compressed signal is output.
3. The method according to claim 2, characterized in that The target spectrum and the spectrum compensation filter are obtained by: Turning off the audio compensation filter and, after debugging the sound effect processing module, detecting the distortion frequency band of the audio playback device; Determining the target spectrum according to the distorted frequency band; The spectrum compensation filter is obtained by debugging according to the target spectrum.
4. The method according to claim 2, characterized in that: The target spectrum and the spectrum compensation filter are obtained by: Turning off the audio compensation filter and, after debugging the sound effect processing module, detecting the acoustic output threshold curve of the audio playback device; Determining a compression curve based on a difference between an acoustic output threshold curve and a frequency response curve of an audio signal output by the sound effect processing module; Determining the target spectrum according to the compression curve; The spectrum compensation filter is obtained by debugging according to the target spectrum.
5. The method according to claim 1, characterized in that: The first audio signal is an original audio signal to be played, or the first audio signal is an audio signal obtained by attenuating the original audio signal to be played according to a preset threshold.
6. The method according to claim 5, characterized in that Outputting a compressed signal according to the compression coefficient comprises: compressing the original audio signal to be played according to the compression coefficient, and outputting the compressed signal; The target spectrum and the spectrum compensation filter are obtained as follows: Turning off the audio compensation filter and testing the acoustic output threshold curve of the audio playback device; Determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging; Determining the target spectrum according to the compression curve; The spectrum compensation filter is obtained by debugging according to the target spectrum.
7. The method according to claim 5, characterized in that Outputting a compressed signal according to the compression coefficient comprises: Inputting the original audio signal to be played into a sound effect processing module for processing to obtain a third audio signal, wherein the sound effect processing module includes at least one sound effect processor; compressing the third audio signal according to the compression coefficient, and outputting the compressed signal; The target spectrum and the spectrum compensation filter are obtained as follows: After closing the audio compensation filter and the sound effect processing module, detecting an acoustic output threshold curve of the audio playback device; Determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging; Determining the target spectrum according to the compression curve; The spectrum compensation filter is obtained by debugging according to the target spectrum.
8. The method according to claim 6 or 7, characterized in that: Determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging, comprising: The compression curve is determined based on a difference between the acoustic output threshold curve and a frequency response curve of the original audio signal used for debugging.
9. The method according to claim 6 or 7, characterized in that: Determining a compression curve based on the acoustic output threshold curve and an original audio signal used for debugging, comprising: The compression curve is determined based on a difference between the acoustic output threshold curve and a frequency response curve of a fourth audio signal, wherein the fourth audio signal is an audio signal obtained by attenuating the original audio signal used for debugging according to the preset threshold.
10. The method according to any one of claims 2-4 and 7, characterized in that: The sound effect processing unit includes an equalizer.
11. The method according to any one of claims 1 to 7, characterized in that: The debugging method of the DRC is: Parameter adjustment is performed according to the audio signal output by the audio compensation filter.
12. The method according to any one of claims 1 to 7, characterized in that: The spectrum compensation filter is an infinite impulse response (IIR) filter or a finite impulse response (FIR) filter.
13. An audio playback device, characterized in that: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 12 when executing the computer program.
14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
15. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Companding apparatus and method to reduce quantization noise using advanced spectral extension
CN104995680A
Audio signal enhancement method and device, storage medium and processor
CN111970628A
Audio Compression System for Compressing an Audio Signal
US20160344356A1
Cited By
Audio signal processing method and device based on machine learning algorithm catboost
CN119252277A
