[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference napalm::commusic_v1

Title:* * Computer Music, MIDI, and Related Topics * *
Notice:Conference has been write-locked. Use new version.
Moderator:DYPSS1::SCHAFER
Created:Thu Feb 20 1986
Last Modified:Mon Aug 29 1994
Last Successful Update:Fri Jun 06 1997
Number of topics:2852
Total number of notes:33157

1412.0. "Sample Rate/# of Bits on Samplers - Please Explain" by FGVAXZ::LAING (Jim*261-2194*DEC MemorabiliaCollector) Wed May 25 1988 03:49

    Maybe the answer to this is buried somewhere in this notes file,
    if so, point me to it ... 
    
    How do BIT RATE and SAMPLING RATE affect the quality/realness of
    samples?  I know that in the simple sense "the higher the bit rate,
    potentially the better the sample can be", and the "sampling rate
    twice the rate of the hightest frequency theoretically reproduced"
    but what little "theory" I know seems to contradict the facts (i.e.
    the SOUNDS i hear from various samplers/sample-players).  
    
    For example, the Roland S-50 and derivatives sample at 30KHz max,a
    and they're 12-bit.  I read somewhere that the Kurzweil samples
    at only 25KHz, but it's 16-bit.  Although there must be many other
    factors to consider, what is going on here?  Plenty of people rate
    the Kurzweil samples as "excellent" or even "incredible", and I've
    heard lots of rave reviews of the S-50, including a piano sample
    for it.  How can this be, considering that they can (theoretically)
    only reproduce up to 12.5Khz and 15KHz respectively?  Can the bit
    rate and/or sampling rate be looked at in this siplistic way?  Can
    the ear really not detect the "missing" frequencies beyond 15KHz
    or so?  I seem to remember reading (maybe in AUDIO) that sounds
    even beyond 20KHz may contribute in some subtle way to the psycho-
    acoustics related to the "real-ness" of a recorded (i.e. sampled)
    sound ... help me to understand all of this!
    
    		-Jim
T.RTitleUserPersonal
Name
DateLines
1412.1A picture would be worth 1K words...JAWS::COTERead it and weep...Wed May 25 1988 12:3331
    A high sampling rate means you take more 'pictures' of the analog
    signal in a given time. By doing so, the differences between discreet
    samples become smaller allowing you to more closely approximate
    the smooth curves of the analog.
    
    (Oh for a graphic editor right now...)
    
    The 2X thingie your talking about is the Nyquist limit. It states
    simply that the theoretical minimum sampling rate you can use to
    accurate capture an analog is twice the frequency of the sound you
    are sampling. In practice, it's more than 2X.
    
    By "bit rate" I assume you are referring to the number  of bits
    used to describe any particular sample. Most consumer samplers
    are 8, 12 or 16 bits. By increasing the number of bits, you
    can get more precision in representing a particular sample.
    
    To illustrate, if you had a 2 bit sampler (uck) you would be limited
    to 4 possible 'words' to describe all possible variations of the
    analog. Everything, regardless of value, would be represented by
    either 00, 01, 10 or 11. The value 1.51(decimal) would be represented 
    as 10 (binary) just as 2.49 would. You should be able to see that
    there is quite a large range of analog values that *must* be
    represented (and hence reproduced) by the *same* digital value. 
    
    Increase the number of bits in the word and you don't have to round 
    a value as far to align it with a possible word, there are more
    possible digital combinations to represent a discrete analog
    value.
    
    Edd
1412.2More Questions...FGVAXZ::LAINGJim*261-2194*DEC MemorabiliaCollectorWed May 25 1988 17:4815
    OK, given the technical descriptions and theoretics behind sampling,
    are there any fairly simple "rules" one can follow in using the
    sampling rate and bit/sample numbers as indicators of the potential
    quality of a sampler?  I ask because, contrary to what I'd believed,
    you don't need a high sampling rate to get exceptional quality -
    the Kurzweil and Roland S-50 are examples ... 25KHz and 30KHz max
    sampling rates respectively.  Could I expect a 44KHz or 50KHz sampler
    to provide markedly higher sound quality/sample reproduction?  And,
    where does the bits/sample number fit in ... that is, is 16 bits
    going to make a big difference over 12 (or 8) of the sampling rate
    is some particular value?  Or course, there must be other things
    I'd need to consider (filters?  My ear?) when trying to judge quality
    (or potential quality) of a sampler ?
    
    	-Jim
1412.3DFLAT::DICKSONNetwork Design toolsWed May 25 1988 18:2311
1)  It could be that the people who miked, recorded, filtered, and digitized
the good-sounding samples knew what they were doing, while the others did not. 

