Thursday, June 19, 2008

Bonkenc #3 : remain converters

BLADE ENC
This is a plugin offered from the program's web site as 'optional ' . I have also installed it for testing
Blade is one of the oldest freeware converters but with closed coding although recently ity has been open source . The version used is 0.94




As you may see the codec configuration is very simple . Just the bitrate and some basic adjustments with also separate channel encoding (the dual channel)
Bitrates are standard with 32, 48 , 56 , 64 , 80-, 96 , 128 192 224 256 and 320 being the highest

Here are the measurements with BLAde


CD WAV b/W
320 14.19 12.9 22kHz 6.87
192 15,87!! 13.12 22 kHz 6.62
128 17.81!! 16.06 16 kHz /peak 800 Hz
96 18.53 16.75 -7 db<2.4k ,-4<16k,-42>16
48 18.46 16.77 -40<2.6, -17<-5, 7.5-16> -7.5


The first column is ripping time from CD of a song of 2,26 mins
Secoind columns from the WAV ripped song
b/w is the measured bandwitdth in terms of db and kHz in plain text . though it can sound too technical will be analsyzed a bit below.

MY comments:
As shown above the ripping times are slightly increased as far as the bitrates are lowered! For me its is quite incommon but it is posibly the problem with the coder
For the bandwidth measurements , 192 and 320 are OK as a 'store format'
128 means Hi quality FM format with a peak of the tone LA
96 : everything below the speaker's voice is truncated leaving just the trebles to be heard . testing one song converted from 128 to 96 , the sound was quite 'plastic'
48 : the spectrogram showed a stair shaped drawing , meaning that the 'higher tones have higher audio level ' . in plain language it means that there is no bass and the trebles have a bad mood. A song cannot be heard properly in this mode




OGG VORBIS

The ogg vorbis format , though i have rread somewhere is much more xcomplex thanthe standard MP3 format seems here to be in a oversimlified adjustments
As is quite known , ogg vorbis offers quite better audio then MP3 (at least for the FhG fastenc codec ) thogh from my measuremenrs below the new LAME goes a little better !



and



As shown in the two ictures above the adjustmsnt are very simple and seem tobe very clse to the LAME format

And here are my measurementsga

OGG from the above WAV saved file of 2.26 mins
A192 1.20.30 A126 1.30.66 A065 1.30.38 V0.6 18.74!!! v0.4 19.59 v0.2 20.53 v0! 20,53 v-1.9 21.25

as in result , the average bitrates require neartly the half time of the song, whnile the variable bit rates are quite fast and increase slightly with the decrease of the variation level

And here are the bandwidth results from various bitrates qith the seocnd way of processing: WAV file > Ogg then ogg> wav out for spectral analysis on cooledit


A 192 22k linear A 126 18K1 slightly curved up as above 8 kHzby 3db A 64 15k curved after 6Kto 0 on 15 kHz -- V0.6 22k linear v0.3 17k slightly curved up as above 8 kHzby 3db v0.1 16k v0 15k2 curved after 6Kto 0 on 15 kHz (as A64) v-0.9! 15 curved after 6Kto 0 on 15 kHz,rippled 11- 15 (A48 same )


From the abovee the latest vorbis encoder ofers slighly less spectrum then the lame on the highest fidelity !
But from the resulted adio even on the 45 /v-0.9 is very clear in contrast to the same bitrate of LAme that had artifacts



FAAC the freeware converter for AAC and MP4
In the reality AAC and MP4 are exactly the same!




As you wil see there is noting special with this converter .
It used a CBR rating per channel though the file sizes are always the same for 8 - 48 kbps in my tests. It did happena also to converrt files of dferent sizes
IN conrtast the VBR levels shown a difenrence in the file sizes for the 1 min noise bering 1.42MB for the 100% dropping 967KB (as 128 for MP3 ) for the 42% and 448KB (64kb MP3 size) for the 10% with obvious audio artifacts



And here is nothing special except for the object type . Thw main and low options are very fast , but the LTP (Long Term Prediction) is very slow , upto 4 times

For more info on this format you may look at : http://wiki.hydrogenaudio.org/index.php?title=AAC




FLAC

Ands another codec with lossless AAC The amin site for FLAC describes it this way :

FLAC stands for Free Lossless Audio Codec, an audio format similar to MP3, but lossless, meaning that audio is compressed in FLAC without any loss in quality. This is similar to how Zip works, except with FLAC you will get much better compression because it is designed specifically for audio, and you can play back compressed FLAC files in your favorite player (or your car or home stereo, see supported devices) just like you would an MP3 file.



