CN113254251B - Anti-overflow method for audio DSP data - Google Patents

Anti-overflow method for audio DSP data Download PDF

Info

Publication number
CN113254251B
CN113254251B CN202110695718.7A CN202110695718A CN113254251B CN 113254251 B CN113254251 B CN 113254251B CN 202110695718 A CN202110695718 A CN 202110695718A CN 113254251 B CN113254251 B CN 113254251B
Authority
CN
China
Prior art keywords
data
coefficient
attenuation
processing
audio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110695718.7A
Other languages
Chinese (zh)
Other versions
CN113254251A (en
Inventor
王俊华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changsha Lianyuan Electronic Technology Co ltd
Original Assignee
Changsha Lianyuan Electronic Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changsha Lianyuan Electronic Technology Co ltd filed Critical Changsha Lianyuan Electronic Technology Co ltd
Priority to CN202110695718.7A priority Critical patent/CN113254251B/en
Publication of CN113254251A publication Critical patent/CN113254251A/en
Application granted granted Critical
Publication of CN113254251B publication Critical patent/CN113254251B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/076Error or fault detection not based on redundancy by exceeding limits by exceeding a count or rate limit, e.g. word- or bit count limit

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Tone Control, Compression And Expansion, Limiting Amplitude (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The application discloses an anti-overflow method for audio DSP data, which comprises the following steps: starting a counter; acquiring audio data by using a Next frame and a Last frame, and performing format conversion, DSP and overflow prevention processing on the audio data; in the Next frame, the attenuation coefficient is obtained, and the historical attenuation coefficient is compared: if the attenuation coefficient is less than the historical attenuation coefficient, performing linear change coefficient attenuation processing on Last frame data, emptying a counter, then performing fixed coefficient attenuation processing on a Next frame, and updating the historical attenuation coefficient; otherwise, the counter is added with one, and the counter value CNT is compared with the calculation threshold Nth: if Nth is larger than CNT, performing fixed coefficient attenuation processing on the Next frame; otherwise, carrying out linear change coefficient amplification processing on the Next frame data, emptying a counter and updating a historical attenuation coefficient; and finally outputting Last frame data. The method can smoothly repair data, has strong repair capability, and effectively realizes anti-overflow processing of the data.

Description

Anti-overflow method for audio DSP data
Technical Field
The present application relates to the field of data signal processing technology, and more particularly, to an anti-overflow method for audio DSP data.
Background
In the audio industry, DSPs (digital signal processing) are an indispensable part thereof. By means of DSP technology, not only can signal form meeting the requirement of people be obtained, but also the functions of speech recognition, echo elimination and the like can be realized. However, the audio file has a corresponding file format and the format has a limitation of data bit number, and the data processed by the DSP may exceed the range that the bit number can represent, causing an overflow phenomenon and seriously affecting the sound quality of music.
At present, for the audio data overflow phenomenon, the existing elimination method mainly includes: directly cutting off the overflow part of the data; the overflow portion of the data is attenuated using a dynamically updated attenuation factor and the truncated portion of the audio is repaired using a predictive approach. However, the above mentioned method for preventing audio data from overflowing does not concern the jump between the truncated part and the non-truncated part, if it is used in a music device, the noise of "click" may occur, and the relative power ratio between the frequencies changes obviously, if the audio data has a serious overflow phenomenon, the repairing effect is not obvious.
Therefore, how to provide an anti-overflow method for audio DSP data, which can smoothly repair data, has strong repair capability, and more effectively implement anti-overflow processing of data, has become a technical problem to be solved by those skilled in the art.
Disclosure of Invention
In order to solve the above technical problem, the present application provides an anti-overflow method for audio DSP data, which can smoothly repair data, has strong repair capability, and more effectively implement anti-overflow processing of data.
The technical scheme provided by the application is as follows:
the application provides an anti-overflow method for audio DSP data, which comprises steps S1 to S7, and specifically comprises the following steps: s1: starting a counter, and cleaning historical parameters and data; s2: acquiring audio data to be processed by using a Next frame and a Last frame; s3: carrying out format conversion and integration on the audio data, and then carrying out DSP processing on the audio data; s4: acquiring a damping coefficient NextQ, a historical damping coefficient NextAttQ and an auxiliary damping coefficient LogAttQ, and comparing the sizes of the historical damping coefficient NextAttQ and the damping coefficient NextQ; s5: if NextQ is less than NextAttQ, updating a historical attenuation coefficient NextAttQ value and an auxiliary attenuation coefficient LogAttQ value, emptying a counter, performing linear change coefficient attenuation processing on Last frame data, and then entering step S6 to perform fixed coefficient attenuation processing; if NextQ is larger than or equal to NextAttQ, adding one to the counter to obtain a counter value CNT and obtain a counter calculation threshold Nth; comparing the counter value CNT with the calculation threshold Nth: if Nth > CNT, go to step S6 to perform constant coefficient attenuation processing; if Nth is not greater than CNT, performing linear change coefficient amplification processing on Next frame data, resetting a counter and updating a historical attenuation coefficient NextAttQ, and then directly entering step S7 to output Last frame data; s6: performing fixed coefficient attenuation processing on the Next frame data; s7: and outputting the Last frame data, exchanging data buffers of the Last frame and the Next frame, and then jumping back to the step 2 to perform a new round of data anti-overflow processing.
Further, in a preferred mode of the present invention, in step S3, the format converting and integrating the audio data includes: s301: the audio data is converted from integer to floating point.
Further, in a preferred mode of the present invention, in step S4, the obtaining the attenuation coefficient NextQ includes:
s401: obtaining the first M maximum absolute values MAX in the Next frame data processed by the DSPiThe maximum absolute value is the maximum value after the absolute value of the data in the NEXT frame is taken, the average value NextMAX of the first M maximum absolute values is calculated, the maximum value MAXTH which can be expressed by the number of bits of the audio data is obtained, and the size of the NextMAX and the size of the MAXTH are compared;
s402: if NextMAX is less than or equal to MAXTH, directly entering step S5; if NextMAX > MAXTH, the attenuation coefficient NextQ is calculated as:
Figure GDA0003235501530000021
comparing the attenuation coefficient NextQ with the preset initial attenuation value AttTH, if NextQ > AttTH, the process proceeds to step S5 after giving NextQ ═ AttTH.
Further, in a preferred mode of the present invention, the maximum MAXTH that the number of bits of the audio data can represent is specifically expressed as:
MAXTH=2N-1
in the formula: n-the number of bits of the audio data.
Further, in a preferred aspect of the present invention, in step S5, the performing linear coefficient of change attenuation processing on Last frame data includes:
s501: entering a Last frame attenuation processing system;
s502: acquiring parameters: acquiring the length Len of a data frame, a reference stepping length StepMin, a historical attenuation coefficient NextAttQ and an auxiliary attenuation coefficient LogAttQ;
s503: parameter pretreatment: firstly, obtaining a target attenuation coefficient:
Figure GDA0003235501530000031
and acquiring the data length needing to be operated initially:
NGap=(1-Qseq)/StepMin;
second, the length of the NGap is processed: if NGap > Len multiplied by delta, the data length is too long, and the clipping operation is carried out: given NGap as Len × δ, δ is a proportionality coefficient of the length of the data frame, and the value range is [0.8,1 ]; if NGap < Len × δ, it indicates that the data length is too short, and the extension operation is performed: giving NGap ═ Numth, wherein Numth ═ Len/10;
finally, obtaining a coefficient stepping value:
StepDN=(1-Qseq)/NGap;
s504: carrying out smoothing operation on the data;
s505: and returning the processed data, and exiting the Last frame attenuation processing system.
Further, in a preferred embodiment of the present invention, in step S502, the calculation formula of the reference step length StepMin specifically includes:
StepMin=DOT/MAXTH
in the formula: DOT — depth of test, the DOT obtained from a single frequency audio test.
Further, in a preferred embodiment of the present invention, in step S504, the operation formula for performing the smoothing operation on the data is specifically:
YNEXT[n]=YNEXT[n]×(Qseq+(NGap-n)×StepDN)
in the formula: n belongs to [ Len-NGap, Len];YNEXT[n]The method comprises the steps of directly obtaining NEXT frame data from a DSP;
Y′NEXT[n]is YNEXT[n]And (4) data processed by the related joint.
Further, in a preferred mode of the present invention, in step S5, the performing of the linear variation coefficient amplification process on the Next frame data includes:
s506: entering a Next frame amplification processing system;
s507: acquiring parameters: the length Len of the data frame, the historical attenuation coefficient nextatq, and the auxiliary attenuation coefficient LogAttQ are obtained.
S508: parameter pretreatment: first, a target amplification factor is obtained:
Qup=NextQ/NextAttQ;
secondly, obtaining a step-up value:
StepUP=Qup/NGap;
s509: amplifying the data;
s510: and returning the processed data, and exiting the Next frame amplification processing system.
Further, in a preferred embodiment of the present invention, in step S509, the operation formula for performing the amplification operation on the data is specifically:
Y′NEXT[n]=YNEXT[n]×(NextAttQ+n×StepUP)
in the formula: n is an element of [1, Len ∈];YNEXT[n]The method comprises the steps of directly obtaining NEXT frame data from a DSP; y'NEXT[n]Is YNEXT[n]And (4) data processed by the related joint.
Further, in a preferred embodiment of the present invention, in step S6, the processing formula for performing the fixed coefficient attenuation processing on the Next frame data is:
X′NEXT[n]=XNEXT[n]×NextAttQ
in the formula: xNEXT[n]Carrying out smoothing processing on the NEXT frame data of the NEXT frame; x'NEXT[n]Is XNEXT[n]And (4) data processed by the related joint.
Compared with the prior art, the overflow prevention method for the audio DSP data, provided by the invention, comprises the following steps: s1: starting a counter, and cleaning historical parameters and data; s2: acquiring audio data to be processed by using a Next frame and a Last frame; s3: carrying out format conversion and integration on the audio data, and then carrying out DSP processing on the audio data; s4: acquiring a damping coefficient NextQ, a historical damping coefficient NextAttQ and an auxiliary damping coefficient LogAttQ, and comparing the sizes of the historical damping coefficient NextAttQ and the damping coefficient NextQ; s5: if NextQ is less than NextAttQ, updating a historical attenuation coefficient NextAttQ value and an auxiliary attenuation coefficient LogAttQ value, emptying a counter, performing linear change coefficient attenuation processing on Last frame data, and then entering step S6 to perform fixed coefficient attenuation processing; if NextQ is larger than or equal to NextAttQ, adding one to the counter to obtain a counter value CNT and obtain a counter calculation threshold Nth; comparing the counter value CNT with the calculation threshold Nth: if Nth > CNT, go to step S6 to perform constant coefficient attenuation processing; if Nth is not greater than CNT, performing linear change coefficient amplification processing on Next frame data, resetting a counter and updating a historical attenuation coefficient NextAttQ, and then directly entering step S7 to output Last frame data; s6: performing fixed coefficient attenuation processing on the Next frame data; s7: and outputting the Last frame data, exchanging data buffers of the Last frame and the Next frame, and then jumping back to the step 2 to perform a new round of data anti-overflow processing. The method realizes data anti-overflow processing by combining the modes of linear change coefficient attenuation processing, linear change coefficient amplification processing and fixed coefficient attenuation processing through normalization operation, and simultaneously gives consideration to smooth transition among frames of data, thereby realizing effective data restoration. Compared with the prior art, the technical scheme of the invention can smoothly repair the data, has strong repair capability and more effectively realizes the anti-overflow processing of the data.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating steps of an overflow prevention method for audio DSP data according to an embodiment of the present invention;
FIG. 2 is a block flow diagram of an anti-overflow method for audio DSP data according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating the steps of linear coefficient of variation attenuation processing according to an embodiment of the present invention;
fig. 4 is a flowchart of steps of a linear variation coefficient amplification process according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It will be understood that when an element is referred to as being "fixed" or "disposed" on another element, it can be directly on the other element or be indirectly disposed on the other element; when an element is referred to as being "connected to" another element, it can be directly connected to the other element or be indirectly connected to the other element.
It will be understood that the terms "length," "width," "upper," "lower," "front," "rear," "first," "second," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like, as used herein, refer to an orientation or positional relationship indicated in the drawings that is solely for the purpose of facilitating the description and simplifying the description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be construed as limiting the application.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "plurality" or "a plurality" means two or more unless specifically limited otherwise.
It should be understood that the structures, ratios, sizes, and the like shown in the drawings are only used for matching the disclosure of the specification, so as to be understood and read by those skilled in the art, and are not used to limit the practical limit conditions of the present application, so that the modifications of the structures, the changes of the ratio relationships, or the adjustment of the sizes, do not have the technical essence, and the modifications, the changes of the ratio relationships, or the adjustment of the sizes, are all within the scope of the technical contents disclosed in the present application without affecting the efficacy and the achievable purpose of the present application.
As shown in fig. 1 to 4, the method for preventing overflow of audio DSP data provided in the embodiment of the present application includes steps S1 to S7, which specifically include: s1: starting a counter, and cleaning historical parameters and data; s2: acquiring audio data to be processed by using a Next frame and a Last frame; s3: carrying out format conversion and integration on the audio data, and then carrying out DSP processing on the audio data; s4: acquiring a damping coefficient NextQ, a historical damping coefficient NextAttQ and an auxiliary damping coefficient LogAttQ, and comparing the sizes of the historical damping coefficient NextAttQ and the damping coefficient NextQ; s5: if NextQ is less than NextAttQ, updating a historical attenuation coefficient NextAttQ value and an auxiliary attenuation coefficient LogAttQ value, emptying a counter, performing linear change coefficient attenuation processing on Last frame data, and then entering step S6 to perform fixed coefficient attenuation processing; if NextQ is larger than or equal to NextAttQ, adding one to the counter to obtain a counter value CNT and obtain a counter calculation threshold Nth; comparing the counter value CNT with the calculation threshold Nth: if Nth > CNT, go to step S6 to perform constant coefficient attenuation processing; if Nth is not greater than CNT, performing linear change coefficient amplification processing on Next frame data, resetting a counter and updating a historical attenuation coefficient NextAttQ, and then directly entering step S7 to output Last frame data; s6: performing fixed coefficient attenuation processing on the Next frame data; s7: and outputting the Last frame data, exchanging data buffers of the Last frame and the Next frame, and then jumping back to the step 2 to perform a new round of data anti-overflow processing.
The invention provides an anti-overflow method for audio DSP data, which specifically comprises the following steps: s1: starting a counter, and cleaning historical parameters and data; s2: acquiring audio data to be processed by using a Next frame and a Last frame; s3: carrying out format conversion and integration on the audio data, and then carrying out DSP processing on the audio data; s4: acquiring a damping coefficient NextQ, a historical damping coefficient NextAttQ and an auxiliary damping coefficient LogAttQ, and comparing the sizes of the historical damping coefficient NextAttQ and the damping coefficient NextQ; s5: if NextQ is less than NextAttQ, updating a historical attenuation coefficient NextAttQ value and an auxiliary attenuation coefficient LogAttQ value, emptying a counter, performing linear change coefficient attenuation processing on Last frame data, and then entering step S6 to perform fixed coefficient attenuation processing; if NextQ is larger than or equal to NextAttQ, adding one to the counter to obtain a counter value CNT and obtain a counter calculation threshold Nth; comparing the counter value CNT with the calculation threshold Nth: if Nth > CNT, go to step S6 to perform constant coefficient attenuation processing; if Nth is not greater than CNT, performing linear change coefficient amplification processing on Next frame data, resetting a counter and updating a historical attenuation coefficient NextAttQ, and then directly entering step S7 to output Last frame data; s6: performing fixed coefficient attenuation processing on the Next frame data; s7: and outputting the Last frame data, exchanging data buffers of the Last frame and the Next frame, and then jumping back to the step 2 to perform a new round of data anti-overflow processing. The method realizes data anti-overflow processing by combining the modes of linear change coefficient attenuation processing, linear change coefficient amplification processing and fixed coefficient attenuation processing through normalization operation, and simultaneously gives consideration to smooth transition among frames of data, thereby realizing effective data restoration. Compared with the prior art, the technical scheme of the invention can smoothly repair the data, has strong repair capability and more effectively realizes the anti-overflow processing of the data.
Specifically, in the embodiment of the present invention, the Next frame is used to obtain new data, and the Last frame is used to output data.
Wherein the step S1: and historical parameters and data are cleaned, and data overflow prevention processing is performed in the system to clean each parameter and data so as to eliminate the influence of historical records.
Specifically, in the embodiment of the present invention, in step S3, the format converting and integrating the audio data includes: s301: the audio data is converted from integer to floating point.
The original audio data is converted from an integer type to a floating point type, so that the precision loss can be reduced to the minimum, and the integrity of the audio data in the processing process is ensured.
Specifically, in the embodiment of the present invention, in step S4, the obtaining the attenuation coefficient NextQ includes:
s401: obtaining the first M maximum absolute values MAX in the Next frame data processed by the DSPiThe maximum absolute value is the maximum value after the absolute value of the data in the NEXT frame is taken, the average value NextMAX of the first M maximum absolute values is calculated, the maximum value MAXTH which can be expressed by the number of bits of the audio data is obtained, and the size of the NextMAX and the size of the MAXTH are compared;
s402: if NextMAX is less than or equal to MAXTH, directly entering step S5; if NextMAX > MAXTH, the attenuation coefficient NextQ is calculated as:
Figure GDA0003235501530000081
comparing the attenuation coefficient NextQ with the preset initial attenuation value AttTH, if NextQ > AttTH, the process proceeds to step S5 after giving NextQ ═ AttTH.
Wherein, the MAXiExpressed as: MAXi∈{MAX0,MAX1,MAX2…MAXM-1-the average value:
Figure GDA0003235501530000082
to avoid the problem of late normalization leading to a smaller overall volume at the cost of negligible clipping distortion.
Specifically, in the embodiment of the present invention, the maximum MAXTH that the number of bits of the audio data can represent is specifically represented as:
MAXTH=2N-1
in the formula: n-the number of bits of the audio data.
Specifically, in the embodiment of the present invention, the historical attenuation coefficient nextatq and the attenuation coefficient NextQ are compared, and if the attenuation coefficient is smaller than the historical attenuation coefficient, it indicates that the Next frame needs to be further attenuated, and the process proceeds to step S6.
Specifically, in the embodiment of the present invention, in step S5, the performing linear coefficient of change attenuation processing on Last frame data includes:
s501: entering a Last frame attenuation processing system;
s502: acquiring parameters: acquiring the length Len of a data frame, a reference stepping length StepMin, a historical attenuation coefficient NextAttQ and an auxiliary attenuation coefficient LogAttQ;
s503: parameter pretreatment: firstly, obtaining a target attenuation coefficient:
Figure GDA0003235501530000083
and acquiring the data length needing to be operated initially:
NGap=(1-Qseq)/StepMin;
second, the length of the NGap is processed: if NGap > Len multiplied by delta, the data length is too long, and the clipping operation is carried out: given NGap as Len × δ, δ is a proportionality coefficient of the length of the data frame, and the value range is [0.8,1 ]; if NGap < Len × δ, it indicates that the data length is too short, and the extension operation is performed: giving NGap ═ Numth, wherein Numth ═ Len/10;
finally, obtaining a coefficient stepping value:
StepDN=(1-Qseq)/NGap;
s504: carrying out smoothing operation on the data;
s505: and returning the processed data, and exiting the Last frame attenuation processing system.
In particular, in the embodiment of the present invention, the counter mainly functions to increase the attenuation coefficient back, so as to prevent the sound emitted from the device during the processing from being too small.
Specifically, in the embodiment of the present invention, in step S5, the linear variation coefficient attenuation processing is performed on the Last frame data to smooth the transition between the Last frame and the Next frame; before linear variation coefficient attenuation processing, the method further comprises the following steps: the historical attenuation coefficient nextatq and the auxiliary attenuation coefficient LogAttQ are updated.
The rule for updating the historical attenuation coefficient NextAttQ and the auxiliary attenuation coefficient LogAttQ is specifically as follows: LogAttQ is given as nextatq, and nextatq is given as NextQ.
Specifically, in the embodiment of the present invention, in step S502, the calculation formula of the reference step length StepMin is specifically:
StepMin=DOT/MAXTH
in the formula: DOT — depth of test, the DOT obtained from a single frequency audio test.
The value of DOT does not have a certain range because the resolution and the reference voltage of the digital-to-analog conversion device are not fixed. DOT is obtained by a single frequency audio test, which mainly comprises the following processes: the DOT value is gradually reduced until the device makes no audible "clicks" and the DOT is the desired value.
Specifically, in the embodiment of the present invention, in step S504, the operation formula for performing the smoothing operation on the data is specifically:
Y′NEXT[n]=YNEXT[n]×(Qseq+(NGap-n)×StepDN)
in the formula: n belongs to [ Len-NGap, Len];YNEXT[n]The method comprises the steps of directly obtaining NEXT frame data from a DSP; y'NEXT[n]Is YNEXT[n]And (4) data processed by the related joint.
Specifically, in the embodiment of the present invention, in step S5, the counter value CNT is compared with the count threshold Nth, and it is determined whether the counter value CNT exceeds the count threshold Nth: if not, no further attenuation or amplification processing is performed, and the process proceeds to step S6; otherwise, the amplification processing is required, and the subsequent linear variation coefficient amplification processing is performed.
After the linear change coefficient amplification processing is completed, clearing the counter to indicate that one round of amplification processing is completed, and then updating the historical attenuation coefficient nextatq, wherein the historical attenuation coefficient nextatq updating rule is as follows: given nexttattq ═ NextQ.
Specifically, in the embodiment of the present invention, in step S5, the performing linear coefficient of change amplification processing on the Next frame data includes:
s506: entering a Next frame amplification processing system;
s507: acquiring parameters: the length Len of the data frame, the historical attenuation coefficient nextatq, and the auxiliary attenuation coefficient LogAttQ are obtained.
S508: parameter pretreatment: first, a target amplification factor is obtained:
Qup=NextQ/NextAttQ;
secondly, obtaining a step-up value:
StepUP=Qup/NGap;
s509: amplifying the data;
s510: and returning the processed data, and exiting the Next frame amplification processing system.
Specifically, in the embodiment of the present invention, in step S509, the operation formula for performing the amplification operation on the data is specifically:
Y′NEXT[n]=YNEXT[n]×(NextAttQ+n×StepUP)
in the formula: n is an element of [1, Len ∈];YNEXT[n]The method comprises the steps of directly obtaining NEXT frame data from a DSP; y'NEXT[n]Is YNEXT[n]And (4) data processed by the related joint.
Specifically, in the embodiment of the present invention, in step S6, the processing formula for performing the fixed coefficient attenuation processing on the Next frame data is as follows:
X′NEXT[n]=XNEXT[n]×NextAttQ
in the formula: xNEXT[n]Carrying out smoothing processing on the NEXT frame data of the NEXT frame; x'NEXT[n]Is XNEXT[n]And (4) data processed by the related joint.
Specifically, in the embodiment of the present invention, in step S7, the data buffers of the Next frame and the Last frame are directly exchanged, so that the time for copying the Next frame data into the Last frame can be eliminated, and the efficiency can be improved.
More specifically, for the audio data overflow phenomenon, the existing cancellation method mainly includes: directly cutting off the overflow part of the data; the overflow portion of the data is attenuated using a dynamically updated attenuation factor and the truncated portion of the audio is repaired using a predictive approach. However, the above mentioned method for preventing audio data from overflowing does not concern the jump between the truncated part and the non-truncated part, if it is used in a music device, the noise of "click" may occur, and the relative power ratio between the frequencies changes obviously, if the audio data has a serious overflow phenomenon, the repairing effect is not obvious.
The overflow prevention method for the audio DSP data provided by the invention uses a Next frame and a Last frame to obtain the audio data, and performs format conversion, DSP and overflow prevention processing on the data; in the Next frame, the attenuation coefficient NextQ is obtained, in contrast to the historical attenuation coefficient nextatq: if NextQ is less than NextAttQ, performing linear change coefficient attenuation processing on Last frame data, emptying a counter, then performing fixed coefficient attenuation processing on a Next frame, and updating a NextAttQ value; otherwise, adding one to the counter, and comparing the counter value CNT with the calculation threshold Nth: if Nth is larger than CNT, performing fixed coefficient attenuation processing on the Next frame; otherwise, the linear change coefficient amplification processing is carried out on the Next frame data, then the counter is cleared, and the nextatQ value is updated. And finally, outputting Last frame data, exchanging data buffer areas of the Last frame and the Next frame, and starting a new round of processing, thereby realizing the anti-overflow processing of data.
Therefore, as described above, the anti-overflow method for audio DSP data according to the embodiments of the present invention implements data anti-overflow processing by combining normalization operation with linear variation coefficient attenuation processing, linear variation coefficient amplification processing, and fixed coefficient attenuation processing, and meanwhile, gives consideration to smooth transition between frames of data, implements effective data recovery, and eliminates noise caused by too large jump between audio data. Compared with the prior art, the technical scheme of the invention can smoothly repair the data, has strong repair capability and more effectively realizes the anti-overflow processing of the data.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. An overflow prevention method for audio DSP data, which is characterized by comprising seven steps from step S1 to step S7, specifically:
s1: starting a counter, and cleaning historical parameters and data;
s2: acquiring audio data to be processed by using a Next frame and a Last frame;
s3: carrying out format conversion and integration on the audio data, and then carrying out DSP processing on the audio data;
s4: acquiring a damping coefficient NextQ, a historical damping coefficient NextAttQ and an auxiliary damping coefficient LogAttQ, and comparing the sizes of the historical damping coefficient NextAttQ and the damping coefficient NextQ;
s5: if NextQ is less than NextAttQ, updating a historical attenuation coefficient NextAttQ value and an auxiliary attenuation coefficient LogAttQ value, emptying a counter, performing linear change coefficient attenuation processing on Last frame data, and then entering step S6 to perform fixed coefficient attenuation processing;
if NextQ is larger than or equal to NextAttQ, adding one to the counter to obtain a counter value CNT and obtain a counter calculation threshold Nth; comparing the counter value CNT with the calculation threshold Nth: if Nth > CNT, go to step S6 to perform constant coefficient attenuation processing; if Nth is not greater than CNT, performing linear change coefficient amplification processing on Next frame data, resetting a counter and updating a historical attenuation coefficient NextAttQ, and then directly entering step S7 to output Last frame data;
s6: performing fixed coefficient attenuation processing on the Next frame data;
s7: and outputting the Last frame data, exchanging data buffers of the Last frame and the Next frame, and then jumping back to the step 2 to perform a new round of data anti-overflow processing.
2. The overflow prevention method for audio DSP data according to claim 1, wherein in step S3, the format conversion and integration of the audio data comprises: s301: the audio data is converted from integer to floating point.
3. The overflow prevention method for audio DSP data according to claim 1, wherein in step S4, said obtaining an attenuation coefficient NextQ comprises:
s401: obtaining the first M frames in the Next frame data processed by the DSPMaximum absolute value MAXiThe maximum absolute value is the maximum value after the absolute value of the data in the NEXT frame is taken, the average value NextMAX of the first M maximum absolute values is calculated, the maximum value MAXTH which can be expressed by the number of bits of the audio data is obtained, and the size of the NextMAX and the size of the MAXTH are compared;
s402: if NextMAX is less than or equal to MAXTH, directly entering step S5; if NextMAX > MAXTH, the attenuation coefficient NextQ is calculated as:
Figure FDA0003235501520000021
comparing the attenuation coefficient NextQ with the preset initial attenuation value AttTH, if NextQ > AttTH, the process proceeds to step S5 after giving NextQ ═ AttTH.
4. The overflow prevention method for audio DSP data according to claim 3, characterized in that the maximum value MAXTH that the number of bits of the audio data can represent is specifically expressed as:
MAXTH=2N-1
in the formula: n-the number of bits of the audio data.
5. The overflow preventing method for audio DSP data according to claim 4, wherein in step S5, said performing linear coefficient of variation attenuation processing on Last frame data comprises:
s501: entering a Last frame attenuation processing system;
s502: acquiring parameters: acquiring the length Len of a data frame, a reference stepping length StepMin, a historical attenuation coefficient NextAttQ and an auxiliary attenuation coefficient LogAttQ;
s503: parameter pretreatment: firstly, obtaining a target attenuation coefficient:
Figure FDA0003235501520000022
and acquiring the data length needing to be operated initially:
NGap=(1-Qseq)/StepMin;
second, the length of the NGap is processed: if NGap > Len multiplied by delta, the data length is too long, and the clipping operation is carried out: given NGap as Len × δ, δ is a proportionality coefficient of the length of the data frame, and the value range is [0.8,1 ]; if NGap < Len × δ, it indicates that the data length is too short, and the extension operation is performed: giving NGap ═ Numth, wherein Numth ═ Len/10;
finally, obtaining a coefficient stepping value:
StepDN=(1-Qseq)/NGap;
s504: carrying out smoothing operation on the data;
s505: and returning the processed data, and exiting the Last frame attenuation processing system.
6. The method as claimed in claim 5, wherein in step S502, the calculation formula of the reference step length StepMin is specifically:
StepMin=DOT/MAXTH
in the formula: DOT — depth of test, the DOT obtained from a single frequency audio test.
7. The overflow prevention method for audio DSP data according to claim 5, wherein in step S504, said operation formula for smoothing data is specifically:
Y′NEXT[n]=YNEXT[n]×(Qseq+(NGap-n)×StepDN)
in the formula: n belongs to [ Len-NGap, Len];YNEXT[n]The method comprises the steps of directly obtaining NEXT frame data from a DSP; y'NEXT[n]Is YNEXT[n]And (4) data processed by the related joint.
8. The overflow preventing method for audio DSP data according to claim 4, wherein in step S5, said performing linear coefficient of change amplification processing on Next frame data comprises:
s506: entering a Next frame amplification processing system;
s507: acquiring parameters: acquiring the length Len of a data frame, a historical attenuation coefficient NextAttQ and an auxiliary attenuation coefficient LogAttQ;
s508: parameter pretreatment: first, a target amplification factor is obtained:
Qup=NextQ/NextAttQ;
secondly, obtaining a step-up value:
StepUP=Qup/NGap;
s509: amplifying the data;
s510: and returning the processed data, and exiting the Next frame amplification processing system.
9. The overflow prevention method for audio DSP data according to claim 8, wherein in step S509, the operation formula for performing the amplification operation on the data is specifically:
Y′NEXT[n]=YNEXT[n]×(NextAttQ+n×StepUP)
in the formula: n is an element of [1, Len ∈];YNEXT[n]The method comprises the steps of directly obtaining NEXT frame data from a DSP; y'NEXT[n]Is YNEXT[n]And (4) data processed by the related joint.
10. The overflow preventing method for audio DSP data according to claim 5, wherein in step S6, the processing formula for performing the fixed coefficient attenuation processing on the Next frame data is:
X′NEXT[n]=XNEXT[n]×NextAttQ
in the formula: xNEXT[n]Carrying out smoothing operation on the NEXT frame data of the NEXT frame; x'NEXT[n]Is XNEXT[n]And (4) data processed by the related joint.
CN202110695718.7A 2021-06-23 2021-06-23 Anti-overflow method for audio DSP data Active CN113254251B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110695718.7A CN113254251B (en) 2021-06-23 2021-06-23 Anti-overflow method for audio DSP data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110695718.7A CN113254251B (en) 2021-06-23 2021-06-23 Anti-overflow method for audio DSP data

Publications (2)

Publication Number Publication Date
CN113254251A CN113254251A (en) 2021-08-13
CN113254251B true CN113254251B (en) 2021-10-22

Family

ID=77189278

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110695718.7A Active CN113254251B (en) 2021-06-23 2021-06-23 Anti-overflow method for audio DSP data

Country Status (1)

Country Link
CN (1) CN113254251B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW333610B (en) * 1997-10-16 1998-06-11 Winbond Electronics Corp The phonetic detecting apparatus and its detecting method
JP4151110B2 (en) * 1998-05-14 2008-09-17 ソニー株式会社 Audio signal processing apparatus and audio signal reproduction apparatus
CN102610235B (en) * 2011-12-22 2016-02-24 深圳万兴信息科技股份有限公司 Mixed audio processing method, device and smart machine
CN103021419A (en) * 2012-12-26 2013-04-03 大唐移动通信设备有限公司 Processing method and device for mixed audio
CN105719642A (en) * 2016-02-29 2016-06-29 黄博 Continuous and long voice recognition method and system and hardware equipment
CN112951197B (en) * 2021-04-02 2022-06-24 北京百瑞互联技术有限公司 Audio mixing method, device, medium and equipment

Also Published As

Publication number Publication date
CN113254251A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
JP4681163B2 (en) Howling detection and suppression device, acoustic device including the same, and howling detection and suppression method
EP2355548B1 (en) A method for the detection of whistling in an audio system
CN1223108C (en) Echo canceler employing multiple step gains
US8782110B2 (en) Signal processing system employing time and frequency domain partitioning
CN101577848B (en) Supper bass boosting method and system
JP4770440B2 (en) Signal processing apparatus and signal processing method
CN102164210A (en) Systems and methods for echo cancellation and echo suppression
CN105324982A (en) A method and apparatus for suppression of unwanted audio signals
JP2005236713A (en) Howling detecting method and device, and acoustic device equipped therewith
JP5422054B2 (en) Time domain / frequency domain integrated echo cancellation apparatus and method
JP4834046B2 (en) Echo erasing device, echo erasing method, echo erasing program, recording medium
CN113254251B (en) Anti-overflow method for audio DSP data
US6531969B2 (en) Resampling system and apparatus
EP0992978A1 (en) Noise reduction device and a noise reduction method
US8868417B2 (en) Handset intelligibility enhancement system using adaptive filters and signal buffers
US8478586B2 (en) Signal processing apparatus and method, and program
CN101292508A (en) Acoustic echo canceller
JP3493574B2 (en) Inverse quantization device and inverse quantization method
JP2006323230A (en) Noise level estimating method and device thereof
CN200966147Y (en) Voice power amplifier
CN108831497B (en) Echo compression method and device, storage medium and electronic equipment
JP2007235770A (en) Audio processing apparatus
JP2002140100A (en) Noise suppressing device
WO2006055354A2 (en) Adaptive time-based noise suppression
JP2001257629A (en) Digital grapho-metric equalizer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant