Wednesday, April 23, 2008

Digital Audio Part II - EQ


I will continue with digital audio with a post on EQ. EQ, short for equalization is the alteration of particular frequencies of the audio signal in order to balance the overall sound, or change it per personal preference. This is a widely misused and misunderstood term and hence the blog. Most audio players have an EQ option nowadays. Some of them simply have presets where the manufacturer has stored in a value for each frequency and just given the overall curve a title. The curve as it is called is the curve you see when you have set each frequency to a particular db level increasing or decreasing the gain at the frequency. Simply put, you are increasing or decreasing the volume of that particular frequency of sound.

The human ear can hear from 20hz to 20khz, some can hear a bit further but the average person stays within these limits. The whole frequency spectrum can be divided into three basic sections, Bass, Mid and Treble. When you are a little more particular on isolating different aspects, you can categorize them as Low bass, mid bass, upper bass/lower mids, mids, upper mids, treble, upper treble. The equalizer is basically split into several bars or sliders each lying in one of these sections. Depending on the player, the number of bars or sliders increase or decrease. Simple EQ's have just 5,7 or 9 bars. When you want some more control, you can use a player that has more bars/sliders such as Foobar. Professionals use dedicated EQ boxes per channel (left and right) and have 20-30 bars on each channel or even more.

The image shows the equalizer in foobar. Notice how the frequency associated with each bar is written below it. This is usually the norm, and most equalizers will state the frequency below each slider. As you can see frequencies extend all the way from 55hz to 20khz. The reason
you usually dont see very low frequencies (<100>19kzh) on most commercial EQ's are because while most instruments will have some information in those frequencies, they are at a very low level and are usually not audible to the average listener.
Also, the kind of equipment you use is going to determine how well such high or low frequencies are reproduced. Most ppl will find 100hz to be boomy enough for bass and 18kzh piercing enough for treble. The important thing to note here is also the fact that compressed music
formats such as mp3 lose most information in very high or very low frequencies and basically average them out or zero them out. Hence, trying to increase the gain at 20khz for a 128kbps mp3 file will not make any difference since the file itself doesnt have any information
in that frequency.

The best way to find out what each frequency does is to mess around with the gain on each slider. Starting from the lowest, increase the gain all the way, and bring it back all the way and you will observe which aspect of that song or musical piece this enhances or deteriorates.
All sliders are first set at 0 gain, or in the middle. Push them up, and you go in increments of decibel level for that frequency, and vice versa.

This is all too complicated for the casual user thought popular manufacturers, so they got rid of these customizable options, and just put presets on portable players such as the Ipod or Zune. These are usually titled rock/pop/jazz/vocal/bass boost etc etc.

Rock eq basically has a slight bias in bass. This is because most rock music is played with distorted guitars which are heavy on lower mids and mid bass.

Pop eq enhances the mids, brings out the treble a bit more as well, and keeps the bass intact. This is because pop music is usually very vocal centric, has synthesized music which usually have a slight emphasis on treble.

Jazz eq cuts down the treble, pushes the bass forward.
Vocals as it suggests, pushes the mids and upper mids forward
Bass boost, simple enough, simply pumps up the lower end.

My first level of advice, if you have customizable EQ, stay away from presets, customize your own. The golden rule of EQ is to always reduce neighbouring frequencies when you want to enhance a certain frequency. Say you want more bass. Instead of pushing the first few sliders up, lower the remaining sliders down, you lose a bit of volume, but in net effect, you are enhancing bass. The reason for this is that when you add gain to a certain frequency, the software is going
to add gain/volume by amplifying the signal using software. This is going to degrade the sound. The best way to directly experience this, is to push one of the mid frequencies all the way up. You will clearly hear that frequency distort and sound messy.

This is the same reason why you should never use bass boost. Bass boost simply pumps up the gain of the lower frequencies, in effect adding distortion. If you listen closely, if you turn the volume up with bass boost, the music will distort severly. Even though rock and pop eq's will end up doing the same, they do not add so much gain as to distort easily. So you are better off using rock or pop eq if all you have are presets.

As for how to set a customizable EQ. Start with cutting down the mids. The V or U curve is the most commonly used curve. The primary reason for this is because of the equipment that the average person owns. The commercial speakers and stereo systems do not have proper extension at both ends of the frequency spectrum, nor do they output a balanced level across all spectrums. Upper mids and treble are easiest to do, since the power requirement to drive a tweeter is the lowest.In most cases, most average speakers and headphones will simply output the mids and upper mids clearly, and since this is where most instruments and vocals have a major role in, the listener doesnt feel anything is lacking except bass. So they simply turn on bass boost, which boosts the bass, and in effect you just have a loud speaker or headphone which is just distorting the sound. Instead, if you cut down the mids that the speaker/headphone seem most comfortable with, then you get a more balanced sound overall.

