Thursday 14 July 2011

Audio measurements

I have been trying to work out how to measure the performance of my audio system, in terms of dynamics and frequency response. First a bit about the audio performance of digital systems.

Digital audio levels

A digital audio recording cannot go above the level when all the bits in a sample are '1's. The Mac OS X defines 0dB as all the bits at '1'. The normal CD 0dB is is defined as OS X -12dB, and HD 0dB is defined as OS X -18dB, thus giving CDs an overhead of 12dB and HD audio an overhead of 18dB before digital clipping.

CD are recorded at 16bits/44.1kHz sample rate, HD is normally at 24bits/96kHz.

The CD's 16bits give an overall range of 96dB from silence to clipping, and HD gives 144dB. So referred to their respective 0dB levels CDs have 96-12 = 84dB range for normal recordings, and HD has 144-18 = 126dB.

The CD is a rather poor when trying to record live music as its range of 84dB plus an overhead for peaks of only 12dB does not match the range of sounds produced by, for example, an orchestra which can range from silence to +130-140dB. HD is a lot better with a range of 122dB and 18dB for peaks.

Music bandwidth

If you think about it the breath sounds of a person playing a flute are rather like a steady wind, in other words a very low frequency! The lowest notes from an organ are down to 16Hz, you tend to feel these sounds rather than hear them, but you do sense them and it is important to record and playback these very low frequencies. So at the bottom end I believe sound equipment should go down to at least 2Hz, with as much DC coupling as possible to prevent rapid roll off of the response.

At the top end many argue that since the human ear can only hear at very best up to 20kHz, with most of us capable of 12-18kHz depending on age, we need only handle up to 20kHz in our audio recordings and playback.

But this is a wrong argument, if we want to playback the sound made by a violin, then we have to reproduce all the frequencies and harmonics that the violin makes. And these stretch up to 40kHz or so. A trumpet's harmonics stretch up to 80kHz.

With the 44.1kHz sampling rate of a CD you are, at best limited to recording 22kHz, but at the recording stage you must filter out steeply any frequencies above this. In practice this means filters starting at 19-20kHz. Failure to cut off higher harmonics will cause severe distortion on decoding the digital audio. HD is a lot better using 96kHz, thus able to handle frequencies up to 48kHz.

Why do we need to handle these harmonics, you cannot get the true timbre of a sound unless you record the full frequency range it makes including all its harmonics. A cymbal crash has 40% of its audio power above 20kHz, a rattle of a bunch of keys has sounds up to above 50kHz. An audience applauding has a huge range of high harmonics, and poor, limited systems will easily show there limitations.

Testing

An Apple Mac has an internal audio core that operates at 32bit, and up to 192kHz at least. Thus giving it a huge dynamic range before clipping and a wide bandwidth. So a Mac can be used for audio measurements.

Source and measurement

A freeware program called Signal Inspector has an adequate Tone Generator, with the range we need (say 5Hz to 50kHz) and it has a reasonably accurate level calibration, you can set the output to be CD -12dB or HD -18dB as your reference level. For measurement of the system output the program Sound Studio, which also records up to 96kHz sample rate and 24bits, can be used.

An audio file can be recorded with frequencies over the whole range, and saved in AIFF format (uncompressed PCM) at 24bit/96kHz. This file can then be played back using Sound Studio, Quicktime or iTunes and the system output monitored using Signal Inspector or again Sound Studio. If Sound Studio is used then the system output can be recorded and studied later.

Screen shot 2011 07 14 at 15 13 34

The top program running is Sound Studio with its recording window and its input monitor window shown, the bottom two windows are two tone generators, for left and right, using Signal Inspector.

The performance of the DAC and ADC in the Mac is impressive and analog signals can be generated and monitored. Digital signals can be connected by an optical TOSLINK/SPDIF input/output connection for checking the performance of items like the Apple Express and Apple TV.

Patching

If you want to feed audio from the output of one program to the input of another then the excellent utility Sound Flower can be used, if this is combined with the input/output control provided by the PTHVolume program, you will have a very flexible set up.

Noise spectrum

As a matter of interest Signal Inspector can generate a Noise signal, when this is recorded via Sound Flower to Sound Studio, and the Audio Fourier Specrum analysis made, this is the result:

Screen shot 2011 07 14 at 16 04 19

No comments: