CN113643713A - Bluetooth audio coding method, device and storage medium - Google Patents

Bluetooth audio coding method, device and storage medium Download PDF

Info

Publication number
CN113643713A
CN113643713A CN202111189610.7A CN202111189610A CN113643713A CN 113643713 A CN113643713 A CN 113643713A CN 202111189610 A CN202111189610 A CN 202111189610A CN 113643713 A CN113643713 A CN 113643713A
Authority
CN
China
Prior art keywords
band signal
frame
full
partial
bandwidth
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.)
Granted
Application number
CN202111189610.7A
Other languages
Chinese (zh)
Other versions
CN113643713B (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.)
Barrot Wireless Co Ltd
Original Assignee
Barrot Wireless 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 Barrot Wireless Co Ltd filed Critical Barrot Wireless Co Ltd
Priority to CN202111189610.7A priority Critical patent/CN113643713B/en
Publication of CN113643713A publication Critical patent/CN113643713A/en
Application granted granted Critical
Publication of CN113643713B publication Critical patent/CN113643713B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/02Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis using spectral analysis, e.g. transform vocoders or subband vocoders

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Computational Linguistics (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The application discloses a Bluetooth audio coding method, a Bluetooth audio coding device and a Bluetooth audio coding storage medium, and belongs to the technical field of audio coding and decoding. The method mainly comprises the following steps: in the process of carrying out Bluetooth audio coding after the Bluetooth connection relation is established, before transient noise shaping coding, carrying out bandwidth detection on a current frame and judging whether the current frame is a full-band signal frame or a partial-band signal frame; counting the continuous occurrence times of full-band signal frames and the continuous occurrence times of partial-band signal frames respectively; when the transient signal appears, all the audio signal frames after the current frame are judged as the full-band signal frames or the partial-band signal frames according to the continuous occurrence times of the full-band signal frames, the continuous occurrence times of the partial-band signal frames and a preset frequency band counting threshold value. The power-saving device can save power, is simple in structure and is convenient to realize.

Description

Bluetooth audio coding method, device and storage medium
Technical Field
The present invention relates to the field of bluetooth transmission, audio coding and compression technologies, and in particular, to a bluetooth audio coding method, apparatus and storage medium.
Background
In the LC3 encoder, bandwidth detection is used to detect band-limited signals that require encoding using a higher sampling rate, for example, narrowband speech with a sampling rate of 8kHz and a maximum effective bandwidth of 4kHz, but which is up-sampled to 16kHz before being fed to the LC3 encoder, where the LC3 encoder encodes the narrowband speech using the relevant parameters at a sampling rate of 16kHz, but actually has a maximum effective bandwidth of 4 kHz. This phenomenon may cause the transient noise shaping module and the noise level estimation module of the LC3 encoder to calculate incorrectly, further causing noise to leak into the region without frequency spectrum, and reducing the sound quality. To solve this problem, the LC3 standard specification introduces bandwidth detection, which is performed on each frame signal during LC3 encoding to obtain the actual bandwidth corresponding to the current frame.
In the LC3 standard specification, bandwidth detection is performed on each frame of signal during encoding, but in actual use, after a bluetooth connection relationship is established once, the real bandwidth does not change suddenly during signal transmission. Therefore, in the encoding process, the calculation of bandwidth detection is performed on each frame of signal, which wastes the calculation power of the encoding process, and the repeated calculation of bandwidth detection reduces the encoding speed of the LC 3.
Disclosure of Invention
To solve the problems in the prior art, the present application mainly provides a bluetooth audio encoding method, apparatus and storage medium.
In order to achieve the above object, the present application adopts a technical solution that: there is provided a bluetooth audio encoding method, comprising: in the process of carrying out Bluetooth audio coding after the Bluetooth connection relation is established, before transient noise shaping coding, carrying out bandwidth detection on a current frame and judging whether the current frame is a full-band signal frame or a partial-band signal frame; counting the continuous occurrence times of full-band signal frames and the continuous occurrence times of partial-band signal frames respectively; when the transient signal appears, judging all audio signal frames behind the current frame as full-band signal frames or partial-band signal frames according to the continuous occurrence times of the full-band signal frames, the continuous occurrence times of the partial-band signal frames and a preset frequency band counting threshold value; the maximum bandwidth of the full band signal frame is half of the sampling rate of the full band signal frame, and the maximum bandwidth of the partial band signal frame is less than half of the sampling rate of the partial band signal frame.
Another technical scheme adopted by the application is as follows: there is provided a bluetooth audio encoding device, comprising: the bandwidth state judging module is used for detecting the bandwidth of the current frame and judging whether the current frame is a full-band signal frame or a partial-band signal frame before the transient noise shaping coding in the process of carrying out the Bluetooth audio coding after the Bluetooth connection relation is established; the continuous occurrence counting module is used for respectively counting the continuous occurrence times of full-band signal frames and the continuous occurrence times of partial-band signal frames; a subsequent audio signal bandwidth judgment module, configured to judge, when a transient signal occurs, all audio signal frames after a current frame as full-band signal frames or partial-band signal frames according to the continuous occurrence frequency of the full-band signal frames, the continuous occurrence frequency of partial-band signal frames, and a predetermined band count threshold; the maximum bandwidth of the full band signal frame is half of the sampling rate of the full band signal frame, and the maximum bandwidth of the partial band signal frame is less than half of the sampling rate of the partial band signal frame.
Another technical scheme adopted by the application is as follows: there is provided a computer readable storage medium storing computer instructions operable to perform the bluetooth audio encoding method of scheme one.
The technical scheme of the application can reach the beneficial effects that: the application designs a Bluetooth audio coding method, a Bluetooth audio coding device and a storage medium. The method can save the calculation power of the LC3 encoding process and accelerate the encoding rate of LC3 encoding.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a diagram of an embodiment of a Bluetooth audio encoding method of the present application;
FIG. 2 is a schematic diagram of a decision process flow of a Bluetooth audio encoding method of the present application;
fig. 3 is a schematic diagram of an embodiment of a bluetooth audio encoding apparatus according to the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
The following detailed description of the preferred embodiments of the present application, taken in conjunction with the accompanying drawings, will provide those skilled in the art with a better understanding of the advantages and features of the present application, and will make the scope of the present application more clear and definite.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Transient Noise Shaping, also known as Temporal Noise Shaping, TNS for short. The function is to perform predictive coding on the spectral data and noise shaping based on the predictive coding to improve the temporal resolution of the signal, so that the temporal shape of the quantization error can be adjusted at the output of the decoder to adapt to the temporal shape of the input signal. Transient noise shaping can effectively place quantization noise below the actual signal, thereby reducing pre-echo effects. Transient noise shaping is mainly performed on transient signals, where transient signals refer to signals in which energy in a front direction is low and energy in a sudden direction is high in a section of signals, and transient signals in this application refer to signals in which energy is suddenly changed from low to high.
The maximum bandwidth of the signal is half of the sampling frequency, which is called the full-band signal. For example, the sampling rate is 8kHz, and the maximum bandwidth is 4kHz, then the signal with the sampling rate of 8kHz is a full-band signal; the sampling rate is 48kHz, the maximum bandwidth is 24kHz, and the signal with the sampling rate of 48kHz is a full band signal.
Partial band signal: the signal with the maximum bandwidth of the signal less than half of the sampling frequency is called a partial frequency band signal. For example, the sampling rate is 16kHz, the maximum bandwidth thereof is 4kHz, and the signal with the sampling rate of 16kHz is a partial band signal; the sampling rate is 48kHz, the maximum bandwidth thereof is 4kHz, 8kHz, 12kHz, 16kHz, etc., and the signal whose sampling rate is 48kHz is a partial band signal.
Table 1 shows the relationship between the theoretical maximum bandwidth, i.e., the bandwidth calculated from the sampling rate of the signal, and the actual maximum bandwidth, i.e., the bandwidth detected by the bandwidth detector, in LC 3.
Figure 926157DEST_PATH_IMAGE001
TABLE 1
The abbreviations in table 1 are defined as follows:
NB: narrow band (Narrow frequency bandwidth), the sampling rate is 8kHz, and the bandwidth range is 0-4 kHz;
WB: wide band (Wide frequency band), the sampling rate is 16kHz, and the bandwidth range is 0-8 kHz;
SSWB: semi Super Wide Band (Semi ultra Wide Band), sampling rate 24kHz, bandwidth range 0-12 kHz;
SWB (Super Wide Band), a sampling rate of 32kHz and a bandwidth range of 0-16 kHz;
and FB is Full band, the sampling rate is 48kHz or 44.1kHz, and the bandwidth range is 0-20 kHz or 0-18.375 kHz.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Aiming at the problem of computational power waste caused by the fact that bandwidth detection is required to be performed on each frame of signal in the prior art, the bandwidth detection is performed on a small number of frames after the encoding is started by using the activation states of the bandwidth detection and the transient noise shaping, the current encoded audio signal is determined to be a full-band signal or a partial-band signal, and the bandwidth detection is not repeated in the encoding of the subsequent frames, so that the computational power is saved.
Fig. 1 shows an embodiment of a bluetooth audio encoding method according to the present application.
In the specific embodiment shown in fig. 1, the bluetooth audio encoding method mainly includes step S101, during the process of performing bluetooth audio encoding after the bluetooth connection relationship is established, before transient noise shaping encoding, performing bandwidth detection on a current frame and determining whether the current frame is a full band signal frame or a partial band signal frame;
step S102, counting the continuous occurrence frequency of the full frequency band signal frame and the continuous occurrence frequency of the partial frequency band signal frame respectively;
step S103, when the transient signal appears, according to the continuous occurrence frequency of the full-band signal frame, the continuous occurrence frequency of the partial-band signal frame and a preset frequency band counting threshold value, all the audio signal frames after the current frame are judged to be the full-band signal frame or the partial-band signal frame;
the maximum bandwidth of the full band signal frame is half of the sampling rate of the full band signal frame, and the maximum bandwidth of the partial band signal frame is less than half of the sampling rate of the partial band signal frame.
In one embodiment of the present application, in the prior art, after the bluetooth call connection is established, the encoder at the transmitting end needs to detect the bandwidth of each frame of the audio signal received by the encoder. According to the method and the device, the principle that the maximum bandwidth of an encoder is fixed after the Bluetooth connection relation is established is utilized, after the Bluetooth communication connection relation is established, the encoder of a transmitting end detects the bandwidth of audio signal frames which continuously appear in the audio signal and have the preset number of frames after receiving the audio signal, and the detection result is used as the actual bandwidth of the subsequent frames of the audio signal. And setting coding parameters by using the actual bandwidth of the audio signal, and completing coding of the subsequent frame of the audio signal, wherein the bandwidth detection of the subsequent audio frame is not required.
In the specific embodiment, the calculation power of the LC3 encoding process is saved and the encoding rate of LC3 encoding is accelerated by reducing the bandwidth detection times of the audio signal.
In the specific embodiment shown in fig. 1, the bluetooth audio encoding method includes step S101, during the bluetooth audio encoding process after the bluetooth connection relationship is established, before the transient noise shaping encoding, performing bandwidth detection on a current frame and determining whether the current frame is a full band signal frame or a partial band signal frame.
In a specific embodiment of the present application, after the bluetooth communication connection relationship is established, after an encoder at the transmitting end receives an audio signal, it is determined whether bandwidth detection is required for a current frame by using whether a bandwidth state of the current frame is known. When the bandwidth state pair of the current frame is unknown, whether the current frame is a full band signal frame or a partial band signal frame is detected by a bandwidth detector.
For example, fig. 2 determines whether the bandwidth state of the current frame is a known state or an unknown state using whether the value of the final bandwidth indication is 0 when the current frame of the audio signal is transmitted to the encoder, and whether the current frame is a full band signal frame or a partial band signal frame is unknown when the value of the final bandwidth indication is 0. When the final bandwidth indication value is not 0, it is known that the current frame is a full band signal frame or a partial band signal frame. When the previous frame is a full-band signal frame or a partial-band signal frame is unknown, checking whether the bandwidth state of the current frame is the full-band signal frame or the partial-band signal frame by using a bandwidth detector, wherein when the current frame is detected to be the full-band signal frame or the partial-band signal frame, the bandwidth state of the current frame is known; when it is unclear whether the current frame is a full-band signal frame or a partial-band signal frame, its bandwidth state is unknown.
In the embodiment, the bandwidth state of the current frame is judged, so that a foundation is laid for judging whether the bandwidth detection is needed to be carried out on the subsequent frame by utilizing the bandwidth state of the current frame.
In a specific embodiment of the present application, the subband energy of the current frame is calculated by using the spectral coefficient of the current frame, and the low energy flag of the current frame is obtained by using the subband energy of the current frame; calculating to obtain a bandwidth index corresponding to the current frame according to the low energy mark of the current frame; and calculating to obtain a bandwidth detection result of the current frame according to the bandwidth index, the sub-band energy and the bandwidth threshold value of the current frame.
Specifically, utilize
Figure 418318DEST_PATH_IMAGE002
Calculating the low energy mark of the current frame by a formula, wherein Ibw start and Ibw stop represent the initial sub-band number and the terminal sub-band number respectively, EB(n) is the subband energy, TQ(k) Is a low energy threshold, FQ(k) Is a low energy marker.
Using low energy tokens and formulas
Figure 472993DEST_PATH_IMAGE003
Calculating to obtain a bandwidth index corresponding to the current frame, wherein the value range of the bandwidth index is 0-NbwIs measured. And the relationship among the frame length, the starting subband, the terminating subband, the bandwidth, etc. of the current frame can be obtained from table 2.
Figure 810433DEST_PATH_IMAGE004
TABLE 2
By using
Figure 266954DEST_PATH_IMAGE005
Calculating to obtain the bandwidth detection result of the current frame, wherein TC(bw0) Is the threshold value, bw, of the current frame0Is the bandwidth index. When the above inequality condition is satisfied, the bandwidth of the current frame is bw0When the inequality condition is not satisfied, the bandwidth of the current frame is NbwWherein, TC={15,23,20,20},L={4,4,3,1}。
In particular, when the bandwidth index value is equal to the bandwidth threshold value, it is no longer used for saving calculation power
Figure 602120DEST_PATH_IMAGE006
The formula determines the bandwidth status.
In the embodiment, the bandwidth of the current frame is calculated, so that a foundation is laid for determining the bandwidth state of the audio signal by using the bandwidths of the continuous multiple frames.
In the embodiment shown in fig. 1, the bluetooth audio encoding method further includes step S102 of counting the number of consecutive occurrences of the full band signal frame and the partial band signal frame, respectively.
In a specific embodiment of the present application, the number of times of continuous occurrence of full band signal frames and the number of times of continuous occurrence of partial band signal frames in the audio signal are counted by using a full bandwidth counter and a partial bandwidth counter. Importantly, when the bandwidth of the current frame is detected for the first time, the values of the full bandwidth counter and the partial bandwidth counter need to be cleared to ensure the accuracy of the judgment result.
In one embodiment of the present application, if it is unknown whether the current frame is a full band signal frame or a partial band signal frame, the bandwidth detection is performed on the current frame. Updating a full bandwidth counter when the bandwidth detection result of the current frame is equal to half of the sampling rate of the current frame; and updating a part of bandwidth counters when the bandwidth detection result of the current frame is less than half of the sampling rate of the current frame.
In a specific embodiment of the present application, S102 further includes counting the number of consecutive occurrences of the full band signal frame and the number of consecutive occurrences of the partial band signal frame by using a full bandwidth counter and a partial bandwidth counter, respectively; if the judgment result of the current frame is the full-band signal frame, adding 1 to the full-band counter, and clearing 0 to the partial-band counter; if the judgment result of the current frame is a partial frequency band signal frame, the partial bandwidth counter is increased by 1, and the full bandwidth counter is cleared by 0.
Specifically, when the continuous multi-frame current frame of the audio signal is determined as a full-band signal frame and any one frame is not a partial-band signal frame in the continuous multi-frame current frame, the full-bandwidth counter counts the number of frames determined as the full-band signal frame. When the continuous multiframe current frames of the audio signal are judged to be partial band signal frames and any frame which is not a full band signal frame does not appear in the continuous multiframe current frames, counting the partial band counter according to the number of frames which are judged to be partial band signal frames. When any frame appears in the continuous multi-frame audio signal which is judged to be the full-band signal frame and is the partial-band signal frame, clearing the full-bandwidth counter and restarting to count the partial-bandwidth counter; when any frame appears in the continuous multi-frame audio signal which is judged to be the partial frequency band signal frame and is the full frequency band signal frame, the partial bandwidth counter is cleared, and counting of the full bandwidth counter is restarted.
The specific embodiment ensures the accuracy of the estimated audio signal bandwidth on the premise of ensuring the computational power of the encoder to be saved.
In the embodiment shown in fig. 1, the bluetooth audio encoding method further includes step S103, when the transient signal occurs, determining all audio signal frames after the current frame as full band signal frames or partial band signal frames according to the number of consecutive occurrences of the full band signal frames, the number of consecutive occurrences of the partial band signal frames, and a predetermined band count threshold value.
In a specific example of the present application, if the bandwidth state of the current frame is unknown, performing bandwidth detection on the current frame, updating a full bandwidth counter or a partial bandwidth counter according to a bandwidth detection result, then performing transient noise shaping processing on the current frame, and updating a continuous transient noise shaping activation counter according to a transient noise shaping result of the current frame, where when the number of times of continuous transient noise shaping activation is not less than a predetermined continuous transient noise shaping activation counter threshold value, it is determined that a transient signal occurs, that is, whether an audio signal is a transient signal is determined by using a value of the continuous transient noise shaping activation counter and a predetermined activation number threshold value.
Specifically, when the value of the continuous transient noise shaping activation counter is not less than the threshold value of the continuous transient noise shaping activation counter, and the continuous occurrence frequency of the full-band signal frame is not less than the predetermined band count threshold value, the bandwidth detection of the subsequent frame of the audio signal corresponding to the current frame is stopped, and all the audio signal frames after the current frame are determined to be the full-band signal frames; and when the value of the continuous transient noise shaping activation counter is not less than the threshold value of the continuous transient noise shaping activation counter and the continuous occurrence frequency of the partial frequency band signal frame is not less than the preset frequency band counting threshold value, stopping performing bandwidth detection on the subsequent frame of the audio signal corresponding to the current frame, and judging all the audio signal frames after the current frame as the partial frequency band signal frames.
In a specific embodiment of the present application, when the current frame is a noise signal or the current frame is a similar silence of an unmanned voice input when a voice call is made, the continuous transient noise shaping activation counter is not updated, and the bandwidth state of the subsequent frame of the audio signal encoded by the encoder is not determined according to the current frame.
And judging whether the current frame is a transient signal by utilizing transient noise shaping, and updating a continuous transient noise shaping activation counter when the current frame is the transient signal. The bandwidth judgment error caused by a noise signal or a similar mute signal can be avoided by judging the transient noise shaping activation state of the current frame, wherein the noise signal is a background noise signal which is not spoken by a user but exists in the Bluetooth communication process.
In the specific embodiment, transient noise shaping calculation is performed on the current frame and the continuous transient noise shaping activation counter is updated, so that the error judgment of the encoder on the actual bandwidth of the encoded voice signal when the signal corresponding to the current frame is a noise signal is avoided.
In a specific embodiment of the present application, the step S103 further includes, when the transient signal occurs, if the number of continuous occurrences of the full-band signal frame is not less than the predetermined band count threshold, stopping performing the bandwidth detection, and determining all audio signal frames after the current frame as the full-band signal frame; when the transient signal appears, if the continuous frequency of the partial frequency band signal frame is not less than the preset frequency band counting threshold value, stopping the bandwidth detection, and judging all audio signal frames behind the current frame as the partial frequency band signal frame; when the transient signal appears, if the continuous occurrence frequency of the full-band signal frame is less than the preset frequency band counting threshold value and the continuous occurrence frequency of the partial-band signal frame is less than the preset frequency band counting threshold value, the bandwidth detection of the current frame is continuously carried out, and the current frame is judged to be the full-band signal frame or the partial-band signal frame.
Specifically, when the value of the continuous transient noise shaping activation counter is not less than the threshold value of the continuous transient noise shaping activation counter, the continuous occurrence frequency of the full-band signal frame is less than the predetermined band count threshold value, and the continuous occurrence frequency of the partial-band signal frame is less than the predetermined band count threshold value, it is not possible to accurately determine whether the subsequent audio signal frame of the current frame is the full-band signal frame or the partial-band signal frame, and it is necessary to determine the bandwidth state of the subsequent audio signal frame of the current frame by using the bandwidth states of more current frames, so that it is necessary to continue the processing of performing bandwidth detection on the current frame and determining whether the current frame is the full-band signal frame or the partial-band signal frame.
The specific embodiment ensures the accuracy of judging whether the subsequent audio frame is a full-bandwidth signal frame or a partial-bandwidth signal frame, and avoids the judgment error.
In a specific example of the present application, a normalized autocorrelation result of a current frame is calculated using spectral coefficients of the current frame; calculating a windowing processing result of the normalized autocorrelation result of the current frame by using the normalized autocorrelation result; calculating a linear prediction coefficient of the current frame according to the windowing processing result, and calculating by using the linear prediction coefficient to obtain a linear prediction error; and calculating to obtain a prediction gain by using the linear prediction error, and updating a continuous transient noise shaping activation counter by using the prediction gain.
In particular, using formulae
Figure 393359DEST_PATH_IMAGE007
A normalized autocorrelation result for the current frame is calculated, wherein,
Figure 282293DEST_PATH_IMAGE008
and is
Figure 780270DEST_PATH_IMAGE009
And r (k) is a normalized autocorrelation value, and the correlation between the spectral coefficients is obtained by using r (k).
Using formulas
Figure 614234DEST_PATH_IMAGE010
And windowing the normalized autocorrelation values, wherein rw (k) is the result of the windowing, and r (k) is the normalized autocorrelation value. The non-ideality of the normalized autocorrelation result is solved by a windowing process.
And calculating a linear prediction coefficient according to the normalized autocorrelation value by using a standard Levinson-Durbin algorithm, and calculating a linear prediction error according to the linear prediction coefficient.
Finally, linear prediction error and formula are used
Figure 377922DEST_PATH_IMAGE011
Calculating a prediction gain, and
Figure 260427DEST_PATH_IMAGE012
and when the transient noise shaping is in an activated state, updating a continuous transient noise shaping activation counter.
In the embodiment, the transient noise shaping result of the current frame is obtained through operations such as normalized autocorrelation and the like, so that the accuracy of the encoder in judging the actual bandwidth of the encoded audio signal is improved by using the transient noise shaping result.
In an embodiment of the present application, the step S103 further includes, if the current frame is determined to be a full band signal frame, setting a relevant encoding parameter according to a sampling rate of the current frame to perform transient noise shaping encoding; and if the current frame is judged to be a partial frequency band signal frame, setting relevant coding parameters according to the maximum bandwidth of the current frame to perform transient noise shaping coding.
In a specific embodiment of the present application, as shown in fig. 2, when the value of the continuous transient noise shaping activation counter is not less than the threshold of the continuous transient noise shaping activation counter, at this time, according to the continuous full bandwidth counter, the continuous partial bandwidth counter, and the frequency band count threshold, that is, the bandwidth counter threshold, how to set the relevant encoding parameters when the audio signal frame is encoded can be obtained.
When the transient noise shaping is in an activated state and the value of the continuous full-bandwidth counter is not less than the threshold value of the bandwidth counter, all audio signal frames after the current frame are judged as full-band signals, and the transient noise shaping coding of the subsequent audio signal frames of the current frame is carried out by setting related coding parameters according to the sampling rate of the current frame;
and when the transient noise shaping is in an activated state and the value of the continuous partial width counter is not less than the threshold value of the bandwidth counter, judging all audio signal frames after the current frame as partial frequency band signals, and setting related coding parameters according to the maximum bandwidth of the current frame to perform transient noise shaping coding on the subsequent audio signal frames of the current frame. The frequency band counting threshold value is used for avoiding misjudgment, the value of the frequency band counting threshold value is not limited, and preferably, the threshold value is 3-5. And, the current frame is a transient signal when the transient noise shaping is an active state, and the current frame is a non-transient signal when the transient noise shaping active state is an inactive state.
The embodiment improves the accuracy of judging the audio signal coded by the coder, and lays a foundation for saving calculation power.
Particularly, when the full bandwidth counter is increased by 1, the partial bandwidth counter is not clear of 0, and when the partial bandwidth counter is increased by 1 and the full bandwidth counter is not clear of 0, when the frequency of the continuously appearing full band signal is not less than the preset frequency band counting threshold value and the frequency of the continuously appearing partial band signal is not less than the preset frequency band counting threshold value, the size of the frequency of the continuously appearing full band signal and the frequency of the continuously appearing partial band signal is judged, the bandwidth state of the frequency band signal with the large occurrence frequency is used as the estimated bandwidth state of all audio signal frames after the current frame, and the corresponding estimated bandwidth state is used for setting related coding parameters to perform transient noise shaping coding. When the encoding parameter is detected to be abnormal, adjusting the relevant encoding parameter; and when the encoding parameter is not detected to be abnormal, encoding the estimated bandwidth state as the actual bandwidth state.
For example, when the frequency of the continuously appearing full band signal is not less than the preset frequency band counting threshold value and the frequency of the continuously appearing partial band signal is not less than the preset frequency band counting threshold value, it is determined that the frequency of the continuously appearing full band signal is greater than the frequency of the continuously appearing partial band signal, and then the relevant encoding parameters are set according to the sampling rate of the current frame to perform transient noise shaping encoding. When the coding parameter is detected to be abnormal, adjusting the relevant coding parameter of the subsequent frame to set the relevant coding parameter according to the maximum bandwidth of the current frame to carry out transient noise shaping coding; and when the coding parameter abnormality is not detected, continuously setting related coding parameters according to the sampling rate of the current frame to perform transient noise shaping coding on the subsequent frame.
Particularly, when the frequency of the continuously appearing full-band signal is less than a preset frequency band counting threshold value and the frequency of the continuously appearing partial-band signal is less than the preset frequency band counting threshold value, the sizes of the frequency of the continuously appearing full-band signal and the frequency of the continuously appearing partial-band signal are judged, the bandwidth state of the frequency band signal with the large frequency of occurrence is used as the estimated bandwidth state of all audio signal frames after the current frame, and the corresponding estimated bandwidth state is used for setting related encoding parameters to perform transient noise shaping encoding. When the encoding parameter is detected to be abnormal, adjusting the relevant encoding parameter; and when the encoding parameter is not detected to be abnormal, encoding the estimated bandwidth state as the actual bandwidth state.
For example, when the frequency of the continuously appearing full band signal is less than the preset frequency band counting threshold value, and the frequency of the continuously appearing partial band signal is less than the preset frequency band counting threshold value, it is determined that the frequency of the continuously appearing full band signal is greater than the frequency of the continuously appearing partial band signal, and then the relevant encoding parameters are set according to the sampling rate of the current frame to perform transient noise shaping encoding. When the coding parameter is detected to be abnormal, adjusting the relevant coding parameter of the subsequent frame to set the relevant coding parameter according to the maximum bandwidth of the current frame to carry out transient noise shaping coding; and when the coding parameter abnormality is not detected, continuously setting related coding parameters according to the sampling rate of the current frame to perform transient noise shaping coding on the subsequent frame.
The specific embodiment saves the calculation power of the LC3 encoding process and accelerates the encoding rate of LC3 encoding by reducing the bandwidth detection times of the audio signal.
In a specific embodiment of the present application, S103 further includes determining that a transient signal occurs when the number of consecutive transient noise shaping activations is not less than a predetermined activation number threshold.
In a specific embodiment of the present application, when transient noise shaping is in an active state, a continuous transient noise shaping activation counter is updated, when the value of the continuous transient noise shaping activation counter is greater than an activation number threshold, it is determined that a current frame is a transient signal, and when the transient signal occurs, the bandwidth state of a subsequent frame is determined according to a full bandwidth counter and a partial bandwidth counter. Generally, the probability that a transient signal occurs continuously in a segment of an audio signal is not large.
Preferably, the continuous transient noise shaping activation counter threshold is set to 1.
The specific embodiment improves the accuracy of the judgment of the encoder, and avoids the coding error caused by the judgment error of the bandwidth of the audio signal.
In a specific embodiment of the present application, after determining the bandwidth of the audio signal encoded by the encoder by using the continuous multi-frame signal in the audio signal, the encoder does not perform bandwidth detection when encoding the subsequent frame of the encoded audio signal, and directly encodes the subsequent frame by using the bandwidth state obtained by the determination.
This particular embodiment saves the amount of computation of the encoder in the detection of the bandwidth of the encoding of the audio signal.
In order to better describe the idea of the present application, the implementation process of the present application is embodied in two specific embodiments.
For example, a segment of an audio signal has a sampling rate of 16kHz and a maximum effective bandwidth of 4kHz, i.e., the segment of the audio signal is a partial band signal. When transient noise shaping is the first occurrence of the active state, the value of the continuous full bandwidth counter is 1 and the continuous partial bandwidth counter is 0. When transient noise shaping is the fourth occurrence of the active state, the value of the continuous full bandwidth counter is 0 and the value of the continuous partial bandwidth counter is 3. Thus, the segment of the audio signal is a partial bandwidth signal, whose bandwidth detection is skipped when encoding the subsequent audio signal.
For example, a segment of the audio signal has a sampling rate of 16kHz and a maximum effective bandwidth of 8kHz, i.e., the segment of the audio signal is a full band signal. When transient noise shaping is the first occurrence of the active state, the value of the continuous full bandwidth counter is greater than 3 and the value of the continuous partial bandwidth counter is 0. Thus, the segment of the audio signal is a full bandwidth signal, and its bandwidth detection is skipped when encoding the subsequent audio signal.
Fig. 3 shows an embodiment of a bluetooth audio encoding apparatus according to the present application.
In the embodiment shown in fig. 3, the bluetooth audio encoding apparatus mainly includes: a bandwidth state determining module 301, configured to perform bandwidth detection on a current frame and determine whether the current frame is a full-band signal frame or a partial-band signal frame before transient noise shaping coding in a process of performing bluetooth audio coding after a bluetooth connection relationship is established;
a continuous occurrence counting module 302, configured to count the continuous occurrence times of full band signal frames and the continuous occurrence times of partial band signal frames respectively;
a subsequent audio signal bandwidth determining module 303, configured to determine, when the transient signal occurs, all audio signal frames after the current frame as full-band signal frames or partial-band signal frames according to the continuous occurrence frequency of the full-band signal frames, the continuous occurrence frequency of the partial-band signal frames, and a predetermined band counting threshold;
the maximum bandwidth of the full band signal frame is half of the sampling rate of the full band signal frame, and the maximum bandwidth of the partial band signal frame is less than half of the sampling rate of the partial band signal frame.
In an embodiment of the application, the bluetooth audio encoding apparatus further includes a module, configured to, when the transient signal occurs, if the number of times of the full-band signal frames that continuously occur is less than a predetermined band count threshold value, and the number of times of the partial-band signal frames that continuously occur is less than the predetermined band count threshold value, continue performing bandwidth detection on the current frame, and determine whether the current frame is the full-band signal frame or the partial-band signal frame.
In a specific embodiment of the present application, the continuous encoding module is configured to set a relevant encoding parameter according to a sampling rate of a current frame to perform transient noise shaping encoding if the current frame is determined to be a full-band signal frame; and if the current frame is judged to be a partial frequency band signal frame, setting relevant coding parameters according to the maximum bandwidth of the current frame to perform transient noise shaping coding.
The bluetooth audio encoding apparatus provided in the present application can be used to execute the bluetooth audio encoding method described in any of the above embodiments, and the implementation principle and technical effect thereof are similar, and are not described herein again.
In another embodiment of the present application, a computer-readable storage medium stores computer instructions that are operable to perform the bluetooth audio encoding method described in the above embodiments.
In a specific embodiment of the present application, the functional modules in a bluetooth audio coding method of the present application may be directly in hardware, in a software module executed by a processor, or in a combination of the two.
A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium.
The Processor may be a Central Processing Unit (CPU), other general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), other Programmable logic devices, discrete Gate or transistor logic, discrete hardware components, or any combination thereof. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and all equivalent structural changes made by using the contents of the specification and the drawings, which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (8)

1. A bluetooth audio encoding method, comprising:
in the process of carrying out Bluetooth audio coding after the Bluetooth connection relation is established, carrying out bandwidth detection on a current frame and judging whether the current frame is a full-band signal frame or a partial-band signal frame before transient noise shaping coding;
counting the continuous occurrence times of the full frequency band signal frames and the continuous occurrence times of the partial frequency band signal frames respectively;
when a transient signal appears, judging all audio signal frames after the current frame as the full-band signal frames or the partial-band signal frames according to the continuous occurrence times of the full-band signal frames, the continuous occurrence times of the partial-band signal frames and a preset frequency band counting threshold value;
the maximum bandwidth of the full band signal frame is half of the sampling rate of the full band signal frame, and the maximum bandwidth of the partial band signal frame is less than half of the sampling rate of the partial band signal frame.
2. The Bluetooth audio encoding method of claim 1, wherein the process of counting the number of consecutive occurrences of the full band signal frame and the partial band signal frame, respectively, comprises,
counting the continuous occurrence times of the full frequency band signal frames and the continuous occurrence times of the partial frequency band signal frames by using a full bandwidth counter and a partial bandwidth counter respectively;
if the judgment result of the current frame is the full-band signal frame, adding 1 to the full-bandwidth counter, and clearing 0 to the partial-bandwidth counter;
and if the judgment result of the current frame is the partial frequency band signal frame, adding 1 to the partial bandwidth counter, and clearing 0 from the full bandwidth counter.
3. The Bluetooth audio encoding method of claim 2, wherein the determining, when the transient signal occurs, all audio signal frames after the current frame as the full band signal frame or the partial band signal frame according to the number of consecutive occurrences of the full band signal frame, the number of consecutive occurrences of the partial band signal frame, and a predetermined band count threshold value comprises,
when a transient signal appears, if the continuous occurrence frequency of the full-band signal frame is not less than the preset band counting threshold value, stopping bandwidth detection, and judging all the audio signal frames after the current frame as the full-band signal frames;
when a transient signal appears, if the continuous occurrence frequency of the partial frequency band signal frame is not less than the preset frequency band counting threshold value, stopping bandwidth detection, and judging all the audio signal frames after the current frame as the partial frequency band signal frames;
when the transient signal appears, if the continuous occurrence frequency of the full-band signal frame is less than the predetermined frequency band counting threshold value, and the continuous occurrence frequency of the partial-band signal frame is less than the predetermined frequency band counting threshold value, continuing the processing of performing bandwidth detection on the current frame and judging whether the current frame is the full-band signal frame or the partial-band signal frame.
4. The Bluetooth audio encoding method of claim 1, further comprising,
if the current frame is judged to be the full-band signal frame, setting related coding parameters according to the sampling rate of the current frame to carry out transient noise shaping coding;
and if the current frame is judged to be the partial frequency band signal frame, setting the relevant coding parameters according to the maximum bandwidth of the current frame to carry out transient noise shaping coding.
5. The bluetooth audio coding method according to claim 1, wherein the transient signal is determined to occur when the number of activation times of the continuous transient noise shaping is not less than a preset activation time threshold.
6. A bluetooth audio encoding apparatus, comprising:
the bandwidth state judging module is used for detecting the bandwidth of the current frame and judging whether the current frame is a full-band signal frame or a partial-band signal frame before transient noise shaping coding in the process of carrying out Bluetooth audio coding after the Bluetooth connection relation is established;
the continuous occurrence counting module is used for respectively counting the continuous occurrence times of the full frequency band signal frames and the continuous occurrence times of the partial frequency band signal frames;
a subsequent audio signal bandwidth judgment module, configured to judge, when a transient signal occurs, all audio signal frames after the current frame as the full-band signal frame or the partial-band signal frame according to the consecutive occurrence number of the full-band signal frame, the consecutive occurrence number of the partial-band signal frame, and a predetermined band count threshold value;
the maximum bandwidth of the full band signal frame is half of the sampling rate of the full band signal frame, and the maximum bandwidth of the partial band signal frame is less than half of the sampling rate of the partial band signal frame.
7. The Bluetooth audio encoding apparatus of claim 6, further comprising,
a continuous coding module, configured to set a relevant coding parameter according to a sampling rate of the current frame to perform the transient noise shaping coding if the current frame is determined to be the full-band signal frame; and if the current frame is judged to be the partial frequency band signal frame, setting the relevant coding parameters according to the maximum bandwidth of the current frame to carry out transient noise shaping coding.
8. A computer readable storage medium storing computer instructions, wherein the computer instructions are operable to perform the bluetooth audio encoding method of any of claims 1-5.
CN202111189610.7A 2021-10-13 2021-10-13 Bluetooth audio coding method, device and storage medium Active CN113643713B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111189610.7A CN113643713B (en) 2021-10-13 2021-10-13 Bluetooth audio coding method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111189610.7A CN113643713B (en) 2021-10-13 2021-10-13 Bluetooth audio coding method, device and storage medium

