home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / multimed / 2523 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  3.6 KB

  1. Xref: sparky comp.multimedia:2523 comp.os.ms-windows.programmer.misc:1526
  2. Newsgroups: comp.multimedia,comp.os.ms-windows.programmer.misc
  3. Path: sparky!uunet!mcsun!sunic!kth.se!nada.kth.se!pesjogre
  4. From: pesjogre@nada.kth.se (Peter Sj{gren)
  5. Subject: Re: SoundBlaster sampling frequency accuracy
  6. Message-ID: <1992Aug27.141037.15332@kth.se>
  7. Originator: pesjogre@byse.nada.kth.se
  8. Sender: usenet@kth.se (Usenet)
  9. Nntp-Posting-Host: byse.nada.kth.se
  10. Reply-To: pesjogre@nada.kth.se (Peter Sj{gren)
  11. Organization: Royal Institute of Technology, Stockholm, Sweden
  12. Date: Thu, 27 Aug 1992 14:10:37 GMT
  13. Lines: 74
  14.  
  15.  
  16. Thank you for your answers!
  17.  
  18.  
  19. In article <176946INN2pv@ensta.ensta.fr> you write:
  20. >frequency is coded on one byte, at offset 4 in a Voice Data block. The
  21. >sampling rate is the determined by using the formula:
  22. >
  23. >SR(1 byte)=256-1000000/SamplingRate
  24. >
  25. >    Which means exactly what I was saying... As the sampling rate is
  26. >defined on 1 byte, it's precision is of 1/256=0.4% which means that when
  27. >sampling ANYTHING at 11000Hz, you may actually be sampling at anything
  28. >between 10989 and 11111 Hz... and, when replaying, you have the same
  29. >possible variations... Dont be surprised if the sound you sample then play
  30. >again varies... You may have sampled at 10989 and played at 11111 Hz...
  31. >Or vice versa...
  32. >
  33.  
  34. Yes, that is true. But even if the sampling frequency is stored in the 
  35. SoundBlaster card in one byte (which has few discrete values) the soundcard
  36. can, still, provide a sampling frequency that is much more accurate than
  37. between two levels in the representation of the sampling frequency in one
  38. byte.
  39.  
  40. For example, if we, in the above formula have a SR-byte value of, say 156,
  41. the sampling rate would be   1000000/(256-156) = 10000. The question is 
  42. now how accurate THIS value (10000 Hz) is. And that is only dependent on
  43. the implementation in the sound card. This accuracy has nothing to do with
  44. how many discrete steps the sampling frequency can by specified in. In this
  45. case I want exactly 10000 Hz and I couldn't tell the card that more accurately
  46. with a 64-bit word.
  47.  
  48.  
  49. By the way...
  50.  
  51. I recorded the tuning fork on a PC in Windows 3.1 SoundRecorder and I think
  52. that the SoundRecorder wants to record in 11025 Hz (that is what it says
  53. in the .WAV file that is produced by the SoundRecorder). The formula gives:
  54.  
  55.   SR(byte) = 256 - 1000000/11025 = 165.29705...  that is NOT an even number
  56.  
  57. so the soundblaster card must (if it stores the sampling frequency in one
  58. byte) round this value. I don't know how the Windows SoundBlaster drive
  59. does it, but just suppose that it is rounded up to 166. Then the sampling
  60. frequency would be:
  61.  
  62.     1000000/(256-166) = 11111.11111 .....
  63.  
  64. and that would give a frequency of 11025/11111.111 * 440 = 436.6 when
  65. you record a 440 Hz tone and think the sampling frequency is 11025 and
  66. it really is 11111 Hz. (436 Hz +- 0.7  is what I got in the experiment.)
  67.  
  68. >    A Sound Blaster never was precise...
  69. Perhaps, perhaps not...
  70. >
  71.  
  72. Windows Multimedia waveaudio devices seem to (according to the Multimedia
  73. reference in SDK) "prefer" to record and play at sampling rates of
  74. 44100, 22050, 11025 etc and if the above SR(byte) formula is used in
  75. SoundBlaster cards it seems that the sampling rate in the soundblaster 
  76. cannot be stored correctly. That is 11025 Hz becomes 11111 Hz and so on.
  77. How is this with other sound cards, are they able to exacly represent
  78. 11025, 22050 and 44100???
  79.  
  80. Please correct me if I am wrong and tell me more information in either
  81. case. Especially how the rounding is performed in the SoundBlaster drive and
  82. how other cards represent the sampling rate.
  83.  
  84. Thank you very much!
  85. Peter Sjogren            (peter@jada.se    or    pesjogre@nada.kth.se)
  86. Sweden
  87.  
  88.  
  89.