Deepak
Jun 17 2003, 03:40
Dear Experts,
Iam working on MPEG-2 AAC. Iam in search of algorithm on basis of which window shape switching is
made between SINE and KBD window shapes in block switching.If anybody has idea about it
or any links where I can get details pls throw light on this .
Thank You,
Regards
Deepak
Frank Klemm
Jun 17 2003, 05:17
QUOTE(Deepak @ Jun 17 2003 - 11:40 AM)
Dear Experts,
Iam working on MPEG-2 AAC. Iam in search of algorithm on basis of which window shape switching is
made between SINE and KBD window shapes in block switching.If anybody has idea about it
or any links where I can get details pls throw light on this .
Thank You,
Regards
Deepak
Do MPEG-2 AAC support KBD window?
BTW I would always use the KBD window. I think KBD is better than Sine in most situations.
Ivan Dimkovic
Jun 17 2003, 06:56
Hmm - some commercial encoders use SIN window for the short blocks, and KBD window for the long blocks - start and stop blocks have transition windows (combined)
Ahead AAC and aacenc use KBD window for all blocks (up to date)
QUOTE
Do MPEG-2 AAC support KBD window?
Yes, it does.
Actually, right now I am doing tests with window shape switching, some results are already available on guruboolez's web page:
http://membres.lycos.fr/guruboolez/AUDIO/a..._Castanets2.txt (wss_on is the version with switch)
as I understand it:
sine window has better pass-band selectivity so one would use it for signals with strong tonal components spaced close to one another. kbd has better stop-band attenuation, compacts more energy into a single spectral component - better than sine window for signals with few strong spectral components. I use sine if stronger frequencies are closer than 200 Hz, but its up to you to experiment and decide. its not this simple because you need to have a tonality detection algorithm, than you need to decimate close components, etc, etc... castanets sample used 55% sine 45% kbd, glockenspiel used 98% sine, speech sample used 75% kbd, but I am not sure about this, no one to compare to...
regards,
daniel
Ivan Dimkovic
Jun 17 2003, 14:56
dand,
Dolby (and FhG) use SINE window for SHORT and START windows and KBD for LONG and STOP windows - so number of sine and kbd window shapes only depends on number of short and long blocks in the frame.
It might be better to implement shape detection based purely on tonality detector's results - but I guess that it would make encoder flow more complicated and optimizations for speed very hard (because of look-ahead window shape decision)
p.s
Danijele,

KBD oblik u Nero-u nije bas slucajno izabran, rezultati sa sinusnim su kontraverzni i ponekad prave dodatne probleme koje ni jak TNS ne moze da resi - no, u poslednje vreme dosta eksperimentisem sa ovim pa mozda nesto uskoro i bude od svega toga - najbolje bi bilo tesitrati potpuno nezavisnu selekciju, ali kao sto rekoh, to je nemoguce u "brzim" enkoderima, i pitanje je koliko bi unapredilo kvalitet uopste...
puno hvala za cestitke pozdrav iz DE,
--i;
Well, I could't hear any differences on clips encoded using KB window and Sine window. I only noticed that KB window on the average is about 0.5% to 1% more efficient than Sine window. Also I noticed from the FFT analysis of decoded clips, spectral leakage of short blocks using Sine window is quite severe compared to long blocks using Sine window.
I would use KB window for short blocks instead of sine window.
Ivan Dimkovic
Jun 18 2003, 14:13
True, short blocks with KBD window yield bit rate saving of near 1%
Also, TNS works much better with KBD window. However, there are some over-coding TNS artifacts if you filter too much - and these do not happen with Sine window & short block.
Still, on some samples Sine window seems to give a little bit better results, and on some impulse samples KBD clearly wins (castanets.wav guitar pass is the clear example) because of better TNS.
Like always, it is a matter of implementation - I noticed that QT 6.3 always use Sine shapes at 128 kbps, while QT 6.0/6.1 used the same strategy as FhG's codecs...
I noticed that for KB windows, some audio clips seemed to lose some tone components compared to Sine windows...
Since the KB windows offer so little compression gain over Sine windows, is it worth implementing the extra switching processing? I though that KB window might improve on the audible quality but it does not seem so..
QUOTE(Ivan Dimkovic @ Jun 17 2003, 12:56 PM)
Dolby (and FhG) use SINE window for SHORT and START windows and KBD for LONG and STOP windows...
Another thought about the window shape issue...
As already said, sine window has better pass-band selectivity so one would use it for signals with strong tonal components spaced closer to one another. If signal is transient, it is very chaotic and there isn't much tonality inside - so KBD would be the reasonable choice for short windows, wouldn't it!? I wonder what explanation stands behind Dolby's and FhG's aproach?
Ivan Dimkovic
Apr 26 2004, 17:06
QUOTE
so KBD would be the reasonable choice for short windows, wouldn't it!?
That's also my reasoning - and that's what we use in our codec - I also noticed that TNS works much better with KBD windows - but might be due to our implementation of it. TNS should naturally work better with these "shorter overlap" windows anyway, as the Low-Delay window (used in LD-AAC) is also prototyped to have shorter overlap than Sine window.
QUOTE
I wonder what explanation stands behind Dolby's and FhG's aproach?
I have no clue

I tried to dig very old MPEG documents (MXXX) but there is no algorithmic description when to switch. Few AES papers mention some low and high frequency ratio (IIRC) but apart from that - nothing conclusive.
Glad we had the same idea... :)
SebastianG
Apr 27 2004, 08:11
I thought that a Sine window can only be used for a long transform block and that the KBD window is the only possible for short blocks - which really makes sense because of the poor stopband attenuation of the sine-window and the low spectral resolution of short blocks.
(If I remember correctly from the MPEG4-T/F Audio Coding FCD)
Well, I don't have the full spec.
Is it REALLY possible to select the Sine window for short blocks ??
bye,
Sebi
Ivan Dimkovic
Apr 27 2004, 08:47
No, you can use both SIN and KBD windows in any block, and like with block-type switching you have to do a look-ahead if you do dynamic switching, so you could construct transition widndows in order to faciliate perfect reconstruction.
For example:
[ KBD ] [ mixed KBD - SIN ] [ SIN ]
etc..
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.