As shwon above , the FLAC converter uses several presets and two stereo modes the standard joint stereo and the non standard 'adaptive'
The presets are between the fastest and the best compression in 8 steps total Sizes come between 9.76 and 9.84 MB for the preset 8 and 1 . The times to convert a 4 min noise WAV file are:
19 secs for the best compression or 4.75 sec per MB resulting to 40.942.070 Bytes
7.93 secs per MB for the festest or 1.98 secs resulting to 41287186 BYtes
Original WAV noise file is 42336044 BYtes

Another experiment :
A song of 3.55
-18.15 secs 27815488 BYtes for the highest compression
-7.34 secs 30719266 BYtes for the fastest compression




here is a definaition for the subset on http://flac.sourceforge.net/format.html
FLAC specifies a subset of itself as the Subset format. The purpose of this is to ensure that any streams encoded according to the Subset are truly "streamable", meaning that a decoder that cannot seek within the stream can still pick up in the middle of the stream and start decoding.





And here the most intereting point is :
apodization , which means taperring or trimming. A little more googling shows that apodization is clearing the residual parts of the bel curve berlow a predefind level More here: http://en.wikipedia.org/wiki/Apodization_function which sown also various functions

Info on the linear predictor:

FLAC uses a class of computationally-efficient fixed linear predictors (for a good description, see audiopak and shorten). FLAC adds a fourth-order predictor to the zero-to-third-order predictors used by Shorten. Since the predictors are fixed, the predictor order is the only parameter that needs to be stored in the compressed stream. The error signal is then passed to the residual coder.

Bonkenc#2 : process standards and LAME

IN this and the following articles you will find som measurenemts  for the encoders used with bonk:
first let me advise you the  method  i used for  measuring

1. For the times measurements : Used
- A song from a CD  of 2.26 mins ripped directly . I order no to damage the CD i then  ripped it to WAV  format
-a stop watch unit from  DS clock,  a  simple visual  (and free )clock  program , with .01 sec accuracy. most of the results have +/- 0.15 secs tolerance 
- Snagit one of the oldest capturing programs  for capturing part of the screen
- After snagit was started capturing   i start the stop watch and then bonkenc
- After Bonkenc ended its task , i stopped the timer and then the capturing
- i then measure the bars progressing and do the time  subraction

Here is a video  with the above methodology

>>>
2. For the  sprectrum measurememnts

A WAV file  is first made with  white noise  of one minute duration on 44000 Hz  and 16 bit 
-then is converted  in all formats , compression levels and quality adjustments and named accordinly (LAM/98/5 for example )
.Though Audacity is one solution for making the WAV file , Cooledit (a very old version) is still  my most preferable for allthe next measurements.

Then :
For the mp3s : - the file is dragged into Cooledit marked for about 15 -20 secs then scanned from the spectrum analysis window   for the RMS values via a relatively  big sampling rate ie 2048 or 4096 and 'calculating the curve into text'
For files  not supported  by Cooledit :
-conversion  via Bonk to WAV
-draging into Cooledit  and then using the above  method

Though  i do not think  that this method is flawy , if soemone has any claims  plase let me know


And  a short description of my computer system:
Pentium PC with  3 GHZ
768 MB
80GB HArd disk




LAME

LAME (Lame Ain't an MP3 Encoder!!!)
For me Lame  is the most interesting converter that has a ton of adjustments  best for the very geeky , a much  higher level than myself who is mostly  to the audio response level .
http://wiki.hydrogenaudio.org/index.php?title=LAME




The lame encoder  has too many parameters to use . the most important for me is the quality item that can convert from  just  4 secs for the worst quality to 25 secs  for the better quality. IN this paramter  i prever to use the highest possible number - usually 3 and 2 -  inorder to have the best  audio quality - though mine ears  do not  find any  significant diference .

There are also several presets as medium (VBR), standard , extreme, insane , adn their  fast versions R3mix and ABR All except ABR do not uncover their presets. ABR standsas for automatic bitrate ans is shown in the VBR tab
  However  the  documentataion reveals this  info:
 -preset medium  > V4 rh
 -preset fast medium > v4 mrh
 -preset  standard > v2rh
 -preset  fast standard >v2mrh
- preset extreme v0
- preseet fast extremev 0
- preset insane C320


The bitrate can be from 8 to 320  to preset numbers ( 8, 16, 24, 32 , 40 48 56 64 80 96 112 128 144 160 192 224 256 and 320)
There  is also a size ratio.   in uncomon numbers as 90!   the resulted  file is deleted  immediately after the  conversion.

The quality rate  is soemthing for me very interesting . Quality  zero means here the best  quality (therefore the highest time for encoding ) and 9 the lowest quality (and very fast )

Beofre going on  with the other  tabs let me show my results in ripping /converting from CD and WAV onto MP3: or song of 2.26 min (146 sec)

at CBR on 128 kb
       CD           wav
 at 0 > 1.13.67    1.12.72   ie the half !!!
    1 > 0.39.50      39.00   nearly the half of 0
    2 > 0.33.06      30.12
    3 > 0.19.06      17,13
    4 > 0.18.94      16,63
    5 > 0.17.81      15,28
    6 > 0.17.19      14,63
    7 > 0.12.13       9,82
    8 > 0.12.19      10,16
    9 > 0.08.46       5,29
 LAME COMPRESSIONS on 128kbps

Here is per compression rate at CBR times in secs
320 kb  17.06   14.1
256     16,63   14.17
192     16,25   13,84/13.66
128     17,91   15.47
96      18,75   16.41
48      16.44   14,5
--
24       9,35   7.16  requires adj to output sampling rate
8        8.47   6,38 requires adj to output sampling rate


the two latest formats  require  downsampling (audio processng )in order  to perform the coversion , usaually on 8 or 11 kHz

And here is a test based graphical  analysis of the most common CBR rates:


256   20 kHz

192   19kHz
practically  this bandwidth (B/W) means a store level

128-9 22kHz!!

128-5 19

128-0 19 kHz

the worst quality level due to speed offers a  artificial whole b/w level . the other quality levels offer a Cd quality

112/9 22kHz !!
112/5 19 kHz
112/0 19 kHz
the same as above

96/9  22 kHz  distorted!
96/5  19 kHz
96-9  19 kHz curved down by 3 db


64-0  8k @-3 max to 18 kHz
64-5  18 k linear
64-9  22k! linear
and here is the funny: the best quality  cuts freqs above the 8 kHz though the wirrst modes ofer a 'transparent' quality

Lame 48 0          10 kHz  
Lame 48 5          17 khxz
Lame 48 9          22 kHz!!


16-9   6 kHz   @-3 8 khzoff
16-5   5 k ,6k @-3 8 K off
16-0   1.7kHz  @-3 4.5 kHz coff



once again the  numers show narroweer audio for the best encoding !!
==
ENCODER



And above LAME shows  its more important characteristics the  two variable rates . for a  better explanation i lend the info from the wiki  of LAME  as foun in the site of Hydrogen audio:


CBR:  the standard constant bit rate
constant bitrate mode. CBR encoding is not efficient. Whereas VBR and ABR modes can supply more bits to complex music passages and save bits on simpler ones, CBR encodes every frame at the same bitrate.

CBR is only recommended for usage in streaming situations where the upper bitrate must be strictly enforced.

VBR: this is the variable bit rate
variable bitrate mode. Use variable bitrate modes when the goal is to achieve a fixed level of quality using the lowest possible bitrate.

VBR is best used to target a specific quality level, instead of a specific bitrate. The final file size of a VBR encode is less predictable than with ABR, but the quality is usually better.

Unlike other MP3 encoders which do VBR encoding based on predictions of output quality, LAME's default VBR method tests the actual output quality to ensure the desired quality level is always achieved.

rh adn mrth are two dierent algorithms.Mrth  offers abou two times faster processing

ABR: average bitrate mode.
A compromise between VBR and CBR modes, ABR encoding varies bits around a specified target bitrate. Use ABR when you need to know the final size of the file but still want to allow the encoder some flexibility to decide which passages need more bits


AS shown above in the photo , VBR can be asjusted  in tbetween minimums and maximums


misc


The misc tab determines some usual MP3 standards as copy right bits rtc  but en/disables padding on frames
ISO compliance : This refers  mostly  for the MP3 harware players  , in order  for the resulted file  to be compaliant to the MP3 standard (compatibility problems)
padding : a patch


expert tab:


thisis possibly the most dificult setting  with the  explanation from other pages :

ATH : absolute threshold of hearing 
The Absolute Threshold of Hearing (ATH) is the volume level at which one can detect a particular sound 50% of the time. If one has a low absolute threshold, it means that he is able to detect small amounts of stimulation, and thus is more sensitive. If one has a high absolute threshold, then he requires more stimulation and thus is less sensitive  (from  http://wiki.hydrogenaudio.org/index.php?title=ATH)
Much more can be found here  http://en.wikipedia.org/wiki/Absolute_threshold_of_hearing


Temporal masking effect

Temporal masking occurs when a sudden stimulus sound makes inaudible other sounds which are present immediately preceding or following the stimulus. Masking that obscures a sound immediately preceding the masker is called backwards masking or pre-masking and masking that obscures a sound immediately following the masker is called forwards masking or post-masking. Temporal masking's effectiveness attenuates exponentially from the onset and offset of the masker, with the onset attenuation lasting approximately 10 ms and the offset attenuation lasting approximately 50 ms.(from Wikipedia )
For more information  you can find  http://www.mp3-converter.com/mp3codec/maskingeffects.htm  and here         http://www.gnuware.com/icecast/chap_02_03.html  and in more depth analysis on http://www.soundonsound.com/sos/aug98/articles/datacompression.html
       



Audio processing



This pane is the easiest for me and the simplest  comparing to other more 'advanced' adjustments !
There are the standard resample rates of 8 ,11 22 44 and 48 kHz , the first two necessary  for the lower bit ratets  to operate.

Enabling  filtering can make you remove some frequencies  or determine a whole bandwidth to cut
For better  undersitanding it is better   to experiment a bit with them . NOtice that lowpass filter  must be biiger numer thanthe low pass frequency !!


Bonk enc #1: a very good (shell) program for ripping your CDs ...

.........and reconverting your MP3s  into another forrmat ........... A REVIEW


The program has been found i think in the freewaregenius web site (together with mediacoder , toibe reviewed later here ) several months ago, bvased on a very short review, which normally acts as a shell program for several freeware /open source audio codecs.

The program can be found  in the adress http://www.bonkenc.org  and includes  the latest two versions  , together  with two extra plug ins. The most curent is 107

ONce you download the  program the screening is shown as below:





The program has the following  specifications:
- is totally free and comes with its  source
- it can be just unzipped into a folder and  work . Thefore it is a green program
- There are various language translations including a program that handles translation fields
- Connectivity with  CDDB  for automatic  album naming (if avaialble )
- automatic ripping after a CD is inserted  and  recognized (setable)
The latest colleciton i  converted  has been  totally found from the CDDB databqase
- about 5  conversion systems
 FLAC, Blade , Lame ,Ogg, AAC and its own Bonk
- auto titling  based on the information of the artist and title given , including the ID3 info saved
- mass ID3 saving
- CD /file operations:  playback and insert/escape button shown below the web adress
- also facility  to manually update - via the help menu
- plug ins  for in- and out-put

a very interesting point is that the program allows  you not only to add the ID tags (ID 1 and 2 )  but also
- set the case letters  towards: each  word in lower or in upper cases ,
- set the tag for all the songs  included in ripping
- set a spscial  label for the music kind
Here are several  screenshots from its settings: here is just the  encoders settings. As you may see  there is also a filename naming pattern





And another settings view  for playlists . There is the ability to use cue sheets



And here you will find some screeshots  for the  encoding abilities . As  you may see  Fraunhofer FhG and WMA  codec are  missing . I think this is because FhG  codec is commercial .....WAVE OUT as show in the picture comes fromta export plugin .Blade enc is a optional codec  that can be found in the program's site  that has several peculiar conversion specs .All codecs here are  freeeware modules.




In the next pages you will find in depth (as posible ) reports on the codecs  and their operations  includeing more pictures



Here  are several imprtant notice from my usage  for about 2 months



The ID3 tags : upon the preset format , they can be shown OK to Wianamp, Windows explorer and sevreal ID tagging programs but in seeral others not . the proble consisted onthe UTF 16LE . Setting to ISO encoding  the porblem  has been solved


Cons  I found two types of crashes:
- The program crashed when resizing the time Bonk was converting
- several dragged /dropped MP3s also made it crash. I donot know  what  is the problem with these MP3 files . But dropping  their  directories into Bonkencs'  file window there was not problem



In the next pages   you will see a description of the  encoding schemes
=================================================





The blade enc adjustments:(a very  easy and simple encoder )


 

The lame encoder - which is trhe most complex encoding system.



The lame encoder  has too many parameters to use . the most important for me is the quality item that can cnvert from  just  4 secs for the worst quality to 25 secs  for the better quality. IN this paramter  i prever to use the highest possible number - usually 3 and 2 -  inorder to have the best  audio quality - though mine ears  do not  find any  significant diference . In the second part i will  show you several intereting experiments with them

Here is a  screenshot for FAAC , surely a form of AAC ,an open source MPEG-4 and MPEG-2 AAC encoder of lesser general public license  :



and here  which shows the encoder configuration with both kinds of versions




and here for ogg vorbis : note averager instad of constant bitrate is used





and here is for FLAC (a free lossless audio codec )  with also very great amount of adjustments:



with expert  encoider configuration as here:







In the next posting I will  place several measurements  on some if the above codecs