2)  It could be the analog stages.  In home digital audio equipment (CD
players), there is an audible difference between players from different makers
and different models from the same maker.  Even with the same digital specs.
The difference comes from the quality of the components used *after* the D/A
converter.  Dumb stuff like capacitors and resistors.  See the AUDIO notes file
for in-depth discussion of this.  Note: the "audible" difference is not
something that jumps out at you.  You have to be listening on good speakers and
amp to hear it. 
1412.4No hard and fast rules, but...JAWS::COTERead it and weep...Wed May 25 1988 18:5820
    It's difficult to give hard and fast rules but I think the following
    would be good baselines....
    
               1. 12 bits is fine. Yeah 16 is better, but expensive
                  and likely to be overkill...
    
                  8 bit linear is a bit lo-fi, 8 bit companded can
                  be exceptable...
    
               2. A sampling rate in the area of 30Khz is necessary
                  to capture any highs.
    
    .3 brings up some good points. Sampling can be alot of work and
    often effects the final outcome more than the hardware. Somewhere
    in this file I've typed volumes in a note by Dan Eaton(?) on the
    gymnastics of sampling with a Mirage. Maybe someone knows what note??
    
    Edd
    
    
1412.593920981::EATONDWhere is he when the music stops?Wed May 25 1988 19:342
< Note 1412.4 by JAWS::COTE "Read it and weep..." >

1412.6Kurzweil question...FGVAXZ::LAINGJim*261-2194*DEC MemorabiliaCollectorWed May 25 1988 19:379
    A related question ... what is this "sound modelling" or whatever
    that Kurzweil uses?  They have a trademark on the name of this thingie,
    the exact name of which escapes me at the moment.  Seems Kurzweil's
    early literature mentioned artificial intelligence in conjunction
    with this sound modelling/sculpturing or whatever.  How do they
    manage to get what *seem* to be clear high-end out of 25KHz sampling
    rate ... is this how?
    
    	-Jim
1412.7Geez, doesn't somebody here work for Kurzweil?SRFSUP::MORRISAshley: Bold as LoveWed May 25 1988 22:566
    I *believe* that sound modeling is the kind of thing like re-synthesis.
    
    That is, you take the wave made by a sample, and attempt to reproduce
    it by using oscillators and filters.
    
    I think
1412.8gimme 16bit @ 50Khz, butJON::ROSSshiver me timbres....Wed Jun 01 1988 12:5613
    
    The higher the sample rate, the more memory needed to store a sample.
    
    OR, holding memory constant, the shorter the longest sample can
    be.
    
    Yet another trade-off
    
    AND,The more memory, the longer it takes to load from a floppy. This
    is starting to become an issue too....

    ron
    
1412.9Other Unspecified Factors?DRUMS::FEHSKENSWed Jun 01 1988 17:5524
    I've been thinking about the question of why some samplers sound better
    than others that "ought to" sound better based on specs (sampling
    rate and sample bit width), and after a little wandering through the
    literature on digital audio, it seems to me that there are at least
    three factors that never show up in specs but can have a dramatic
    effect on sound quality:
    
    	1) sampling rate jitter,
    
    	2) antialiasing (input) filter design, and
    
    	3) output (smoothing) filter design.      
    
    Sampling rate jitter is just what it sounds like; for large amplitude
    or high frequency signals, just a little jitter can make for
    dramatic sampling errors and resultant modulation noise.  Bad (or
    cheap) filter design can result in frequency dependent phase shiftand
    ringing.
    
    Maybe these are some of the factors that distinguish great sounding
    samplers from merely good sounding samplers.
    
    len.
    
