Mail Archives: geda-user/2014/03/29/11:22:31
--Apple-Mail-2--959974817
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii
On Mar 29, 2014, at 10:36 AM, Rob Butts wrote:
> I have a short 8kHz 16 bit wav pcm file that I converted to an 8kHz 16 =
bit unsigned C numerical array. I'm using a 12 bit dac so I need to =
convert the 16 bit numerical array to a 12 bit numerical array.
> =20
> Before I get started is this just a matter of shifting out the four =
most significant bits of the binary 16 bit value?
"God is in the details."
First of all, sound pressure is relative to ambient static pressure, so =
it's signed. I therefore don't understand how your unsigned values are =
encoded. You may need to add 0x8000 to get the coding you need.
Then, there's the matter of your DAC interface. Is its coding signed or =
offset binary? What's the interface? If it's bytes, you have to worry =
about which byte comes first. In any case, when mapping a total of 16 =
bits to a 12 bit word, you may need to align the most significant bits =
or the least significant bits, depending on the DAC and its interface.
John Doty Noqsi Aerospace, Ltd.
http://www.noqsi.com/
jpd AT noqsi DOT com
--Apple-Mail-2--959974817
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=us-ascii
<html><head></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
"><br><div><div>On Mar 29, 2014, at 10:36 AM, Rob Butts wrote:</div><br =
class=3D"Apple-interchange-newline"><blockquote type=3D"cite"><div =
dir=3D"ltr"><div>I have a short 8kHz 16 bit wav pcm file that I =
converted to an 8kHz 16 bit unsigned C numerical array. I'm using =
a 12 bit dac so I need to convert the 16 bit numerical array to a 12 bit =
numerical array.</div>
<div> </div><div>Before I get started is this just a matter of =
shifting out the four most significant bits of the binary 16 bit =
value?</div></div>
</blockquote><br></div><div>"God is in the =
details."</div><div><br></div><div>First of all, sound pressure is =
relative to ambient static pressure, so it's signed. I therefore don't =
understand how your unsigned values are encoded. You may need to add =
0x8000 to get the coding you need.</div><div><br></div><div>Then, =
there's the matter of your DAC interface. Is its coding signed or offset =
binary? What's the interface? If it's bytes, you have to worry about =
which byte comes first. In any case, when mapping a total of 16 bits to =
a 12 bit word, you may need to align the most significant bits or the =
least significant bits, depending on the DAC and its =
interface.</div><br><div>
<span class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><span =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><p style=3D"margin: =
0.0px 0.0px 0.0px 0.0px"><font face=3D"Helvetica" size=3D"3" =
style=3D"font: 12.0px Helvetica">John Doty<span =
class=3D"Apple-converted-space"> <span =
class=3D"Apple-converted-space"> </span><span =
class=3D"Apple-converted-tab"> <span =
class=3D"Apple-converted-space"> </span></span></span>Noqsi =
Aerospace, Ltd.</font></p><p style=3D"margin: 0.0px 0.0px 0.0px =
0.0px"><a href=3D"http://www.noqsi.com/">http://www.noqsi.com/</a></p><p =
style=3D"margin: 0.0px 0.0px 0.0px 0.0px"><font face=3D"Helvetica" =
size=3D"3" style=3D"font: 12.0px Helvetica"><a =
href=3D"mailto:jpd AT noqsi DOT com">jpd AT noqsi DOT com</a></font></p><br =
class=3D"Apple-interchange-newline"></span></span>
</div>
<br></body></html>=
--Apple-Mail-2--959974817--
- Raw text -