Csound Csound-dev Csound-tekno Search About

[Csnd] DSP quirk that causes increased CPU usage?

Date2013-11-19 11:50
FromJeff Taylor
Subject[Csnd] DSP quirk that causes increased CPU usage?
I recall reading somewhere, and I think it was on this mailing list, about an interesting quirk of how numbers are computed on computers.  Signals satisfying certain conditions cause an increase in CPU usage, and these conditions are ones that could easily occur in everyday usage.  Thus you would want to keep the effect in mind as you program.  I was thinking it was something like very low amplitude signals or slight DC offsets.

Does anyone have any idea what I am talking about?  I've been looking through my notes but I can't seem to find this particular info and I would like to refresh my memory on the topic.  I will accept the answer that I dreamed it all up!

--
Electronically,
Jeff Taylor

Date2013-11-19 13:56
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re:
AttachmentsNone  

Date2013-11-19 14:19
FromMichael Gogins
SubjectRe: [Csnd] DSP quirk that causes increased CPU usage?
This is called the "denormal problem." It is caused when floating point numbers have an exponent that is too small for the number of bits allocated to the exponent, so put leading zeros into the significand. You can obviate the problem by adding a bit of low amplitude white noise to the signal. This may or may not actually be a problem for you. You can look up your CPU to see if denormal numers are handled in hardware, thus no problem, or in software, thus there is a problem. Or you can write a test to experimentally determine if performance suffers with denomals.

Hope this helps,
Mike


-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Tue, Nov 19, 2013 at 6:50 AM, Jeff Taylor <taylor.jeff.d@gmail.com> wrote:
I recall reading somewhere, and I think it was on this mailing list, about an interesting quirk of how numbers are computed on computers.  Signals satisfying certain conditions cause an increase in CPU usage, and these conditions are ones that could easily occur in everyday usage.  Thus you would want to keep the effect in mind as you program.  I was thinking it was something like very low amplitude signals or slight DC offsets.

Does anyone have any idea what I am talking about?  I've been looking through my notes but I can't seem to find this particular info and I would like to refresh my memory on the topic.  I will accept the answer that I dreamed it all up!

--
Electronically,
Jeff Taylor


Date2013-11-19 15:14
FromOeyvind Brandtsegg
SubjectRe: [Csnd] DSP quirk that causes increased CPU usage?
And the denorm opcode is good for adding that low level noise. Very handy.
Oeyvind

2013/11/19 Michael Gogins :
> This is called the "denormal problem." It is caused when floating point
> numbers have an exponent that is too small for the number of bits allocated
> to the exponent, so put leading zeros into the significand. You can obviate
> the problem by adding a bit of low amplitude white noise to the signal. This
> may or may not actually be a problem for you. You can look up your CPU to
> see if denormal numers are handled in hardware, thus no problem, or in
> software, thus there is a problem. Or you can write a test to experimentally
> determine if performance suffers with denomals.
>
> Hope this helps,
> Mike
>
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Tue, Nov 19, 2013 at 6:50 AM, Jeff Taylor 
> wrote:
>>
>> I recall reading somewhere, and I think it was on this mailing list, about
>> an interesting quirk of how numbers are computed on computers.  Signals
>> satisfying certain conditions cause an increase in CPU usage, and these
>> conditions are ones that could easily occur in everyday usage.  Thus you
>> would want to keep the effect in mind as you program.  I was thinking it was
>> something like very low amplitude signals or slight DC offsets.
>>
>> Does anyone have any idea what I am talking about?  I've been looking
>> through my notes but I can't seem to find this particular info and I would
>> like to refresh my memory on the topic.  I will accept the answer that I
>> dreamed it all up!
>>
>> --
>> Electronically,
>> Jeff Taylor
>
>



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp

Date2013-11-19 15:22
FromJeff Taylor
SubjectRe: [Csnd] DSP quirk that causes increased CPU usage?
Thanks everyone, that is exactly the info I was looking for!


--
Electronically,
Jeff Taylor


On Tue, Nov 19, 2013 at 9:14 AM, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
And the denorm opcode is good for adding that low level noise. Very handy.
Oeyvind

2013/11/19 Michael Gogins <michael.gogins@gmail.com>:
> This is called the "denormal problem." It is caused when floating point
> numbers have an exponent that is too small for the number of bits allocated
> to the exponent, so put leading zeros into the significand. You can obviate
> the problem by adding a bit of low amplitude white noise to the signal. This
> may or may not actually be a problem for you. You can look up your CPU to
> see if denormal numers are handled in hardware, thus no problem, or in
> software, thus there is a problem. Or you can write a test to experimentally
> determine if performance suffers with denomals.
>
> Hope this helps,
> Mike
>
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Tue, Nov 19, 2013 at 6:50 AM, Jeff Taylor <taylor.jeff.d@gmail.com>
> wrote:
>>
>> I recall reading somewhere, and I think it was on this mailing list, about
>> an interesting quirk of how numbers are computed on computers.  Signals
>> satisfying certain conditions cause an increase in CPU usage, and these
>> conditions are ones that could easily occur in everyday usage.  Thus you
>> would want to keep the effect in mind as you program.  I was thinking it was
>> something like very low amplitude signals or slight DC offsets.
>>
>> Does anyone have any idea what I am talking about?  I've been looking
>> through my notes but I can't seem to find this particular info and I would
>> like to refresh my memory on the topic.  I will accept the answer that I
>> dreamed it all up!
>>
>> --
>> Electronically,
>> Jeff Taylor
>
>



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp


Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2013-11-19 19:47
FromJan Baumgart
SubjectRe: [Csnd] DSP quirk that causes increased CPU usage?
They are called denormal numbers.

http://en.wikipedia.org/wiki/Denormal_number

cheers,
Jan

On 11/19/13 12:50 PM, Jeff Taylor wrote:
> I recall reading somewhere, and I think it was on this mailing list,
> about an interesting quirk of how numbers are computed on computers.
> Signals satisfying certain conditions cause an increase in CPU usage,
> and these conditions are ones that could easily occur in everyday
> usage.  Thus you would want to keep the effect in mind as you program.
> I was thinking it was something like very low amplitude signals or
> slight DC offsets.
>
> Does anyone have any idea what I am talking about?  I've been looking
> through my notes but I can't seem to find this particular info and I
> would like to refresh my memory on the topic.  I will accept the answer
> that I dreamed it all up!
>
> --
> Electronically,
> Jeff Taylor