home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sound Sensations!
/
sound_sensations.iso
/
miditool
/
dac12x16
/
readme
< prev
next >
Wrap
Text File
|
1988-05-21
|
860b
|
28 lines
Jack,
5-20-88
I can't seem to find the actual funtion I wrote to convert 12 bit
data to 16 bit, so I'm just including some similar functions.
They are really simple. The main thing is to normalize the DAC
value to values from +1 to -1 and then multiply by the new scaling
factor.
newDACvalue = oldDACvalue/maxoldDACvalue * maxnewDACvalue;
e.g., to convert 12-bit values to 16-bit values:
#define DAC12 2047 /* 2^(12 - 1) - 1 (signed range) */
#define DAC16 32767 /* 2^(16 - 1) - 1 */
x = binary read of a signed int;
y = x / DAC12 * DAC16;
write y in a binary format;
The FTOxxx and STOx functions are just available shells that I've used
in the past for you to put your particular conversion in.
Let me know if you have need more help,
Don