Wednesday, July 30, 2014

Mission : Restoring Compressed Music


Can we make it Sound real ?


In this next blog with focus on Audio Restoration, I will bring to light what goes into making the Compressed Music sound as good as LIVE one.

I will start from where I left in my previous blog
5.1 Surround Experience
Because the blog only talks of how to install the software and but the technology behind that is completely eclipsed.

It has the keys of audio restoration built into it. And we will be uncovering them step-by-step.

Problem 1: How do we split 2 channel audio to 6(5+1) discrete channels?

To be frank, the answer to this question is still incomplete, and technology is advancing to solve this.
A little info, 5.1 audio format came into existence because of the spatial relevance of the Sound (Direction of the sound source I.E. front, sideways or back ), giving it more natural ambiance.

Back in 2004 , DOLBY Labs  came out with DOLBY PrologicII technology, the matrix encoding format for storing 5 channel audio on 2 channel media. Though recording may not sound very different from stereo recordings, but pass this as input to Dolby enabled receivers and you would know, people at Dolby have created magic.
This technology though proprietary but is shared to public as a white-paper and a freely(not open-source) available decoder is part of ffdshow.

The decoder implemented works very well for any stereo source, but presents the next set problem of managing audio levels across 6 different speakers.

Problem 2: Managing volume levels ?

As You might have predicted that simply implementing a 5.1 decoder solves the problem, your are here for a surprise.
After getting the 6 channel audio, The volume levels are high in center channel and lower for the rear channels, this gives a highly distorted audio as the mixing is optimized for stereo listening.
The perfect solution depends on the actual compression used.
One common solution is to lower the center channel volume to 50% and increase the rear channel volume as you find pleasant.
If you are up for challenge, you can configure your own matrix in matrix filter of ffdshow.

Problem 3: Make it sound real

Till now what we have achieved is enough to hear 5.1 Home Theater at work, but wait! ffdshow still has some acts left up its sleeve.
The true purpose to ffdshow's existence is the processing power it has for general audio decoding/encoding.
Generally what makes us understand sound is live or recorded is the presence of sound harmonics(no issue if you aren't getting the term) , basically how multiple audio sources interleave.

This is done by Resample and Crystality filter, which together try to recreate the ORIGINAL studio recording what the musician / singer intended us to listen.
These filters are not bound to the number of audio channels your music file has, so you can simply use for stereo music as well.

NOTE: Keep in mind though it requires decent amount of CPU for processing.
There are some more filters which serve the purpose of even more accurate spatial consistency of sound recreation and perfect volume levels.

Conclusion

The final result is that 5MB of compressed audio is decoded to 200MB of RAW audio, which could have been 50MB of CD audio. So you see the processing quality is 4 TIMES the quality of original, not literally, some of the original signal is lost completely, hence in true sense audio restoration is never 100%. It is actually made up of what the algorithms determines as estimation of actual signal. Unless we have access to original recording, the recording will feel natural and crisp.

Rest assured what we will be enjoying is among the best, we can get for free.
Please follow link to setup Surround Sound.