[music-dsp] fast sin(x) function

Didier Dambrin didid at skynet.be
Tue Jun 10 18:29:42 EDT 2008


really? how does it work? (& don't you need to pre-check if it's 
denormalized or negative?)



----- Original Message ----- 
From: "Bob Grove" <music-dsp at musemagic.com>
To: "'A discussion list for music-related DSP'" 
<music-dsp at music.columbia.edu>
Sent: Wednesday, June 11, 2008 12:27 AM
Subject: RE: [music-dsp] fast sin(x) function


> You can also do bitwise masking in float, no reason to convert int-float 
> and
> back, which is computationally expensive, exp in x86 last time I checked.
>
> -----Original Message-----
> From: robert bristow-johnson [mailto:rbj at audioimagination.com]
> Sent: Tuesday, June 10, 2008 3:04 PM
> To: A discussion list for music-related DSP
> Subject: Re: [music-dsp] fast sin(x) function
>
>
>> ----- Original Message -----
>> From: "Didier Dambrin" <didid at skynet.be>
>> To: "A discussion list for music-related DSP"
> <music-dsp at music.columbia.edu>
>> Subject: Re: [music-dsp] fast sin(x) function
>> Date: Tue, 10 Jun 2008 23:42:19 +0200
>>
>>
>> The biggest problem with those approximations is that you have to
> wrap/limit
>> your phase yourself,
>
> as you would for a lookup table also.
>
>> and this can cost CPU depending on how it's done (can
>> you really wrap a float phase at low CPU cost?).  While it's really cheap
> to
>> wrap an integer power of 2 index.
>
> i wouldn't necessarily do it in floating-point.  but either way, you can
> wrap the phase by masking off high-order bits (so that 2*pi is scaled to 
> be
> some power of 2), convert to float if necessary, and run your fixed or 
> float
> result though the finite power series.  but, again, for generating a 
> signal,
> i wouldn't do it this way anyway: i would just use a lookup table.
>
> but sometimes sin/cos is used for calculation of filter coefs (and then
> exceeding the domain limits is not going to happen).  sometimes it is to
> evaluate a filter frequency response (and it need not exceed the domain
> limits).  in these cases, you want really good accuracy for down in the
> bottom 3 or 4 octaves and LUT won't be good enough.
>
> but if you want to use it to generate a sin wave, i wouldn't bother with
> this series stuff.  i would use an LUT that is large enough so that linear
> interpolation between table entries would be good enough.  unless memory 
> is
> not cheap, i wouldn't bother with higher order interpolation.
>
>
> --
>
> r b-j                  rbj at audioimagination.com
>
> "Imagination is more important than knowledge."
>
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, 
> dsp
> links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp
>
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, 
> dsp links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp


--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG.
Version: 8.0.100 / Virus Database: 270.2.0/1494 - Release Date: 10/06/2008 
07:22



More information about the music-dsp mailing list