Embodiment
The embodiment of the present invention provides a kind of supper bass boosting method and system, in order to avoiding audio signal to produce under the prerequisite of saturation noise, significantly promotes the gain of the low frequency signal in audio signal, thereby improves the supper bass enhancing effect of audio signal.And, can also greatly improve processing speed.
The embodiment of the present invention adopts filtering and variable sampling rate technology, low frequency part in audio signal is extracted out separately, then converting the signal into frequency domain than under low sampling rate by FFT, the gain of each frequency range of conciliation low frequency part that so just can be more careful, therefore not only can significantly promote the gain of the low frequency signal in audio signal, thereby the supper bass that improves audio signal strengthens effect, but also can reduce computational complexity.Finally, by the low frequency part after strengthening and primary signal stack, use automatic gain to control (AGC) technology signal amplitude is controlled to critical saturation position, make supper bass when fully strengthening, can saturatedly not overflow the generation noise again.
That is to say, the embodiment of the present invention compared with prior art, mainly comprises following 2 improvement:
1. only doing supper bass strengthens, there is no need the full band of audio signal is done to FFT and IFFT conversion, therefore, adopt the sample rate conversion technology, first by signal process low pass filter, again sample rate is reduced, then the low sampling rate signal is done to the FFT conversion, can greatly reduce counting of FFT, rise sampling processing and low-pass filtering as long as do again after the IFFT conversion, low frequency signal after can being enhanced, low frequency signal and original signal addition after finally strengthening, can obtain the audio signal after supper bass strengthens.
2. digital signal adopts 16 bits (bit) to be quantized; if overflow; just need to adopt overflow protection (such as amplitude limit arrives-32768~32767); because the low frequency energy of signal itself is very large; if the raising low-frequency gain, be easy to overflow, adopt the method for amplitude limit; easily produce harmonic distortion, produce noise.Therefore, very conservative all when existing EQ strengthens supper bass, can not provide larger gain.And for some low frequencies weak music, often can not meet requirement, this just makes general EQ do when bass strengthens the condition faced a difficult selection.The embodiment of the present invention is applied to supper bass by AGC and strengthens in algorithm, can address this problem well, greatly improves quality and effect that supper bass strengthens.
The technical scheme embodiment of the present invention provided below in conjunction with accompanying drawing describes.
Referring to Fig. 2, a kind of supper bass enhancing system that the embodiment of the present invention provides comprises:
The first low-pass filter unit 11, carry out low-pass filtering treatment according to default cut-off frequency to audio signal, obtains the low frequency signal of the time domain in this audio signal.
Extracting unit 12, according to default extracting multiple, extract after processing and send to analysis window unit 13 low frequency signal of time domain.
Frequency domain converting unit 14, the low frequency signal by the time domain to after described analysis window unit 13 is processed, carry out fast Fourier transform (FFT), obtains the low frequency signal of frequency domain.
Band gain control unit 15, carry out band gain control (Band Gain Control) by the low frequency signal by frequency domain, improves the signal strength signal intensity of frequency domain low frequency signal.
Time domain converting unit 16, be reduced to the low frequency signal of time domain by inverse fast Fourier transform (IFFT) by the low frequency signal of the frequency domain after band gain control unit 15 is processed, and send to comprehensive window unit 17 to be processed the low frequency signal of this time domain.
Interpolating unit 18, according to default interpolation multiple, carry out interpolation processing to the low frequency signal obtained after processing through described comprehensive window unit 17.
The second low-pass filter unit 19, according to default cut-off frequency, the signal that will obtain after interpolating unit 18 interpolation processing carries out low-pass filtering treatment.
Delay process unit 20, according to default time delay value, carry out delay process to the audio signal of input.
Synthesis unit 21, by the audio signal after delay process unit 20 is processed, the low frequency signal after strengthening with signal strength signal intensity, the signal after the second low-pass filter unit 19 processing is synthesized.
Automatic gain control unit 22, the audio signal after synthesis unit 21 is synthesized is carried out automatic gain control.
Below above-mentioned unit is elaborated.
The function of above-mentioned the first low-pass filter unit 11 and the second low-pass filter unit 19 is actually the same, is exactly in fact a simple low pass filter (LPF), and the LPF Main Function is that the low frequency part of signal is leached.
The setting of the cut-off frequency of LPF need to be considered two aspects: on the one hand can not be too little, and the too little low-frequency component that easily makes is attenuated; On the other hand can not be too large, because follow-up, also to be further processed by extracting unit 12, if cut-off frequency is too large, can easily cause the signal spectrum aliasing.
Usually the following frequency part of 1 KHz (KHz) in audio signal has just comprised nearly all bass composition, so the cut-off frequency in the embodiment of the present invention should be not less than 1KHz.
For example: extracting unit 12 adopts M doubly to extract ratio, the sample rate of audio signal is 44.1KHz, the sample rate that extracting unit 12 extracts the signal obtained is reduced to about 44.1KHz/M, and aliasing should just can not occur the frequency of signal below 44.1KHz/2M, so in the first low-pass filter unit 11 of the embodiment of the present invention and the second low-pass filter unit 19, default cut-off frequency should be not more than 44.1KHz/2M.
Extracting unit 12 and interpolating unit 18:
The main sample rate conversion technology that adopts of extracting unit 12 and interpolating unit 18, the extraction of extracting unit 12 from the burst of input, extracts a point every M point, and M is extracting multiple.Correspondingly, the interpolation of interpolating unit 18 is in the burst of inputting, and inserts M-1 individual zero after each point, and M is the interpolation multiple, and its value is identical with the value of extracting multiple.
The purpose that extracting unit 12 and interpolating unit 18 are carried out the operation of sample rate conversion is set, and is by reducing sample rate, making frequency domain converting unit 14 and time domain converting unit 16 work under lower sample rate, therefore can greatly reduce computational complexity.
Further, although the embodiment of the present invention considers the down-sampled processing that can reduce FFT and IFFT and count, the low-pass filtering operation increased can increase extra operand, and down-sampled multiple is higher, the passband of low pass filter is narrower, and the exponent number of the filter met the demands is higher.Therefore, need compromise (trade off).Through overtesting, the embodiment of the present invention can be selected 8 times of down-sampled processing, i.e. M=8, and for example, the sample rate of the audio signal of input is 44.1KHz, the cut-off frequency f of low pass filter
smust meet: f
s≤ 44100/2/8, i.e. f
s≤ 2756Hz.
The low pass filter that the embodiment of the present invention adopts can be 1.5KHz for cut-off frequency, the FIR low pass filter on 64 rank.Stopband attenuation is greater than 50 decibels (dB), and low pass filter is designed by matlab.Why the embodiment of the present invention is not chosen in the IIR low pass filter that under same performance, exponent number can be lower, and reason comprises:
Although the FIR filter has 64 rank, can form the fast algorithm system with extracting unit 12 together with interpolating unit 18, real complexity is equivalent to the FIR filter on 64/8=8 rank, so the complexity of algorithm is not high;
And iir filter is due to feedback operation being arranged, therefore necessary pointwise computing, can not form the fast algorithm system with change sampling unit (being extracting unit 12 and interpolating unit 18), in addition, because IIR filtering is higher to the data required precision, quantization error is larger, therefore also to design, brings certain difficulty, participate in computing by the data of degree of precision, often increase operand;
The FIR filter has linear phase, and all frequencies have identical group delay, and this point is very crucial, can not bring phase distortion.More crucial, in the low frequency signal after strengthening and original signal stack, the problem of a phase alignment is arranged.If adopt iir filter to deal with improperly, the situation because of anti-phase signal cancellation (phase cancel) just may appear, therefore can reduce audio quality.
For analysis window unit 13, comprehensive window unit 17, frequency domain processing unit 14 and time domain processing unit 16 these basic digital signal processing units, due to what mainly adopt, be prior art, so the embodiment of the present invention repeat no more.
Band gain control unit 15:
Gain for low frequency part is controlled, and can with interior linear zone, increase identical loudness at 1KHz with reference to contour of equal loudness, and the energy (dB) that high frequency needs is large, and the energy that low frequency needs is little.In theory, for the bass fundamental frequency of lower frequency, give with gain low, and for the bass harmonic wave of upper frequency, give with gain want high.But in practice, because the frequency characteristic of loud speaker or earphone is not smooth, low frequency part has larger decay, therefore, the theoretical value of this contour of equal loudness is too large meaning not.In reality, in order to compensate the low frequency loss of loud speaker or earphone, still to give the gain larger with low frequency part.Therefore, according to the subjective hearing test of test, the parameter that the band gain control unit 15 in the embodiment of the present invention adopts is as follows:
For the signal of 0~80Hz, give the gain of 12dB; Give the gain with 6dB for 80~160Hz; Give the gain with 3dB for 160~500Hz.
For binaural signal, because the low frequency part musical instrument often all is in the middle of sound field, left and right acoustic channels is closely similar, therefore there is no need to do respectively supper bass strengthens, the general compound voice with (L+R)/2 is processed and is got final product, the mean value that is to say the low frequency part that adopts left and right acoustic channels strengthens to process and gets final product, and then will strengthen the bass part obtained after processing and be added to respectively in two sound channels and go.
Delay process unit 20:
Delay process unit 20, by D sample of primary signal time delay, the D value is so-called time delay value.The purpose of time delay is the phase alignment for the low frequency signal after making original audio signal and strengthening, and causes signal cancellation when avoiding phase place not line up.The set-up mode of D value is as follows:
All possible time delay in the low frequency part processing procedure of definite needs consideration audio signal of D value comprises: the length of the filter in the first low-pass filter unit 11 and the second low-pass filter unit 16, the length of analysis window unit 13 and comprehensive window unit 17, and FFT and IFFT required time taken of conversion etc.
The length of supposing the filter in the first low-pass filter unit 11 and the second low-pass filter unit 19 is L, and the length of analysis window unit 13 and comprehensive window unit 17 is W, and the D value can be:
D=L/2*2+W/2*M
Wherein, the time delay that L/2 is a LPF, have two LPF, so the time delay that low-pass filtering treatment causes is L; W/2 is the time delay that analysis window unit 13 and comprehensive window unit 17 cause, because this part time delay produces after extraction, therefore is equivalent to also will increase M doubly for extraction is front, is therefore W/2*M
By time delay D sample original audio signal with strengthen after the low frequency signal addition, saturated overflowing may occur, so the signal demand after addition enters automatic gain control unit 22 and is processed.
Automatic gain control unit 22:
General AGC module is used for automatically changing the gain of signal, and small-signal is amplified, and large-signal is dwindled, and it is moderate that volume keeps.And the automatic gain control unit 22 in the embodiment of the present invention is not like this, because for music, the introduction, elucidation of the theme of melody, modulation in tone is the characteristics of self, can not destroy, the purpose of using AGC in the embodiment of the present invention is to guarantee that sound does not occur under the prerequisite of saturation distortion, improving the volume of supper bass.That is to say, automatic gain control unit 22 is for the signal that makes the amplitude maximum in the certain hour scope on saturated border, and the signal magnitude relation in this scope still retains, and needs to adopt fall soon the method risen slowly.
The handling process of automatic gain control unit 22 comprises:
In a frame signal, find the signal amplitude value Vmax of absolute value maximum, then Vmax and targets threshold Ti are compared, targets threshold is the ideal value of wishing that signal amplitude can reach.Vmax is compared with Ti and obtains ideal gain value gain_t and be:
gain_t=Ti/Vmax
Because the too fast meeting of change in gain brings the sign mutation noise, therefore, adopt and fall soon the method risen slowly, comprising:
Suppose that the last final gain value calculated is gain_old:
If gain_t<gain_old, gain=gain_t, this control and display falls soon, and the I of gain is reduced to a low threshold value LowLimit.
If gain_t > gain_old, gain=gain_old+step, this control and display rises slowly, transition step-length when wherein step increases for gain gain, the gain maximum can increase to a high threshold HighLimit.
That is to say gainLowLimit≤gain≤HighLimit.
Then, the gain gain that use newly calculates and the gain_old of previous frame do in frame level and smooth, can be weighted with ramp function as shown in Figure 3, and ramp function is defined as b (i)=1-i/N:
gainW(i)=b(i)gain_old+(1-b(i))gain,i=0~N-1
Wherein, gainW (i) is for having done the gain of the sampling point i after level and smooth in frame in present frame, and frame length is N.
Can find out, due to ramp function, the gain_old for previous frame when starting gives and larger weights, for the gain of present frame, gives and less weights; And it is just in time contrary when end.The impact that therefore can effectively smoothly gain and suddenly change.
Finally, be used as the input signal input (i) that level and smooth gain gainW (i) in frame removes to process automatic gain control unit 22, be adjusted the output signal output (i) after the gain and be:
output(i)=input(i)*gainW(i),i=0~N-1
By the method for this AGC, just can avoid the saturated noise that overflows, do not affect the melody of music, simultaneously, farthest strengthen the supper bass effect.
Referring to Fig. 4, a kind of supper bass boosting method that the embodiment of the present invention provides comprises step:
S101, according to default cut-off frequency, audio signal is carried out to low-pass filtering treatment, obtain the low frequency signal of the time domain in this audio signal, and this low frequency signal is converted to the low frequency signal of frequency domain.
S102, the low frequency signal of described frequency domain is carried out after band gain control being reduced to the low frequency signal of time domain, obtain the low frequency signal after signal strength signal intensity strengthens.
S103, the low frequency signal after the signal strength signal intensity enhancing and described audio signal is synthetic, and the audio signal after synthesizing is carried out to automatic gain control.
Preferably, the step that in step S101, the low frequency signal of time domain is converted to the low frequency signal of frequency domain comprises: the low frequency signal of described time domain by analysis after the processing of window, is converted to the low frequency signal of described time domain by fast Fourier transform to the low frequency signal of frequency domain.
The step that in step S102, the low frequency signal of frequency domain is reduced to the low frequency signal of time domain comprises: by inverse fast Fourier transform, the low frequency signal of the frequency domain after band gain is controlled is reduced to the low frequency signal of time domain, and the low frequency signal of this time domain is carried out to the processing of comprehensive window.
Preferably, the low frequency signal of time domain is also comprised to step before the processing of window by analysis: according to default extracting multiple, the low frequency signal of time domain is extracted to processing.
The processing of the low frequency signal of time domain being carried out to comprehensive window also comprises step afterwards: according to the interpolation multiple, the low frequency signal obtained after the processing through comprehensive window is carried out to interpolation processing; According to cut-off frequency, the signal that will obtain after interpolation processing carries out low-pass filtering treatment.
Preferably, the sample rate that cut-off frequency is less than or equal to described audio signal is divided by the resulting value of described extracting multiple of 2 times.
Preferably, the synthetic step of the low frequency signal after signal strength signal intensity is strengthened and audio signal comprises: according to default time delay value, audio signal is carried out to delay process; By the audio signal after delay process, the low frequency signal after strengthening with signal strength signal intensity is synthesized.
In sum, the embodiment of the present invention has proposed the Digital Signal Processing scheme that a kind of super supper bass strengthens, adopt filtering, variable sampling rate technology, low frequency part is extracted out separately, then converting the signal into frequency domain than under low sampling rate with FFT, the gain of each frequency range of conciliation low frequency part that so just can be more careful, reduced computational complexity simultaneously, then by low frequency part and primary signal stack, use the AGC technology that maximum signal amplitudes is controlled to critical saturation position, make supper bass when fully strengthening, can saturatedly not overflow the generation noise again.
Obviously, those skilled in the art can carry out various changes and modification and not break away from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these are revised and modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention also is intended to comprise these changes and modification interior.