SAMPLE RATE CONVERTER
=====================

This device converts between arbitrary sample rates. Its in- and
output is stereo or mono 16 bit signed linear data. For different word
sizes or unsigned data, you may want to use a squant device in front
of this one.

The conversion is done by assuming that the incoming data is
band-limited to half the lower of the two sampling rates, meaning that
its frequency spectrum is zero above this limit. In this case the
'original' signal can be obtained from the sampled data (known as
Shannon's theorem), which is then evaluated at the new sample points.

A problem occurs if this assumption does not hold. For example, when
downsampling from 44100Hz to 8000Hz there will be audible aliasing
because very probably the 44100Hz signal is not limited to frequencies
< 4000Hz. In this case, a lowpass filter should be applied to take out
the higher frequencies. This device only does the sample rate
conversion, no filtering. For filtering, we currebntly have the
fixed_lowp device.

To understand the conversion algorithm, and to figure out my
one-character variable names used therein, please look at the file
srate.ps in this directory.




Explanation of mas_set() keys:

Driven by the needs for teleconferencing we switched one by one to
flexible sized output packets, dynamic adjustment of rates (meaning
while the converter is converting) and higher precision rates (2
digits after the decimal point [for rates in Hertz units]). So now you
can manipulate the in and output rates in a number of ways:

'inrate' and 'outrate':               you give it the new input or 
                                      output sample rate in Hz, and 
                                      it'll just work.

'mc_in_clkid' and 'mc_out_clkid'      you tell it the ID of the clock
                                      to adjust itself to. It will do 
                                      this using the mas_mc_rate()    
                                      call

'in_clock_rate' and 'out_clock_rate'  Probably obsolete. You give it
                                      the number of Hz multiplied by
                                      100. It will first factor out 
                                      any common integer factors in 
                                      inrate and outrate, then set  
                                      them accordingly.
