home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / sci / electron / 22247 < prev    next >
Encoding:
Text File  |  1993-01-08  |  3.0 KB  |  70 lines

  1. Newsgroups: sci.electronics
  2. Path: sparky!uunet!mcsun!sun4nl!sci.kun.nl!pieterh
  3. From: pieterh@sci.kun.nl (Peter Herweijer)
  4. Subject: Re: "1-bit DAC"
  5. Message-ID: <C0JEr2.68o@sci.kun.nl>
  6. Sender: news@sci.kun.nl (News owner)
  7. Nntp-Posting-Host: wn2.sci.kun.nl
  8. Organization: University of Nijmegen, The Netherlands
  9. References: <C0F8Hp.84n@ve7frg.ampr.org> <1993Jan7.235144.15771@clsi.COM>
  10. Date: Fri, 8 Jan 1993 13:28:13 GMT
  11. Lines: 57
  12.  
  13. In <1993Jan7.235144.15771@clsi.COM> kevin@clsi.COM (Kevin Cameron) writes:
  14.  
  15. >In article <C0F8Hp.84n@ve7frg.ampr.org>, doug@ve7frg.ampr.org (Doug Collinge - VE7GNU) writes:
  16. >> If my CD with a "1 bit DAC" and the aid of "8 times oversampling"
  17. >> can produce audio as good as an older CD with no "oversampling" and
  18. >> a 16-bit DAC then can my circuit with an 8-bit DAC be replaced
  19. >> with a 1-bit DAC and 4-times oversampling?
  20. >> 
  21. >> How?  What's the math behind this concept anyway?
  22.  
  23.     [explanation deleted]
  24.  
  25. >I'm not sure what scheme the "1 bit DAC" actually uses, but the implication is
  26. >that you would need 256 times over-sampling for 8bits. 
  27.  
  28. Mostly right, but let me put in my $0.02:
  29.  
  30. in order to produce an average DC signal of 1/256 part of maximum, an
  31. 1-bit DAC produces 255 0's to every 1.  For a 'dumb' 1-bit DAC, this
  32. would imply that in order to get 8-bit resolution, 256 times oversampling
  33. is required; for 16-bit resolution, 65536 times oversampling.
  34.  
  35. However audio signals are never static (except when silent). By making
  36. the place where the 1's and the 0's are put, corresponding to one input
  37. sample, dependent on the shape of the input as a whole, it is possible
  38. to produce a more accurate result using the same oversampling rate
  39. (excuse me for my rather clumsy way of putting this). This is achieved
  40. at the cost of a very chaotic behaviour of small trains of 0's and 1's,
  41. as you can imagine. The net effect is that the quantisation noise 
  42. ( = DAC error) is moved from low frequencies (the audio band) to high
  43. frequencies (just below the oversampling frequency where they can be
  44. easily filtered out). Hence the term "noise shaping".
  45.  
  46. The simplest (first order) noise shaping algorithm goes like this:
  47.  
  48.     error := 0
  49.     loop begin
  50.         data := sample                          { 0<sample<1 }
  51.         for n:= 1 to oversampling_rate begin
  52.             output := round(data + error)       { round(x) = 0 if x<0.5  }
  53.             error  := error + data - output     {            1 otherwise }
  54.         end
  55.     end
  56.  
  57. The error made by converting the input to 1 bit is carried over to the
  58. next sample, etc.  For, say, a DC level of 1/256, this noise shaper would
  59. behave just as a 'dumb' 1-bit DAC, and a tone of 1/256 the sampling
  60. frequency would be audible, but for real world signals this performs
  61. much better. For large oversampling rates, by the way, this simple
  62. algorithm breaks down and higher-order algorithms are needed.
  63.  
  64. This is about all I know about it. If someone out there can tell what
  65. the theoretical S/N ratio for this scheme is, and how higher-order noise
  66. shaping algorithms work: I, for one, would be interested to hear!
  67.  
  68. Peter Herweijer
  69. pieterh@sci.kun.nl
  70.