Publications (2)

Publication Number Publication Date
CN113643713A true CN113643713A (en) 2021-11-12
CN113643713B CN113643713B (en) 2021-12-24

Family

ID=78426423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111189610.7A Active CN113643713B (en) 2021-10-13 2021-10-13 Bluetooth audio coding method, device and storage medium

Country Status (1)

Country Link
CN (1) CN113643713B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111344784A (en) * 2017-11-10 2020-06-26 弗劳恩霍夫应用研究促进协会 Controlling bandwidth in an encoder and/or decoder
CN111429925A (en) * 2020-04-10 2020-07-17 北京百瑞互联技术有限公司 Method and system for reducing audio coding rate
US20200265850A1 (en) * 2017-11-10 2020-08-20 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Temporal noise shaping
CN112735449A (en) * 2020-12-30 2021-04-30 北京百瑞互联技术有限公司 Audio coding method and device for optimizing frequency domain noise shaping

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111344784A (en) * 2017-11-10 2020-06-26 弗劳恩霍夫应用研究促进协会 Controlling bandwidth in an encoder and/or decoder
US20200265850A1 (en) * 2017-11-10 2020-08-20 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Temporal noise shaping
CN111429925A (en) * 2020-04-10 2020-07-17 北京百瑞互联技术有限公司 Method and system for reducing audio coding rate
CN112735449A (en) * 2020-12-30 2021-04-30 北京百瑞互联技术有限公司 Audio coding method and device for optimizing frequency domain noise shaping

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
BISWAS, A 等: "Temporal Noise Shaping with Companding", 《19TH ANNUAL CONFERENCE OF THE INTERNATIONAL SPEECH COMMUNICATION ASSOCIATION (INTERSPEECH 2018)》 *

