Block switching: Difference between revisions

From Hydrogenaudio Knowledgebase
(Some minor grammer corrections and wording. The applets are good example? but the link to the first one should be on the page about pre-echo.)
mNo edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The Psychoacoustic model decides when to switch to short blocks and back to long blocks (block switching).
The Psychoacoustic model decides when to '''switch''' to short blocks and back to long blocks (block switching).


In [[MP3]], switching to short blocks will isolate the attack to 192 sample window, so the oscillations are only spread over 192 samples instead of 576. Block switching is also used by [[Ogg Vorbis]] and [[AAC]], ''(except on windows that can be a power of two only)''. [[MPC]], being a [[subband|subband coder]] doesn't make use of block switching, ''(although it is implemented and can be used)''  
In [[MP3]], switching to short blocks will isolate the attack to 192 sample window, so the oscillations are only spread over 192 samples instead of 576. Block switching is also used by (Ogg) [[Vorbis]] and [[Advanced Audio Coding|AAC]], ''(except on windows that can be a power of two only)''. [[Musepack]], being a [[subband]] coder doesn't make use of block switching, ''(although it is implemented and can be used)''  


Switching to short blocks and increasing of the [[bitrate]] to encode a series of [[MDCT]] coefficients of a particular [[transient]] is one way to combat [[Pre echo]].
Switching to short blocks and increasing of the [[bitrate]] to encode a series of [[Modified Discrete Cosine Transform|MDCT]] coefficients of a particular [[transient]] is one way to combat [[Pre echo]].


==Additional reading:==  
== Long & Short Blocks ==
Audio encoding systems will commonly summarise the sound energy in one small stretch of time at a time. The duration of a single summarisation is also called a [[window]] and once a window of sound has been quantised, selected and packed, it can be considered as an individual '''block''' of audio information to be finaly stored in a frame.


Some Java applets to examine fourier series behaviour (note that [[MDCT]] behaviour is not totally identical):
Available mathematics used to summarise one block at a time can struggle with evenly representing details throughout a window's duration. There may be a tendency to mirror features at the start of the window onto the other end of the window, or the ends of the window might be the most efficient place to have details occur, it will depend on the particular mathematical transformation used.
With such variance in transformation accuracy throughout each block, varying the size of blocks to best fit over the actual details present in the audio stream increases the overall accuracy of the encoding.


[[LAME]] has only two block sizes available, long blocks and short blocks. In Lame's case Short blocks require more data to describe less time than Long blocks so they are only selected when they significantly improve the alignment of transformation windows to audio details.
== Additional reading ==
Some Java applets to examine fourier series behaviour (note that [[Modified Discrete Cosine Transform|MDCT]] behaviour is not totally identical):
*; http://www.jhu.edu/~signals/fourier2/ : You can draw a sharp attack here, and use calculate with a large number of coefficients... if you start to reduce the number of coefficients you will see the [[pre echo]] appear.
*; http://www.jhu.edu/~signals/fourier2/ : You can draw a sharp attack here, and use calculate with a large number of coefficients... if you start to reduce the number of coefficients you will see the [[pre echo]] appear.
*; http://www.gac.edu/~huber/fourier : Doesnt seem to work in netscape. iirc this one lets you listen to the sound.
*; http://www.univie.ac.at/future.media/moe/galerie/fourier/fourier.html : Maths online fourier series applet.


*; http://www.gac.edu/~huber/fourier : Doesnt seem to work in netscape. iirc this one lets you listen to the sound.


*; http://www.univie.ac.at/future.media/moe/galerie/fourier/fourier.html : Maths online fourier series applet.
[[Category:Technical]]

Latest revision as of 16:46, 14 June 2007

The Psychoacoustic model decides when to switch to short blocks and back to long blocks (block switching).

In MP3, switching to short blocks will isolate the attack to 192 sample window, so the oscillations are only spread over 192 samples instead of 576. Block switching is also used by (Ogg) Vorbis and AAC, (except on windows that can be a power of two only). Musepack, being a subband coder doesn't make use of block switching, (although it is implemented and can be used)

Switching to short blocks and increasing of the bitrate to encode a series of MDCT coefficients of a particular transient is one way to combat Pre echo.

Long & Short Blocks

Audio encoding systems will commonly summarise the sound energy in one small stretch of time at a time. The duration of a single summarisation is also called a window and once a window of sound has been quantised, selected and packed, it can be considered as an individual block of audio information to be finaly stored in a frame.

Available mathematics used to summarise one block at a time can struggle with evenly representing details throughout a window's duration. There may be a tendency to mirror features at the start of the window onto the other end of the window, or the ends of the window might be the most efficient place to have details occur, it will depend on the particular mathematical transformation used. With such variance in transformation accuracy throughout each block, varying the size of blocks to best fit over the actual details present in the audio stream increases the overall accuracy of the encoding.

LAME has only two block sizes available, long blocks and short blocks. In Lame's case Short blocks require more data to describe less time than Long blocks so they are only selected when they significantly improve the alignment of transformation windows to audio details.

Additional reading

Some Java applets to examine fourier series behaviour (note that MDCT behaviour is not totally identical):