Page 1 of 2 12 LastLast
Results 1 to 16 of 24

Thread: How Digital Audio works

  1. #1
    Va Va Voom Lowe's Avatar
    Join Date
    Jul 2003
    Location
    Newcastle Under Lyme
    Posts
    6,744
    Thanks
    321
    Thanked
    356 times in 265 posts
    • Lowe's system
      • Motherboard:
      • Gigabyte Z97MX Gaming 5
      • CPU:
      • Intel i5 4690K
      • Memory:
      • 16GB Crucial Ballistix Tactical
      • Storage:
      • Crucial M550 256GB and 1TB spindle drive
      • Graphics card(s):
      • Palit Geforce GTX1080 Jetstream
      • PSU:
      • EVGA 600w
      • Case:
      • Coolermaster Silencio 352 m-ATX
      • Operating System:
      • Win 7/Mac OSX
      • Monitor(s):
      • 27" 1080p AOC, Oculus Rift CV1
      • Internet:
      • 200mb Virgin VIVID

    Smile How Digital Audio works

    Digital Audio Systems

    We all have our CD players, MP3 players, and DVD audio is beginning to make an appearance. But, have you ever taken a thought to how all this works? Ever wondered what the “bit rate” and “sample rate“ had to do with the price of fish? Well, if so this post will hopefully answer a few questions. It’s a bit of a slog reading through this so I suggest breaking it down a bit to save your head from hurting. Oh, and if you do have any questions please post them up. Oh.. and excuse my MS Paint skills.. or lack of!


    Digital Audio Basics

    Right, firstly we have our source sound. This could be our voice, an instrument etc. This sound needs to be converted into a signal we can work with. To do this we need a transducer that will take real world sound and convert it into an electrical signal. In most cases this will be some form of microphone. The problem is, the signal that we will get from the mic will be an analogue signal. So… we need to convert it into a digital signal. To do this we use a little device called an Analogue to Digital Converter. The overall quality of this device is critical to the final resulting digital sound. Use a poor quality cheap converter and you’ll get a naff sound. This is why on digital mixers you rarely have more than a few analogue input channels and why a decent digital desk (such as Yamaha’s O2R96) cost so blummin’ much! Once the signal is in the digital domain we can then use our computer to record it, manipulate it and do all sorts of other weird and wonderful things!


    Analogue to Digital Conversion

    This is the science bit peeps. Lets imagine for a second we’re recording a simple sine wave. This sine wave has a fixed amplitude (how loud it is) and a fixed frequency (the musical “pitch”).

    It might look a little like the following:



    For us to convert it into the digital domain we firstly need to snip the wave up into regular segments horizontally and vertically on the X and Y axis. If we now take a “sample” recording at each of the points we get something that looks a bit like this:



    This is a very basic approximation of our analogue source. How might we make this a bit better? Well, if you look at the pic you can see that the wave is staircase like. To get a better representation of the source wave we need to increase the number of steps (samples) on the staircase… To something like this perhaps:



    The increased sample rate has left us with a representation that is far closer to the original. But, it’s far from perfect. The signal is still looking a little staircase like and we’re still having huge jumps on the Y axis. The Y axis showing the amplitude needs increasing as well. So, if we increase our bit depth and up the sample rate again, then we get the following:



    This is looking much more like our original signal. The bit depth has given us a much better representation. This is very important to us, since the less like the original sound our digital representation is, the more hiss and noise we will experience when we listen to it. This noise is known as “Quantise Error”, and is unfortunately an integral part of any digital audio system. The best way of avoiding it is to ensure that the bit depth is as high as reasonably possible. To put it into perspective, if we have a depth of 8 bits, then we would have a possible 256 values or steps on the Y axis. If we boost that to 16 bits then we could have a possible 65,536 steps! This will obviously go a long way to avoiding any quantise error. Just to reiterate though, the quantise error noise will always be there. We can’t remove it, we can just minimise it.

    So, for this section we have established the following. The higher the bit depth and sample rate is, the better the digital representation will be, therefore the better it will sound. If you’re head’s had enough for one day, stop here.. otherwise carry on…



    A clever dude called Harry Nyquist

    So our final sound can always be improved by upping the sample rate (x axis) or the bit rate (y axis) can’t it? Well, yes and no. Like most things in life we have a law of diminishing returns. You do get to a point where the signal is that close to the original source the human ear is unable to detect the difference. The other problem we have is the size of all this data. With recording studios, audio sample rates of 96khz aren’t uncommon… Let’s put this into perspective. With a typical piece of music being 4 minutes long, each mono recording we make (each channel) at 96khz will take up 46,080,000 bytes. That’s 46 meg of space per instrument, and you could have 16+ channels on the go at once. This is before we’ve even started to get into edits, second and third takes etc. Hell, our final recording where we master it down to 2 channels would end up being 92,160,000 bytes. 92 meg! Imagine if every tune you had was 92 meg or more. IBM, Western Digital et al would love it! This is overkill though, we don’t really need to use sample rates of this order unless we’re in a pro studio. Especially, as the human ear has limits…

    The human ear is a fantastic piece of kit. It works over a massive range, of both frequency (pitch) and dynamics (volume). In terms of frequency, a good human ear can hear sounds ranging from 20hz to 20khz. From sounds that make the floor move, to high pitched sounds like nails down a blackboard, your ears do a fantastic job of picking it all up no matter virtually how loud or quiet it is. Hell, I could rave on about our ears for hours but I won’t. So what does this have to do with our digital audio? Nyquist’s Theorem.

    Nyquist’s Theorem states that to reproduce an analogue signal properly in the digital domain, that the sample rate must be at least twice as high as the highest frequency in the analogue signal. So, if our piece of music has a highest frequency of 10khz, we must ensure the sample rate is at least 20khz. With the human ear being able to detect frequencies up to 20khz, it makes sense that we take samples no higher than ~40hkz, else we’re wasting space since the ear won’t be able to hear it.

    It’s no coincidence that the sample rate of CD audio is 44.1khz / 16 bit. This sample rate offers good quality audio, covers the best of human ears, and is also tied into the fact that CD mastering used to use video equipment, but that’s something for another day.


    Oversampling

    So what about these stupidly high sample rates of 192khz and this 2x or 4x playback oversampling stuff I hear you say? Well, remember earlier I mentioned that all digital audio systems suffer from quantise error? Well, oversampling is yet another way of minimising this hiss and noise. The amount of quantise noise in a system is always fixed. It can’t be removed in any way, but it can be “hidden”. Oversampling is a clever way of using the ears limitations to hide the noise as best as possible in a way that we can’t actually hear it.

    Imagine a rectangle. Lets say for example it’s 4 units wide and 2 units high. This gives us as area inside the rectangle of 8 units (4x2). Now, suppose this area inside the rectangle is quantise noise, and the quantise noise is fixed. That means our noise level is 8 units. Still with me?

    Now imagine if we rearrange the rectangle so that instead of being 4x2, it was 2x4. The area inside the rectangle is the same isn’t it? Now what if we rearranged the rectangle again so it was 8x1. Still the same area…

    Imagine that we put those shapes onto a graph. The X axis is frequency, the Y axis is amplitude. Which of those shapes has the lowest amplitude?



    The 8x1…

    Now lets suppose the upper threshold of hearing was 4 units on the X axis. Since the threshold is 4, anything above 4 wouldn’t be heard. We’ve just halved the amount of quantise noise that’s audible! This would be 2x oversampling. We could take it even higher – bump it up to 16x0.5 or 32x0.25 and reduce the audible level even further!

    In case that's as clear as mud, here's another couple of pics illustrating it in a similar way:



    Imagine the first piccy is our typical CD player. 16bit, 44.1khz sample rate. The blue area in the graph is the noise. Now we can't get rid of that - though we can "hide" it. If we oversample.. say twice the rate, then the noise level has to be reduced since the amount of noise in the system as a whole is constant - it cannot be altered.

    The beauty of this is we can't hear above the red dotted line. So the noise level is effectively reduced, or hidden. The higher you oversample, the lower the quantise noise. Once the signal is oversampled, it has to be brought back down to 44.1khz again else it would play at a faster speed. A DAC does this, and in the process reduces our noise overhead.



    And that is the end of the analogue to digital process. Once it’s converted you can store your audio assuming you have enough room for it all… if not, it’s time for compression… which I think we’ll leave for another day!

    Hope you found that useful, and you could understand it. As I said before, if anything puzzles you chuck a question up and I’ll do my best to explain it a different way.
    Last edited by Lowe; 25-05-2006 at 03:28 PM. Reason: Typo :o

  2. #2
    Drop it like it's hot Howard's Avatar
    Join Date
    Jul 2003
    Location
    Surrey, South East
    Posts
    11,731
    Thanks
    14
    Thanked
    42 times in 39 posts
    • Howard's system
      • Motherboard:
      • Asus P5B
      • CPU:
      • Core2Duo E6420 2.13GHz
      • Memory:
      • 2x1gb OCZ DDR2 6400
      • Storage:
      • 250GB & 500GB Seagate
      • Graphics card(s):
      • Inno3d iChill 7900GS
      • PSU:
      • Antec SmartPower 500W
      • Case:
      • Coolermaster Elite 330
      • Monitor(s):
      • 2x AG Neovo F419
      • Internet:
      • Virgin Media 20mbit
    Brilliant post I'm sure many people are wondering how it all works!
    Home cinema: Toshiba 42XV555DB Full HD LCD | Onkyo TX-SR705 | NAD C352 | Monitor Audio Bronze B2 | Monitor Audio Bronze C | Monitor Audio Bronze BFX | Yamaha NSC120 | BK Monolith sub | Toshiba HD-EP35 HD-DVD | Samsung BD-P1400 BluRay Player | Pioneer DV-575 | Squeezebox3 | Virgin Media V+ Box
    PC: Asus P5B | Core2duo 2.13GHz | 2GB DDR2 PC6400 | Inno3d iChill 7900GS | Auzentech X-Plosion 7.1 | 250GB | 500GB | NEC DVDRW | Dual AG Neovo 19"
    HTPC: | Core2Duo E6420 2.13GHz | 2GB DDR2 | 250GBx2 | Radeon X1300 | Terratec Aureon 7.1 | Windows MCE 2005
    Laptop: 1.5GHz Centrino | 512MB | 60GB | 15" Wide TFT | Wifi | DVDRW


  3. #3
    HEXUS.timelord. Zak33's Avatar
    Join Date
    Jul 2003
    Location
    I'm a Jessie
    Posts
    34,256
    Thanks
    2,610
    Thanked
    2,682 times in 1,688 posts
    • Zak33's system
      • Storage:
      • Kingston HyperX SSD, Hitachi 1Tb
      • Graphics card(s):
      • Nvidia 1060
      • PSU:
      • Coolermaster 800w
      • Case:
      • Silverstone Fortress FT01
      • Operating System:
      • Win10
      • Internet:
      • Zen FTC uber speedy
    bloody hell Lowe

    Quote Originally Posted by Advice Trinity by Knoxville
    "The second you aren't paying attention to the tool you're using, it will take your fingers from you. It does not know sympathy." |
    "If you don't gaffer it, it will gaffer you" | "Belt and braces"

  4. #4
    Cable Guy Jonny M's Avatar
    Join Date
    Jul 2003
    Location
    Loughborough Uni
    Posts
    4,263
    Thanks
    0
    Thanked
    4 times in 1 post
    Now I know what my Panasonic CD deck is on about when it talks about oversampling

  5. #5
    HEXUS.timelord. Zak33's Avatar
    Join Date
    Jul 2003
    Location
    I'm a Jessie
    Posts
    34,256
    Thanks
    2,610
    Thanked
    2,682 times in 1,688 posts
    • Zak33's system
      • Storage:
      • Kingston HyperX SSD, Hitachi 1Tb
      • Graphics card(s):
      • Nvidia 1060
      • PSU:
      • Coolermaster 800w
      • Case:
      • Silverstone Fortress FT01
      • Operating System:
      • Win10
      • Internet:
      • Zen FTC uber speedy
    that is SOO good

    Quote Originally Posted by Advice Trinity by Knoxville
    "The second you aren't paying attention to the tool you're using, it will take your fingers from you. It does not know sympathy." |
    "If you don't gaffer it, it will gaffer you" | "Belt and braces"

  6. #6
    Cable Guy Jonny M's Avatar
    Join Date
    Jul 2003
    Location
    Loughborough Uni
    Posts
    4,263
    Thanks
    0
    Thanked
    4 times in 1 post
    So 4x oversampling means the blue box is stretched out to 4x it's original width?

  7. #7
    Va Va Voom Lowe's Avatar
    Join Date
    Jul 2003
    Location
    Newcastle Under Lyme
    Posts
    6,744
    Thanks
    321
    Thanked
    356 times in 265 posts
    • Lowe's system
      • Motherboard:
      • Gigabyte Z97MX Gaming 5
      • CPU:
      • Intel i5 4690K
      • Memory:
      • 16GB Crucial Ballistix Tactical
      • Storage:
      • Crucial M550 256GB and 1TB spindle drive
      • Graphics card(s):
      • Palit Geforce GTX1080 Jetstream
      • PSU:
      • EVGA 600w
      • Case:
      • Coolermaster Silencio 352 m-ATX
      • Operating System:
      • Win 7/Mac OSX
      • Monitor(s):
      • 27" 1080p AOC, Oculus Rift CV1
      • Internet:
      • 200mb Virgin VIVID
    Yup, which would mean the box is 4x as short.. so far less noisy

  8. #8
    iMc
    iMc is offline
    Senior Member iMc's Avatar
    Join Date
    Aug 2003
    Location
    Northants
    Posts
    3,616
    Thanks
    2
    Thanked
    0 times in 0 posts
    Very very good post, make it a STICKY!
    HEXUS|iMc

  9. #9
    DR
    DR is offline
    on ye old ship HEXUS DR's Avatar
    Join Date
    Jul 2003
    Location
    HEXUS HQ, Elstree
    Posts
    13,366
    Thanks
    1,014
    Thanked
    774 times in 352 posts
    Jesus Christ - glad I am having a drink...

  10. #10
    Monkey Apex's Avatar
    Join Date
    Jul 2003
    Location
    Huddersfield
    Posts
    4,244
    Thanks
    723
    Thanked
    148 times in 89 posts
    • Apex's system
      • Motherboard:
      • Asus Z87M-PLUS
      • CPU:
      • Intel i5-4670K
      • Memory:
      • 16 GiB
      • Storage:
      • 6.0 TiB
      • Graphics card(s):
      • R9 480X
      • PSU:
      • 750
      • Case:
      • Node 804
      • Operating System:
      • Windows 7 64Bit
      • Monitor(s):
      • Dell U2410 24"
      • Internet:
      • 200Mb nTL Cable
    Rated

    am now going to have to lay down for a bit.



  11. #11
    Va Va Voom Lowe's Avatar
    Join Date
    Jul 2003
    Location
    Newcastle Under Lyme
    Posts
    6,744
    Thanks
    321
    Thanked
    356 times in 265 posts
    • Lowe's system
      • Motherboard:
      • Gigabyte Z97MX Gaming 5
      • CPU:
      • Intel i5 4690K
      • Memory:
      • 16GB Crucial Ballistix Tactical
      • Storage:
      • Crucial M550 256GB and 1TB spindle drive
      • Graphics card(s):
      • Palit Geforce GTX1080 Jetstream
      • PSU:
      • EVGA 600w
      • Case:
      • Coolermaster Silencio 352 m-ATX
      • Operating System:
      • Win 7/Mac OSX
      • Monitor(s):
      • 27" 1080p AOC, Oculus Rift CV1
      • Internet:
      • 200mb Virgin VIVID
    It's a bit much for one single read as I warned - best to flick over it once just to try to get your head around it, then come back in a day or so's time and really try to understand each bit. I promise it all makes sense

  12. #12
    Va Va Voom Lowe's Avatar
    Join Date
    Jul 2003
    Location
    Newcastle Under Lyme
    Posts
    6,744
    Thanks
    321
    Thanked
    356 times in 265 posts
    • Lowe's system
      • Motherboard:
      • Gigabyte Z97MX Gaming 5
      • CPU:
      • Intel i5 4690K
      • Memory:
      • 16GB Crucial Ballistix Tactical
      • Storage:
      • Crucial M550 256GB and 1TB spindle drive
      • Graphics card(s):
      • Palit Geforce GTX1080 Jetstream
      • PSU:
      • EVGA 600w
      • Case:
      • Coolermaster Silencio 352 m-ATX
      • Operating System:
      • Win 7/Mac OSX
      • Monitor(s):
      • 27" 1080p AOC, Oculus Rift CV1
      • Internet:
      • 200mb Virgin VIVID
    Just redone the links so the pics work. Hopefully someone will find it useful

  13. #13
    Vive le pants! directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • MSI X99A Gaming 7
      • CPU:
      • Intel Core i7 5280k
      • Memory:
      • 32GiB ADATA DDR4
      • Storage:
      • Corsair Neutron XT 960GB
      • Graphics card(s):
      • MSI GTX 980 Gaming 4G Twin Frozr 5
      • PSU:
      • Corsair AX860i
      • Case:
      • NZXT H440
      • Operating System:
      • Ubuntu 17.10, Windows 10
      • Monitor(s):
      • Dell U2713HM
      • Internet:
      • FIOS
    couple of the pics are missing, lowe, but it's good stuff

  14. #14
    Va Va Voom Lowe's Avatar
    Join Date
    Jul 2003
    Location
    Newcastle Under Lyme
    Posts
    6,744
    Thanks
    321
    Thanked
    356 times in 265 posts
    • Lowe's system
      • Motherboard:
      • Gigabyte Z97MX Gaming 5
      • CPU:
      • Intel i5 4690K
      • Memory:
      • 16GB Crucial Ballistix Tactical
      • Storage:
      • Crucial M550 256GB and 1TB spindle drive
      • Graphics card(s):
      • Palit Geforce GTX1080 Jetstream
      • PSU:
      • EVGA 600w
      • Case:
      • Coolermaster Silencio 352 m-ATX
      • Operating System:
      • Win 7/Mac OSX
      • Monitor(s):
      • 27" 1080p AOC, Oculus Rift CV1
      • Internet:
      • 200mb Virgin VIVID
    Aww crap, looks like one's been lost for good then when I moved hosts. I'll have to redraw something then.

  15. #15
    Senior Member FatalSaviour's Avatar
    Join Date
    Jun 2004
    Location
    London/Oxford/York
    Posts
    1,876
    Thanks
    42
    Thanked
    12 times in 11 posts
    • FatalSaviour's system
      • Motherboard:
      • MSI P55-GD80
      • CPU:
      • Intel Core i7 860
      • Memory:
      • 4x2GB GEiL PC17000
      • Storage:
      • 3x1000GB, 2x500GB (RAID1), 1x2TB
      • Graphics card(s):
      • GTX 470
      • PSU:
      • Corsair HX700
      • Case:
      • Antec P180
      • Operating System:
      • Win 7 x64
      • Monitor(s):
      • Dell U2311, Dell 2005FPW
      • Internet:
      • VM 30Mb
    Quote Originally Posted by David
    Jesus Christ - glad I am having a drink...
    I'm just going for the same . Great post though Lowe

  16. #16
    Senior Member Robert's Avatar
    Join Date
    Oct 2005
    Location
    North West
    Posts
    1,003
    Thanks
    2
    Thanked
    9 times in 5 posts
    • Robert's system
      • Motherboard:
      • Asus P6X58D Premium
      • CPU:
      • Intel i7 920
      • Memory:
      • Corsair 12GB Dominator 1600Mhz
      • Storage:
      • 10TB
      • Graphics card(s):
      • Nvidia GTX 480
      • PSU:
      • Corsair AX1200
      • Case:
      • Corsair 800D
      • Operating System:
      • Windows 7 HP Retail
      • Monitor(s):
      • Eizo SW110W+
      • Internet:
      • Virgin Media 100Mb
    It's all really easy if you take time to read it. I've done alot of this over the past 2 years at uni. I can't see it mentioned but during AD conversion - it's good to use "sample and hold" technique. Instead of dropping the voltage and then upping it again for the next part - the voltage is held at a high state to (ADC conversions need a steady voltage).

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. More Redoute codes !
    By Scooby in forum Retail Therapy and Bargains
    Replies: 17
    Last Post: 31-08-2004, 06:14 PM
  2. 3.5mm digital out to digital coax in on a decoder?
    By Alex in forum Consumer Electronics
    Replies: 3
    Last Post: 17-03-2004, 07:43 PM
  3. Wireless audio transmission
    By DsW in forum PC Hardware and Components
    Replies: 11
    Last Post: 08-01-2004, 12:14 AM
  4. no audio in WinME!! please help
    By shiato storm in forum PC Hardware and Components
    Replies: 3
    Last Post: 05-11-2003, 03:40 PM
  5. Audigy 1 Digital Output
    By Zak33 in forum PC Hardware and Components
    Replies: 0
    Last Post: 23-08-2003, 07:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •