<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:14pt"><div><span>Thanks for replying.</span></div><div><span>actually 2^15 in decimal is the same as 0x8000 in hex.</span></div><div><span>the idea is clear for me that i should scale down each unsigned sample by 0x8000 for becoming signed. I hope that will work correctly as input raw samples to Speex codec. do you think so ?</span></div><div><br><span></span></div><div><span>Regards,</span></div><div><span>Mash'al<br></span></div><div><br></div> <div style="font-family: times new roman, new york, times, serif; font-size: 14pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Steve Checkoway <s@pahtak.org><br> <b><span style="font-weight: bold;">To:</span></b> Mashal al-shboul
<shboul8989@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> Arthurc <arthurc99@yahoo.com>; "speex-dev@xiph.org" <speex-dev@xiph.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, March 14, 2012 9:01 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Speex-dev] converting unsigned short sample to signed short sample<br> </font> </div> <br>
<div id="yiv561643905"><div><div>I don't understand why you're subtracting 2^15 - 1. Assuming you really do have unsigned samples (which is very odd) that have 0x8000 as the mid point of the range, then you need to subtract 0x8000, as I believe I pointed out already.</div><div><br></div><div>By mid point, I mean if you have a pure tone (i.e., a sine wave) that has unsigned range 0 to 0xffff, then the mid point is 0x8000. The mid point should be translated to zero. </div><div><br></div><div>If your samples are represented some other way, you have to tell us.</div><div><br></div><div><br>-- <div><div>Stephen Checkoway</div><div><br></div><div><br></div></div></div><div><br>On Mar 13, 2012, at 23:28, Mashal al-shboul <<a rel="nofollow" ymailto="mailto:shboul8989@yahoo.com" target="_blank" href="mailto:shboul8989@yahoo.com">shboul8989@yahoo.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div><div
style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:14pt;"><div><span>Thanks a lot for replying,</span></div><div><span>The question now is , after subtracting 32767 from each unsigned sample, will the new signed samples represent the same original voice </span><span>? <br></span></div><div><span> For explanation, assume "Hi" is said in 8000 unsigned sample ,if i subtract 32767 from each sample and play the resulting 8000 sample as signed PCM samples,will they be "Hi" ?!</span></div><div><span><br></span></div><div><span>Forgive me about my questions , but it's important for me and i am new to the stuff<br></span></div><div><span>Best Regards,</span></div><div><span>Mash'al<br></span></div><div><br></div> <div style="font-family:times new roman, new york, times, serif;font-size:14pt;"> <div style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <div
dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Arthurc <<a rel="nofollow" ymailto="mailto:arthurc99@yahoo.com" target="_blank" href="mailto:arthurc99@yahoo.com">arthurc99@yahoo.com</a>><br> <b><span style="font-weight:bold;">To:</span></b> Mashal al-shboul <<a rel="nofollow" ymailto="mailto:shboul8989@yahoo.com" target="_blank" href="mailto:shboul8989@yahoo.com">shboul8989@yahoo.com</a>> <br> <b><span style="font-weight:bold;">Sent:</span></b> Wednesday, March 14, 2012 5:58 AM<br> <b><span style="font-weight:bold;">Subject:</span></b> Re: [Speex-dev] converting unsigned short sample to signed short sample<br> </font> </div> <br>
<div id="yiv561643905"><div><div>I assumed that you have unsigned input from your sound card / codec, etc.</div><div>Actually, it is unlikely in today's hardware platform for audio application.</div><div><br></div><div>If that is really the case, you can just do..</div><div><br></div><div>short output = ((long) input) - 32767</div><div><br></div><div>Well, maybe it is possible to do some bit manipulation to achieve the same thing.</div><div><br></div><div>Regards</div><div>Arthur </div><div><br>On 2012年3月14日, at 上午11:21, Mashal al-shboul <<a rel="nofollow" ymailto="mailto:shboul8989@yahoo.com" target="_blank" href="mailto:shboul8989@yahoo.com">shboul8989@yahoo.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:14pt;"><div><span class="yiv561643905tab"> Hi All,</span></div><div><span
class="yiv561643905tab">I would like to get your help in my problem,</span></div><div><br><span class="yiv561643905tab"></span></div><div><span class="yiv561643905tab">we know that Speex codec takes samples of type <span style="font-weight:bold;">short</span> (signed), range:-2^15 to2^15 -1 , my problem is that i have samples of type <span style="font-weight:bold;"><br></span></span></div><div><span class="yiv561643905tab"><span style="font-weight:bold;">unsigned short </span>,range: 0 to 2^16 -1. so, what should i do in order to apply speex on my unsigned samples ?.<br></span></div><div><span class="yiv561643905tab"> There is a proposed solution to subtract 2^15-1 from each unsigned short to get it signed short, my question: is this method safe in keeping the samples meaningful for
speex's processing algorithms?. <br></span></div><div><span class="yiv561643905tab">i hope i receive help from you. Thanks in advance</span></div><div><span class="yiv561643905tab"><br></span></div><div><span class="yiv561643905tab">Regards,</span></div><div><span class="yiv561643905tab">Mash'al<br></span></div></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Speex-dev mailing list</span><br><span><a rel="nofollow" ymailto="mailto:Speex-dev@xiph.org" target="_blank" href="mailto:Speex-dev@xiph.org">Speex-dev@xiph.org</a></span><br><span>http://lists.xiph.org/mailman/listinfo/speex-dev</span><br></div></blockquote></div></div><br><br> </div> </div> </div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Speex-dev mailing list</span><br><span><a rel="nofollow" ymailto="mailto:Speex-dev@xiph.org" target="_blank"
href="mailto:Speex-dev@xiph.org">Speex-dev@xiph.org</a></span><br><span><a rel="nofollow" target="_blank" href="http://lists.xiph.org/mailman/listinfo/speex-dev">http://lists.xiph.org/mailman/listinfo/speex-dev</a></span><br></div></blockquote></div></div><br><br> </div> </div> </div></body></html>