The best way to find out is to try bringing down each frequency by a few notches, and find out which bar made the biggest difference for the same -3db decrement. Keep that as your center, or the bottom of the V, and set the V curve accordingly. Say the speakers I use show the most difference in 1.2khz, i set that at what i feel is a comfortable level, say around -4 db. The immediate frequencies on either side will then be set at -3db, the next at -2db and so on.
Note that this isnt a rule or a fool proof practice. Its just a start, and once you start messing around with the EQ yourself, you will find a curve that suits your equipment and your music tastes and your preferences in sound. But EQ can play a very significant role in how good music sounds to your ears, so take the time to set the curve to your liking and you will definitely enjoy music more.

Tuesday, April 15, 2008

Digital Audio Part I

Over the next few days I am going to talk about digital audio. I am going to begin with Audio formats. Majority of people use MP3 files to store their music. This is basically a compressed format of the audio found on a CD, which is stored as a WAVE file (.wav format). While the wave file is a lossless format, meaning this holds all the information (albeit within the constraints of the CD standard, which I shall explain later), whereas the mp3 uses compression algorithms to make the file smaller. The resulting quality and size of an mp3 files are determined by the bitrate of the file. You can choose almost any bitrate under 320kbps, the most popular ones being 128kbps and 160 and 192 kbps.

The lower the bitrate the lower the quality of the file, and the smaller it is going to be. Due to bandwidth limitations, the internet adopted the lower bitrate as the choice for streaming content. However, there is little use for these bitrates outside of that. Compression uses several techniques to reduce the size of a file. The algorithm looks for frequencies above and below a certain threshold based on the bitrate and removes them in mp3 file. For example, a 128kbps file may remove all sounds above 16khz while the 192kbps might do slightly better by removing frequencies above 18khz. What does this mean to the end user? Its a trade off, human hearing goes all the way to 20 and even 22Khz for some people.

The mp3 file is going to miss out on the details of the higher frequencies. Take a cymbal for example. (The high frequency hits you hear in a drum kit). These spread across the higher end of the spectrum, but decay as an inverted V curve to look like a mountain. Say that particular sample is spread between 11khz and 18khz. If you were to use a 128kbps compression, the right edge of the mountain after 16khz is going to get cut off. Its gone, you cannot retrieve that information again and you are going to miss out on the full detail of that cymbal hit. Increase the bitrate of the mp3 however and you are going to get some more information. The same is true at the lower frequencies as well.

But this isnt the only problem with mp3 files. There are also compression artifacts, and other loss of details. Compression artifacts occur when the algorithm finds the sound too complicated to fill in all details at a given bitrate, hence you end up hearing stuff that wasnt there in the original song. This is especially audible on lower bitrate files. Check out the wikipedia page for a sample and you will know what I am talking about. Then there is the loss of information when there are simultaneous instruments or effects one significantly louder than the other. The louder effect or instrument gets priority and the subdued effect is all but gone in the resulting file. There have been some improvements over the years to mp3 however, one of them is the LAME encoder.

This is a slightly smarter mp3 encoder which at higher bitrates, retains most of the information. If you were to use LAME and encode a file close to 200kbps, then it would be tough to spot differences between this and the original wav file unless you have high end equipment which reveal very subtle nuances in music. For the average listener however, this is going to serve well. However, there is no use converting one mp3 to another, the information is already lost in the first mp3 file and it cannot be recovered. Further compression and loss will occur when you convert it to mp3 again. If you want to use LAME encoder, you have to get hold of the original cd and rip it again.These mp3 files are just like the others and will play on everything, the technique used to compress the file is different. Just google LAME and you can download the encoder.

The other development which is useful are Variable bitrate Mp3 files. This sets a range of bitrates to use, and depending on the complexity of the music passage, the bitrate is increased or reduced to store more or less information. These are better than regular mp3's for complex music with varying volume levels and several instruments playing. But personally, I stick to LAME at 195kbps or above.