1412.10Integrator sample and holdIOENG::JWILLIAMSZeitgeist ZoologyThu Jun 02 1988 17:216
    Alot depends on the quality of the sample and hold. The best ones
    integrate over the sampling rate, although these add an extra stage.
    They give the average value over the sampling time, therefore providing
    their own roll off matrix filter. They also reduce the jitter effect.
    
    							John.
1412.11DNTVAX::MESSENGERIntrusion Countermeasures ElectronicsFri Aug 12 1988 00:2917
    Word size (number of bits in sample) = dynamic range, which is the
    difference in sound pressure between the softest sound you can generate
    and the largest.
    
    Sampling rate = frequency response, which is the range (from deepest
    tone to highest tone) that can be reproduced with "reasonable
    fidelity".
    
    This is, of course, for "pure" samplers. I've often wondered what
    one would be able to do by connecting a (cheap) low-sampling rate
    sampler to an envelope generator/VCA. You analyze the incoming sound
    and determine what kind of envelope it fits, and you should be able
    to get full dynamic range back out by pumping the limited-bandwidth
    signal out of the D/A converter into the VCA... oh, well, never
    mind. I'm rambling.
    				- HBM
1412.12Misleading...JAWS::COTEI'm not making this up...Fri Aug 12 1988 12:3021
    >Word size (number of bits in sample) = dynamic range, which is the
    >difference in sound pressure between the softest sound you can generate
    >and the largest.
     
     While dynamic range is inherently related to # of bits, the above
     explanation is misleading. My Mirage is only 8 bits and doesn't
     have any less dynamic range than an S-50. The VCA is likely to
     have a much bigger effect on dynamic range than word size. 
    
    >Sampling rate = frequency response, which is the range (from deepest
    >tone to highest tone) that can be reproduced with "reasonable
    >fidelity".
    			
    Again, not false, but misleading. A higher sampling rate gives you
    a higher Nyquist limit, which in turn lets you sample higher
    frequencies, but the input and output filters are likely to have
    a much more dramatic effect on the frequency response than the 
    sampling rate given a proper sampling method.
    
    Edd
1412.13Turnips and Antifreeze!! With Donny Osmond!TOOK::DDS_SECESQ-1 or D-20? Aaauugh!Fri Aug 12 1988 12:574
1412.14Bits -> Signal/NoiseDRUMS::FEHSKENSFri Aug 12 1988 14:1610
    Number of bits *is* directly related to resolution (see Mike, we
    *can* agree if we try!), which manifests itself as noise.  It affects
    the signal to noise ratio, with a rule of thumb that says you get
    about 6db of S/N for each bit of linear representation.  Those bits
    can be mapped to *ANY* dynamic range you want - but if there's only
    a few bits, the level changes are going to be gross between adjacent
    values.
    
    len.
     
1412.15I agree Len! But another question:TOOK::DDS_SECFri Aug 12 1988 15:1515
	Len:	

	Yea, we sure can (!), now let's talk about French Neo-Impressionism...

