Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: SBC: Intuition of audio impact of subbands? (Read 2521 times)
0 Members and 1 Guest are viewing this topic.

SBC: Intuition of audio impact of subbands?

2019-12-28 17:46:42
It has been some 25 years since I worked with digital filters, transforms and the such, but still have some basic intuition of how they work.

SBC has many parameters that impact its audio performance, but the parameter that I most lack intuition for the subband number.  It is clear from equations describing SBC that the bitrate of SBC doubles if you reduce the number of subbands by half.  It seems that halving the subbands means that each subband doubles its frequency range, and if you were somehow able to keep the same final bitrate, you would have 2x the bits to characterize the signal in that 2x larger frequency band. Given that SBC can move bits between the subbands, such a scheme would not intuitively significantly change audio performance.  But like I said before, halving the subbands in SBC doubles the bitrate, which in my intuition should have a positive impact on audio performance.

It feels like I missing something trivially simple.  Can anyone point me in a useful direction?

Re: SBC: Intuition of audio impact of subbands?

Quote
It is clear from equations describing SBC that the bitrate of SBC doubles if you reduce the number of subbands by half.

Don't know anything about SBC, but that sounds very strange. Are you sure?

Quote
such a scheme would not intuitively significantly change audio performance.

Why do you think that? Changing the resolution of your subband decomposition should change the efficiency with which bits are allocated.

Re: SBC: Intuition of audio impact of subbands?

Quote
It is clear from equations describing SBC that the bitrate of SBC doubles if you reduce the number of subbands by half.

Don't know anything about SBC, but that sounds very strange. Are you sure?

Yep.

Code: [Select]
`Bit Rate (bit_rate) is calculated using the following equation:bit_rate = 8 * frame_length* fs / nrof_subbands / nrof_blocks,where fs, nrof_subbands and nrof_blocks denote sampling frequency, number ofsubbands and number of blocks, respectively.[https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=303201, Sec 12.9] `

Re: SBC: Intuition of audio impact of subbands?

You're misunderstanding what that equation says. If the number of subbands is halved, then the sampling rate would be halved too (or you'd have to make each subband twice as big).

Re: SBC: Intuition of audio impact of subbands?

You're misunderstanding what that equation says. If the number of subbands is halved, then the sampling rate would be halved too (or you'd have to make each subband twice as big).

Actually, since I posted my question, I have studied the SBC standard carefully.  I find Section 2.1 of
https://pdfs.semanticscholar.org/1f19/561d03bc88b67728375566c95bbf77e730d5.pdf to be the easiest way to understand.  At the end of the section, you will see the equation for bitrate, which mirrors my earlier claim.

FWIW, you are correct in a sense.  Halving the subband number does make the subband twice as wide.  However, SBC can best be understood as more of a time-domain transformation.  The compressed audio data is represented in BLOCKS x BITPOOL bits, as well as scaling factors and headers/overhead.  However, that packet represents SUBBAND x BLOCKS samples of audio data.  So, you have roughly the same size bluetooth audio packet, but sent twice as frequently if you half the number of SUBBANDS.

The referenced report also reports human listening tests.  Unsurprisingly, the humans preferred combinations that included 4 subbands over the samples with 8 subbands, e.g. Figures 5.2 and 5.4.  With nearly 2x the bitrate, I would be surprised by any other result.

Re: SBC: Intuition of audio impact of subbands?

You're misunderstanding what that equation says. If the number of subbands is halved, then the sampling rate would be halved too (or you'd have to make each subband twice as big).

Actually, since I posted my question, I have studied the SBC standard carefully.  I find Section 2.1 of
https://pdfs.semanticscholar.org/1f19/561d03bc88b67728375566c95bbf77e730d5.pdf to be the easiest way to understand.  At the end of the section, you will see the equation for bitrate, which mirrors my earlier claim.

In a subband coder, the number of subbands determines the time/frequency resolution, but generally the quantization is set independently since it happens after the subband decomposition. Hence the bitrate is set independently of the time/frequency resolution. Just quickly looking at your link, SBC works that way too.

The referenced report also reports human listening tests.

It doesn't report human listening tests, it reports PEAQ scores.

Unsurprisingly, the humans preferred combinations that included 4 subbands over the samples with 8 subbands, e.g. Figures 5.2 and 5.4.  With nearly 2x the bitrate, I would be surprised by any other result.

I think you are really confused. Figure 5.2 and 5.4 show the optimal coding method according to PEAQ as a function of delay. It shows the expected results for a subband codec, with more subbands leading to better compression but more delay.  As for which human listeners would prefer, you'd have to ask them

Re: SBC: Intuition of audio impact of subbands?

You should probably have stopped there.

Re: SBC: Intuition of audio impact of subbands?

You should probably have stopped there.

I think if you don't want the answer you probably shouldn't have asked here.

No, I mean I think you still do not know anything about SBC.  If you did, you would understand why halving the subbands would roughly double the bitrate.  As you keep arguing that is wrong, it is clear you are guessing.  And guessing poorly.

Re: SBC: Intuition of audio impact of subbands?

You should probably have stopped there.

I think if you don't want the answer you probably shouldn't have asked here.

No, I mean I think you still do not know anything about SBC.  If you did, you would understand why halving the subbands would roughly double the bitrate.  As you keep arguing that is wrong, it is clear you are guessing.  And guessing poorly.

FWIW I've worked on a few different subband codecs, so I actually have a fair amount of first hand knowledge. You don't have to benefit from my experience, but at least be respectful. I am taking the time to look at your links and try to help you.

And no, I'm not guessing, I skimmed your link above and now I know.

I mean if you want correct answers. If you just want to believe you already know everything, this is a bad place to be.

Re: SBC: Intuition of audio impact of subbands?

You should probably have stopped there.

I think if you don't want the answer you probably shouldn't have asked here.

No, I mean I think you still do not know anything about SBC.  If you did, you would understand why halving the subbands would roughly double the bitrate.  As you keep arguing that is wrong, it is clear you are guessing.  And guessing poorly.

FWIW I've worked on a few different subband codecs, so I actually have a fair amount of first hand knowledge. You don't have to benefit from my experience, but at least be respectful. I am taking the time to look at your links and try to help you.

And no, I'm not guessing, I skimmed your link above and now I know.

I mean if you want correct answers. If you just want to believe you already know everything, this is a bad place to be.

Let's review:

I posted my question, asking for intuition on why decreasing the subbands of SBC from 8 to 4 (i.e. halving the subbands, and really the only two subband values discussed in the standard) would double the bit rate. You said you didn't know about SBC but thought my claim was mistaken.

I posted the equation supporting my original claim,  with citation (the standard in which SBC is defined).  Then you said I misunderstood what I posted.

Realizing that I would likely not be getting much help from you, I decided to find the answer myself.  In my next post, I explained why, in this particular codec (the codec literally required in every bluetooth a2dp receiver), halving the subbands resulted in roughly the same same size coded message being sent twice as frequently in time.  I made an aside about a later graph in one of my references reinforced (not proved) my argument.  You responded by ignoring what I wrote and shared your general understanding of subband coders, then shifted your attention to my throw-away line.  That was a tangent, and not worth further discussing.  Still, you showed no understanding that, in SBC, when you half the subbands, you roughly double the bit rate.

I'm sorry.  What I originally said was right.  If you would bother to RTFM, you would know that too. To make this easier, here are the  first two references from SBC's wikipedia entry:

2. C. Hoene, F. de Bont, "RTP Payload Format for Bluetooth's SBC audio codec", IETF draft, work in progress, Dec. 2010, https://tools.ietf.org/html/draft-ietf-avt-rtp-sbc-01

I don't know what other subband codecs you have worked on, nor do you know my background.  I do know that, in this particular case, you are both patronizing and wrong.

If you want to make a positive contribution, please confirm that you now understand that

bit_rate = 8 * frame_length* fs / nrof_subbands / nrof_blocks

implies that haliving the number of subbands (nrof_subbands) results in a doubling of the bit_rate.

Once that is out of the way, feel free to provide some intuition on why that is the case.  I could, but want to see how long you will dig in your heels.

p.s. FWIW, some time ago, I was a happy user of Rockbox for many years.  I'm not sure what your role was, but for whatever it was, thanks.

Re: SBC: Intuition of audio impact of subbands?

Hi again!  Here are some audio samples that you can compare.

Three sets of 30 second audio test files are available.  In each case, three different bitpools are chosen, i.e. bitpool=[20, 35, 53].  Subbands are chosen from nrof_subbands=[4, 8].  The other parameters are fixed for all version to these values:  Joint_stereo, nrof_blocks=16, Loudness bit allocation.

Each of the three sets of audio files were created with the original .wav file from a music CD, then edited in Audacity for length, plus using its standard fade-in and fade-out effects.  The shortened file is then re-exported as a .wav file, with the string “test” appended to the file name, e.g. OFortuna_test.wav.  The file is then used for a series of encodings and decodings by the Windows executables sbc_encoder.exe and sbc_decoder.exe, each time with a pre-determined set (see above) of encoding parameters.  All operations were performed on a Windows 10 PC. Details can be found in the batch.txt file that accompanies each set. In addition, here are the parameters for both the encoder and decoder.

Code: [Select]
`>sbc_encoder -helpSBC Encoder LIB Version 1.5Copyright (c) 2002  Philips Consumer Electronics, ASA LabsUsage:sbc_encoder [-jsv] [-lblk_len] [-nsubbands] [-p] [-rrate] [-ooutputfile] inputfile            [-s] use the stereo mode for stereo signals            [-v] verbose mode            [-j] allow the use of joint coding for stereo signals            [-lblk_len] blk_len specifies the APCM block length, out of [4,8,12,16]            [-nsubbands] subbands specifies the number of subbands, out of [4,8]            [-p] a simple psycho acoustic model is used            [-rrate] specifies the bit rate in bps            [-ooutputfile] specifies the name of the bitstream output file            inputfile specifies the audio input file, the major audio formats are supported>sbc_decoder -helpSBC Decoder LIB Version 1.5Copyright (c) 2002  Philips Consumer Electronics, ASA LabsUsage:sbc_decoder [-v] [-ooutputfile] [-pstartpos] inputfile            [-v] verbose mode            [-pstartpos] startpos specifies the byte offset to start with decoding            [-ooutputfile] specifies the name of the audio output file            inputfile specifies the name of the bitstream input file`

Note that each set includes a version with the suggested “Medium Quality” [-j -p -n8 -l16 -r228800] and “High Quality” [-j -p -n8 -l16 -r328000] parameter choices.  One of these are the versions most likely produced with legacy audio equipment.  These parameter choices are consistent with the suggested settings in the original specification, as shown here:

[Figure (attached) from Considering Bluetooth’s Subband Codec (SBC) for Wideband Speech and Audio on the Internet, by  Christian Hoene, Mansoor Hyder October 2009]

Test Set 1: Classical Music, Full Orchestra and SATB Chorus, Loud Volume

Test Set 2: Classical Music, Female Soloist with Orchestra, Soft Volume

Test Set 3: Jazzy Pop, Female Soloist with Guitar, Piano, Bass, and Drums, Medium Volume