The other way to enjoy music the way it was originally intended is to use lossless formats such as FLAC, AAC and APE. These are all developed by different organizations and all of them require their own codec (encoder/decoder) to create and play these files. The advantages to these formats are 1.They are smaller than the original wav file. and 2. They support tagging.
Wave files cannot have tags. They only hold file name. So if you are maintaining a digital music library, you will not see any artist info, album info etc etc for wav files, just file names. So unless you want to have 30-40 character file names for wav files with all info, you are better off using one of the lossless compression methods. There isnt any specific advantage of one vs the other.
The only advantage AAC has is that its an apple format and their mp3 players natively support it. To play flac files, you have to mess with the firmware and only some devices natively support FLAC.

However, these formats have not picked up in the commercial segment, and legal downloads still sell mp3 files (bandwidth/storage space being primary reasons). While it might work for when you just want one song off an album, if you are ever planning on getting the whole album, get the cd and rip it yourself, or make sure you either get lossless music, or atleast a high bitrate of above 192kbps. There is some false advertising in regard to mp3 stating that 160kbps is CD quality and 192kbps is better than CD quality.That is just plain wrong. To directly compare, CD audio bitrate would be around 1411.2kbps. 160kbps takes away information from the original file, extrapolates some of the details and creates a smaller version of the file.

The reason these were coined were to make it easy for internet streaming. There is a noticeable quality drop when you step down to 128kbps from 160 and to 96kbps from 128. Hence, for the average user to understand the difference in quality, they used common knowledge terms like CD quality, FM quality and Tape quality to compare the three bitrates. While its useful as a reference to how quality improves, the so called CD quality 160kbps is nowhere close to the actual CD itself. However, it loses minimal information, and especially when using lower end audio equipment, the differences are barely distinguishable. It is important to note that the quality of the file you listen to can be judged only based on what you use to listen to them. But thats a whole other topic. Next I shall talk about a different type of compression, the compression performed by audio engineers while mastering the tracks on an album.

Thursday, February 14, 2008

SACD and DVD-A

In this blog I want to discuss the High Resolution Audio formats Super Audio CD (SACD) and DVD Audio (DVD-A). The standard cd's that we buy are known as Redbook CD. The sampling rate of regular audio cd's we purchase in stores are 44.1khz at a resolution of 16 bits, whereas the sampling rates for SACD are almost 64 times that of a regular cd , and DVD-a is around 2-4 times more than a regular audio cd.

Sampling rate is the number of samples per second. A higher sampling rate would mean, more information is stored in the same second compared to the regular audio cd.

The bit depth refers to how much information is stored for each sample. So the higher the bit depth, more information is stored per sample. So its clear now why these are high resolution formats because for the same music, they store a lot more information which help in reproducing the audio closer to what was originally coming from the instruments or voices.

While this might not make a big impact for computer generated music such as techno and dance, the genre this has the largest impact on is the Classical music genre. When there is so much happening at the same time, several instruments playing together, you can imagine what a big difference 64 times more information can store.

The disadvantages of these formats are that they need dedicated players to decode the information and they will not work on our regular cd players. To make things worse, neither of these formats really got much recognition and there are only select artists who have released their albums in these formats. Also, the differences are night and day only when the corresponding equipment used (speakers, receivers, amplifiers) are all of high quality. Cheaper systems will not reveal the differences to justify investing in a dedicated player and buying the album again in a higher resolution.

The area where even cheaper systems can justify a purchase is when it comes to surround sound. Both formats support surround sound. If you currently have a home theater system setup with say a 5.1 setup, Left, Right, Center, Rear Left and Rear Right (thats 5) + subwoofer( thats 1), and if you have an album you like on SACD or DVDA, you should definitely pick it up and give it a shot. There are several extremely well executed Surround sound albums, even though the artist originally intended it to be a stereo recording. In most cases, they go back and remix the whole album in surround sound.

If you do not want to invest in a SACD player or DVDA player just yet, the advantage of most DVDA releases are that they are usually accompanied by a Dolby/DTS track also with the album in surround sound. While not equivalent to the quality of SACD, its still superior to the regular audio cd. So if you have a home theater with a regular DVD player (which can decode Dolby or DTS) then you can enjoy these albums in surround sound.

Some of the really good SACD's DVDA's
Pink Floyd - Dark Side of The Moon (SACD)
Nickelcreek - Nickelcreek (SACD)
Porcupine Tree - In Absentia (DVDA)
Porcupine Tree - Stupid Dream(DVDA)
Queen - A Night At The Opera (DVDA)
The Allman Brothers Band - Live At Fillmore East (DVDA)

Wednesday, February 13, 2008