Also Published As

Publication number Publication date
CN113643713B (en) 2021-12-24

Similar Documents

Publication Publication Date Title
US11756576B2 (en) Classification of audio signal as speech or music based on energy fluctuation of frequency spectrum
CN103117067B (en) Voice endpoint detection method under low signal-to-noise ratio
US20220375493A1 (en) Method and Device for Voice Activity Detection
CN113724725B (en) Bluetooth audio squeal detection suppression method, device, medium and Bluetooth device
JP7160790B2 (en) Harmonic dependent control of harmonic filter tools
US9253568B2 (en) Single-microphone wind noise suppression
KR20200052983A (en) Method and apparatus for controlling audio frame loss concealment
US10339961B2 (en) Voice activity detection method and apparatus
US20050261892A1 (en) Audio encoding with different coding models
US8095361B2 (en) Method and device for tracking background noise in communication system
JP2009545779A (en) System, method and apparatus for signal change detection
US20190189134A1 (en) Method for Encoding Multi-Channel Signal and Encoder
US11587572B2 (en) Stereo signal encoding method and apparatus
US9280982B1 (en) Nonstationary noise estimator (NNSE)
US11094332B2 (en) Low-complexity tonality-adaptive audio signal quantization
CN112735449B (en) Audio coding method and device for optimizing frequency domain noise shaping
CN113643713B (en) Bluetooth audio coding method, device and storage medium
WO2013017018A1 (en) Method and apparatus for performing voice adaptive discontinuous transmission
CN112599140A (en) Method, device and storage medium for optimizing speech coding rate and operand
WO2003065352A1 (en) Method and apparatus for speech detection using time-frequency variance
CN112992166B (en) Method, device and storage medium for dynamically adjusting LC3 audio coding rate
JP2656069B2 (en) Voice detection device
CN112002338A (en) Method and system for optimizing audio coding quantization times
CN114420148A (en) Howling detection and suppression method, device, medium and equipment
CN116884423A (en) Reverberation detection and suppression method, system, medium and equipment

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: A1009, floor 9, block a, No. 9, Shangdi Third Street, Haidian District, Beijing 100085

Patentee after: Beijing Bairui Internet Technology Co.,Ltd.

Address before: A1009, floor 9, block a, No. 9, Shangdi Third Street, Haidian District, Beijing 100085

Patentee before: BARROT WIRELESS Co.,Ltd.