On to my question.  I wrote in the CD conference for an explanation of the 
samples.  Well, this guy (I have since deleted it; I lost interest) told 
me that the range goes up to 22khz and anything above causes some sort of 
problem like when spokes on Movie Westerns move backwards--it involved the
sample rate and the frequency.  He then went on to say that some players
`over-sample' to cut down the uncertainty of the digital voltage that was
on the disc.  Well, I don't get that, 'cause that would mean CD's would have
to be *recorded* as oversampled to increase the frequency response.  What am
I missing, and can anyone explain that here?  Thanks,

--Mike-who-is-thinking-of-a-SQ-80-right-now
1412.16French NeoImpressionist Filters?DRUMS::FEHSKENSFri Aug 12 1988 15:3328
    Oversampling is a clever trick that simplifies filter design.
    
    I'll try to explain without getting too deeply into sampling theory.
    
    Sampling produces artifacts that are a function of the sampling
    rate.  Basically what happens is the sampled signal gets replicated
    at multiples of the sampling rate.  These artifacts must be removed
    from the output signal.  Doing so requires a filter, and the brute
    force solution is what's called a "brick wall" filter, i.e., it's
    got a very steep cutoff slope.  Such filters are hard to design
    and implement, and typically involve big phase shifts.  Oversampling
    makes it possible to use a gentler filter cutoff (easier to design
    and build, less phase shift), because the artifacts are "further
    away" from the "real" output signal.
    
    Now, trust me on this, this is independent of the recording sampling
    rate.  I can't explain why (mainly because I don't remember, but
    also because it requires more sampling theory).
    
    Remember, sampling is happening "twice" - once during the recording
    process, and once during the playback process.  You don't have to
    playback samples at the same sampling rate they were recorded at.
    
    Anyway, oversampling works.  It doesn't "improve" anything, it just
    keeps things from getting worse than they need to.
    
    len.
    
1412.17a little signal processing theory ...MIZZOU::SHERMANsocialism doesn't work ...Fri Aug 12 1988 15:3420
    We're getting into some basic signal processing theory here.
    Basically, there is this Nyquist theory that says that the highest
    frequency you can reproduce is half of your sampling frequency.
    Now, for faithful signal reproduction, you should sample at something
    like 5 or 10 times the highest frequency present in your signal.
    This is because although you can reproduce that highest frequency,
    it is not a very good reproduction with respect to the higher
    frequencies.  For example, a 20 kHz sine wave might turn into a 
    20 kHz square wave, or that 19 kHz sine wave might turn into a square 
    wave out with an *average* frequency of 19 kHz.  Then, you are 
    bound to add some trash to the reproduction.  However, the saving
    grace with audio is that humans top out at about 20 kHz as far as the 
    highest frequency they can hear.  So, by sampling at about 40 kHz,
    you'll basically cover that highest frequency.  But what about the 
    slightly lower frequencies that get distorted because they are near
    20 kHz?  Well, bump up the sampling frequency to take care of that.  
    Oversampling is (I think) a fancy word for sampling at something above 
    the theoretical Nyquist frequency for humans. 
    
    Steve
1412.18small digressionMARVIN::MACHINFri Aug 12 1988 15:4110
    just a non-techy point about sampling rate and its use in sampling
    synths. You can often *improve* your work when sampling by reducing
    the sample rate. I don't mean improve the fidelity of the reproduced
    sound, just make it a more useable noise for your collection. So
    a 'poorly' sampled cello may make a nicer washy sound than a hugely
    memory-intensive hi-fi production job.
    
    O.K. -- back to the maths
    
    Richard.
1412.19Oversampling (the truth)MIDEVL::YERAZUNISVAXstation Repo ManFri Aug 12 1988 17:4328
    Oversampling works like this:
    
    	The samples coming from the CD come out at 44.1 KHz.  
    
    	By taking the average of every pair of REAL samples, and 
    	inserting this average as a "fake" sample between the pairs
    	of real samples, a smoother curve can be generated.  There's
    	no added information, just a smoother curve (that's easier to
    	filter.
    
    One can do more advanced things like 3-point curve fitting, 4-point
    linear-predictive, 4-point Bezier, etc. to generate the extra FAKE data
    points between the REAL sample points, but _no_ such algorithm can put
    back what isn't inherent in the original signal 
    
    Note to the mathematically inclined: an N-point curve fit solution, as
    N approaches infinity, starts to look very much like the N-point
    discrete Fourier transform which gives (you guessed it) the digital
    version of a "brick-wall" filter.     
    
    Really it's all just a matter of trading off where you're putting
    hardware effort- into the filters or into the digital signal processor
    that does the N-point curve fit.  It's really equivalent, but there
    are hills and valleys in the price-performance tradeoff.
    
    	-Bill
    
1412.20Can you stand another question?TOOK::DDS_SECFri Aug 12 1988 17:486
	Are there Super-CD's that fill in the average and then take the 
average of the average and the first, and the average of the average and 
the second?  Is this what you meant by N-whatever?

--Mike-thinking-sampling-and-synthesis-should-be-combined-into-one-unit-for
      under-$2000-hee-hee
1412.21Sounds like you want a DSS-1!LOLITA::DIORIOFri Aug 12 1988 17:596
    re -1   Mike, FYI:
    
    The Korg DSS-1 combines sampling and synthesis in one package, and
    it is well under $2000.
    
    Mike D
1412.22Yep, .20MIDEVL::YERAZUNISVAXstation Repo ManFri Aug 12 1988 18:029
    Yes, .20, that's one way to do quadruple oversampling.  Not the
    best way, but it will work. 
    
    I think that what you described is how some of the early
    quad-oversample CD players worked. (from two real points, insert
    3 additional fake points.)
    
    	-Bill
    
1412.23Don't forget the filterJGODCL::EUROFACTTue Dec 18 1990 13:076
    re .17: A sampled 20kHz sine with a sample rate of 40kHz will turn into
            a 20kHz square wave. But when you put it through a low-pass
            low-pass filter guess what you get??! Yep, you get the original
            sine wave back, if you filter the higher harmonics out.
    
    Frank.
1412.24More on oversamplingDECWIN::FISHERI like my species the way it is&quot; &quot;A narrow view...Tue Dec 18 1990 13:3716
re .17 and .23:  Yes, if you sample at twice the highest frequency (component)
you can reproduce exactly what you got in with suitable filtering.  Period.  If
you sample at 40Khz, you have the info to reproduce a 19Khz sine.

The problem is that we are dealing with reality.  If you want to reproduce
a 20Khz sine while sampling at 40Khz, you need a perfectly square filter which
will pass 20Khz unblemished, but will completely block 20.001Khz.  They either
don't exist, or they are expensive.

If you sample at a higher rate, however, you can have a sleazier filter.  For
example, if you KNOW that the highest audio going in is 20Khz, but you sample
at 60Khz, then as long as the filter does not attenuate much at below 20Khz
and it attenuates nearly completely at 30Khz and above, it can be pretty sloppy
between 20 and 30.

Burns
1412.25Harmonics!!JGODCL::EUROFACTWed Dec 19 1990 05:2613
    re .24 : You don't need a perfectly square filter!!
             Remember Fourier!
             If fo is the ground-harmonic (or what do you call it in
             English) of a square wave, that is a 40kHz sine, the first
             harmonic after that, f1 equals three times the ground harmonic in
             this case.
             So f1 = 3*40kHz = 120 kHz.
             And I think it isn't too hard to find a filter that leaves the
             40kHz sine wave intact, and cuts the 120kHz sine.....

             How about that!

    Frank.
1412.26AUSSIE::SULLIVANGreg SullivanThu Dec 20 1990 01:399
    RE: -.1
    
    It's no use just considering a single frequency like this. We are
    talking about the entire audio spectrum (i.e ~20Hz - 20KHz). You *do*
    need a very sharp filter to recontruct the entire spectrum (If you
    chose a different frequency, you would find that some harmonics were
    much closer to 20KHz).  -.2 is right.
    
    Greg.
1412.27Bigger than a nutshell...TLE::TLET8::ASHFORTHThu Dec 20 1990 13:5018
Kudos to you folks trying to compress a course on signal processing into 25
words or less, but I think the whole question needs a bit more context.

If the original noter is really curious, I'd recommend a *neat* book that came
out in the last year, "Elements of Computer Music," by F. Moore (I forget his
middle name!). The author is a real "founding father" of computer music, and
covers everything from signal processing through psychoacoustics. He also dwells
heavily on a subject which is obviously near and dear to his heart: the language
"cmusic," which he describes as a "musical compiler." I keep meaning to contact
him and see if I could get source code to port to the Amiga, but you know how it
is...

He seems most comfortable with things mathematical, and his treatment of time
and frequency spectra and their interrelationship is a good one. He includes
c source for both "classical" and "discrete" FFTs, bye the bye.

I'd recommend this book strongly to anyone who wonders what goes on in those
neat little boxes we like to play with. I found it pretty darned illuminating.
1412.28DNEAST::COMBAR_CURTRadical, dude!Fri Dec 21 1990 18:195
I'll second that.  "Elements of Computer Music" is an excellent book.  I've
only read about 10% of it so far - but it's well done.  I will also be doing
some porting of the code to the Amiga when I get some time...

Curt