Method and device for audio band-width detection and audio band-width switching in an audio codec
A method and device detect, in an encoder part of a sound codec, an audio band-width of a sound signal to be coded. The device comprises an analyser of the sound signal and a final audio band-width decision module for delivering a final decision about the detected audio band-width using the result of the analysis of the sound signal. In the encoder part, the final audio band-width decision module is located upstream of the sound signal analyser. Also, a method and device switch from a first audio band-width to a second audio band-width of the sound signal. In the encoder part, the device comprises a final audio band-width decision module for delivering a final decision about a detected audio band-width of the sound signal to be coded, a counter of frames where audio band-width switching occurs in response to the detected audio band-width final decision, and an attenuator responsive to the counter of frames for attenuating the sound signal prior to encoding there of.
1 . A device for detecting, in an encoder part of a sound codec including a sound signal front pre-processing stage followed by a sound signal MDCT (Modified Discrete Cosine Transform) core encoding stage, an audio band-width of a sound signal to be coded, comprising:
at least one processor; and
a memory coupled to the processor and storing non-transitory instructions that when executed cause the processor to implement:
an analyser of the sound signal, integrated to the MIDCT core encoding stage, for analysing a MDCT spectrum of the sound signal; and
a final audio band-width decision module integrated to the front pre-processing stage for delivering a final decision about the detected audio band-width using the result of the analysis of the MIDCT spectrum of the sound signal;
wherein, in the encoder part of the sound codec, the final audio band-width decision module integrated to the front pre-processing stage is located upstream of the sound signal analyser integrated to the MDCT core encoding stage and wherein, in operation, the result of the analysis of the MIDCT spectrum of the sound signal by the sound signal analyser in a current frame is used by the final audio band-width decision module in a next frame following the current frame to deliver the final decision about the detected audio band-width of the sound signal.
2 . The audio band-width detecting device according to claim 1 , wherein the sound signal analyser calculates mean values of an energy of the MDCT spectrum of the sound signal in a number of spectral regions.
3 . The audio band-width detecting device according to claim 1 , wherein the sound signal analyser calculates maximum values of an energy of the MDCT spectrum of the sound signal in a number of spectral regions.
4 . The audio band-width detecting device according to claim 1 , wherein the sound signal analyser calculates mean and maximum values of an energy of the MDCT spectrum of the sound signal in a number of spectral regions.
5 . The audio band-width detecting device according to claim 4 , wherein the sound signal analyser calculates the energy of the MDCT spectrum of the sound signal in a plurality of frequency bands, wherein the spectral regions are each defined by at least one of the frequency bands, and wherein the sound signal analyser uses the calculated energy of the MDCT spectrum of the sound signal in the frequency bands to calculate the mean and maximum values of the energy of the MDCT spectrum.
6 . The audio band-width detecting device according to claim 4 , wherein the sound signal analyser calculates long-term values of the mean energy values of the MDCT spectrum of the sound signal in regions amongst the number of spectral regions.
7 . The audio band-width detecting device according to claim 6 , wherein the sound signal analyser increases or decreases counters related to the respective spectral regions in response to the long-term values of the mean energy values of the MDCT spectrum of the sound signal and the maximum values of the energy of the MIDCT spectrum of the sound signal.
8 . The audio band-width detecting device according to claim 7 , wherein the final audio band-width decision module uses a decision logic for switching between audio band-widths, in response to comparison between the counters and given thresholds.
9 . The audio band-width detecting device according to claim 8 , wherein the decision logic of the final audio band-width decision module is also responsive to a previously decided audio band-width.
10 . The audio band-width detecting device according to claim 8 , wherein the final audio band-width decision module uses a hysteresis to avoid frequent switching between audio band-widths.
11 . The audio band-width detecting device according to claim 10 , wherein the hysteresis used by the final audio band-width decision module is shorter in case of a potential switching from a lower audio band-width to a higher audio band-width, and longer in case of a potential switching from a higher audio band-width to a lower audio band-width.
12 . The audio band-width detecting device according to claim 4 , wherein the sound signal analyser updates counters related to the spectral regions.
13 . The audio band-width detecting device according to claim 1 , wherein the sound signal analyser performs sound signal analysis in frames of a given duration and skips sound signal analysis in frames longer and shorter than said given duration.
14 . The audio band-width detecting device according to claim 1 , wherein the sound signal is a multi-channel signal including a plurality of channels, and wherein the final audio band-width decision module codes the detected audio band-widths of the channels as a joint parameter.
15 . The audio band-width detecting device according to claim 1 , wherein, in a MDCT stereo mode, the sound signal analyser analyses the MDCT spectrum of the sound signal in the MDCT core encoding stage of the encoder part of the sound codec instead of calculating in the sound signal front pre-processing stage of the encoder part of the sound codec CLDFB (Complex Low Delay Filter Bank) values not needed in the MDCT stereo mode.
16 . A method for detecting, in an encoder part of a sound codec including a sound signal front pre-processing stage followed by a sound signal MDCT (Modified Discrete Cosine Transform) core encoding stage, an audio band-width of a sound signal to be coded, comprising:
in the MDCT core encoding stage, analysing a MDCT spectrum of the sound signal; and
in the front pre-processing stage, finally deciding about the detected audio band-width using the result of the analysis of the MIDCT spectrum of the sound signal;
wherein, in the encoder part of the sound codec, finally deciding in the front pre-processing stage about the detected audio band-width of the sound signal is made upstream of the analysis of the MDCT spectrum of the sound signal in the MDCT core encoding stage and wherein, in operation, the result of the analysis of the MDCT spectrum of the sound signal in a current frame in the MIDCT core encoding stage is used in a next frame following the current frame in the front pre-processing stage to finally decide about the detected audio band-width of the sound signal.
17 . The audio band-width detecting method according to claim 16 , wherein the analysis of the MIDCT spectrum of the sound signal comprises calculating mean values of an energy of the MDCT spectrum of the sound signal in a number of spectral regions.
18 . The audio band-width detecting method according to claim 16 , wherein the analysis of the MDCT spectrum of the sound signal comprises calculating maximum values of an energy of the MDCT spectrum of the sound signal in a number of spectral regions.
19 . The audio band-width detecting method according to claim 16 , wherein the analysis of the MIDCT spectrum of the sound signal comprises calculating mean and maximum values of an energy of the MDCT spectrum of the sound signal in a number of spectral regions.
20 . The audio band-width detecting method according to claim 19 , wherein the analysis of the MDCT spectrum of the sound signal comprises calculating the energy of the MDCT spectrum of the sound signal in a plurality of frequency bands, wherein the spectral regions are each defined by at least one of the frequency bands, and wherein the analysis of the sound signal comprises using the calculated energy of the MDCT spectrum of the sound signal in the frequency bands to calculate the mean and maximum values of the energy of the MDCT spectrum.
21 . The audio band-width detecting method according to claim 19 , wherein the analysis of the MDCT spectrum of the sound signal comprises calculating long-term values of the mean energy values of the MDCT spectrum of the sound signal in regions amongst the number of spectral regions.
22 . The audio band-width detecting method according to claim 21 , wherein the analysis of the sound signal comprises increasing or decreasing counters related to the respective spectral regions in response to the long-term values of the mean energy values of the MDCT spectrum of the sound signal and the maximum values of the energy of the MDCT spectrum of the sound signal.
23 . The audio band-width detecting method according to claim 22 , wherein the final decision about the detected audio band-width comprises using a decision logic for switching between audio band-widths, in response to comparison between the counters and given thresholds.
24 . The audio band-width detecting method according to claim 23 , wherein the decision logic is also responsive to a previously decided audio band-width.
25 . The audio band-width detecting method according to claim 23 , wherein the final decision about the detected audio band-width comprises using a hysteresis to avoid frequent switching between audio band-widths.
26 . The audio band-width detecting method according to claim 25 , wherein the hysteresis used by the final decision about the detected audio band-width is shorter in case of a potential switching from a lower audio band-width to a higher audio band-width, and longer in case of a potential switching from a higher audio band-width to a lower audio band-width.
27 . The audio band-width detecting method according to claim 19 , wherein the analysis of the MDCT spectrum of the sound signal comprises updating counters related to the spectral regions.
28 . The audio band-width detecting method according to claim 16 , wherein the analysis of the MDCT spectrum sound signal is performed in frames of a given duration and is skipped in frames longer and shorter than said given duration.
29 . The audio band-width detecting method according to claim 16 , wherein the sound signal is a multi-channel signal including a plurality of channels, and wherein the final decision about the detected audio band-width comprises coding the detected audio band-widths of the channels as a joint parameter.
30 . The audio band-width detecting method according to claim 16 , wherein, in a MDCT stereo mode, the MDCT spectrum of the sound signal is analysed in the sound signal MDCT core encoding stage of the encoder part of the sound codec instead of calculating in the sound signal front pre-processing stage of the encoder part of the sound codec CLDFB (Complex Low Delay Filter Bank) values not needed in the MDCT stereo mode.