Off the Air HDTV

Something a lot of people don't seem to know today is that you can get free HDTV channels off the air. All you need is an antenna that can receive HDTV signals. I have personally tried out several of these HDTV indoor antennas starting with RCA, moving on to Philips, and then settling for what is called a Silver Sensor antenna made my both Zenith and Terk. These are different from your regular rabbit ears antenna and are highly directional in nature. This means you have to figure out where the TV stations transmitters are located with respect to your TV's location and then find the optimal spot to place the antenna facing those transmitters. This can be found by trial and error, or by a visit to antennaweb.org. While the latter is not very intuitive, it gives out a detailed result of the compass directions of the transmitters based on your home address. If you have a compass handy, you can point the silver sensor in that direction. Even otherwise, you should be able to find East/West fairly easily, use that as reference.

I tried this and then tweaked the direction slightly based on trial and error, and managed to get NBC,CBS,ABC,Fox and MyNW all in full HD. The catch here is that all the towers might not be in the same direction. I have tried this at three locations and they seem to be more or less in the same direction, but you might have to end up picking favourites, or be ready to get up and turn the antenna a bit to watch your favourite program on a different station.

The best thing to do initially during setup would be to find a neutral direction which can tune in to all the channels so you can save them (even if some of them skip badly to an extent that they are unwatchable, your TV should atleast be able to identify that the station exists) and then fine tune the direction when you are watching TV based on which channel you want.

The other thing to remember here is that your TV needs to have an ATSC tuner built in or you need to get an ATSC tuner. External ATSC tuners seem to be hard to come by and quite expensive. Several name brand HDTV's have built in tuners, but there are a few smaller ones that don't. Make sure you check for that before you invest.

Relocating Start Bar in XP/Vista

For starters I will give a very simple XP/Vista tip that I have found very useful and time saving. This boils down to personal preference as well but you may like it once you have tried it. I am talking about changing the location of the taskbar to the top of the screen rather than the bottom of the screen.

The first time I saw a demo for XP, I noticed that they had the start bar on top of the screen and I thought it was pretty cool, so I tried it out. I later thought about why this makes sense. If you notice, most of the buttons are closer to the top of the screen rather than the bottom of the screen. In modern machines, the resolutions are quite high meaning you have more ground to cover on the screen if you havent changed the sensitivity of the mouse. For a simple check, place the cursor in the middle of the screen, try moving the mouse cursor to the bottom left of the screen. Then start from center and move it to the top left. In most cases, you will notice that it takes less effort to move the mouse cursor to the top right, since you can do that by just moving your wrist and not having to move your hand. This is made even simpler when you move the mouse cursor from somewhere near the File/Edit/View menu's in any window, or even the X or - sign on a window. Its a lot easier and quicker to move to the top right compared to moving all the way to the bottom left.

Theres a catch though. This will work efficiently only if you have the taskbar locked on the top of the screen. If you choose to auto hide it, the close,maximize and minimize buttons go behind
the taskbar when you are in focus, and sometimes when you want to minimize, you might end up triggering the taskbar to show, in which case you would have to move the mouse down
and then move back up. This can get quite frustrating.

So the tradeoff here is that fans of auto hide might not like this and you lose a bit of real estate on the screen cos the taskbar is always showing and the close/maximize/minimize buttons are moved under it. But this works for me, and I have found that I am able to work a lot quicker with the taskbar on the top and auto hide disabled.

To set this up, right click on the task bar (not on any application window, on a blank space on the taskbar)
Make sure Lock the Taskbar is unselected.
Then drag the taskbar to the top of the screen
Right click, go to properties and disable auto-hide, and enable Keep taskbar above other windows, hit ok
You can then right click and lock the task bar again

Follow same steps to bring the taskbar back to the bottom of the screen(need to re enable auto-hide if you want it back the way it was)

Intro

This blog is gonna be an technology oriented blog as the name suggests. Focussing on various aspects of modern technology which consumers have to deal with. Basically I will cover various aspects such as computers and consumer/pro-sumer(weird term I know) electronics This blog will have explanations on how things work, terminologies, upcoming technology updates, tips and tricks etc.

There are sites like Wikipedia and howstuff work for a more detailed explanation, but I will add elements from an end user perspective, my views will be added on whats what as well to give a more real world perspective instead of a purely academic perspective.

There are several people who will for sure know more than me in each aspect, so feel free to correct me if I am wrong, or add to the existing info if you feel its lacking. Thanks for visiting, hope this site helps.