From: Sandy Harris <pashley@storm.ca>
To: Kirk Reiser <kirk@braille.uwo.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Advice saught on math functions
Date: Fri, 12 Jul 2002 11:42:19 -0400 [thread overview]
Message-ID: <3D2EF8DB.4DB091FF@storm.ca> (raw)
In-Reply-To: E17T15g-0007mP-00@speech.braille.uwo.ca
Kirk Reiser wrote:
>
> ... What I am striving to do is build a software based speech
> synthesizer into a linux driver. ... over 512k. Obviously this is
> to large to want built-in to the kernel.
Can you do it in a module instead?
> The majority of the size is from libm.a.
Does dietlibc help?
> There are five functions I need from the library, log(),
> log10(), exp() cos() and sin().
Can you do something useful with integer versions of those functions?
Forth people have done astronomical calculations with only scaled
16-bit arithmetic. If it's accurate enough to aim telescopes, why
not for your job?
Given that phones work with fine 8-bit samples, I suspect speech can
be done just fine with 16-bit math.
base 2 log is easy; I've seen code for it on the web. Scaling that to
get natural log and log10 is straightforward.
exp() is trivial, provided you have the scaling right so it doesn't
overflow into insanity. How hard the scaling is depends on the
application.
I suspect there's a better way, but a brute force unoptimised shot
at 16-bit sin() and cos() just uses a 128 K table; 16 bits in, 16
out.
next prev parent reply other threads:[~2002-07-12 16:34 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-12 14:08 Advice saught on math functions Kirk Reiser
2002-07-12 14:39 ` Alan Cox
2002-07-12 14:52 ` Kirk Reiser
2002-07-12 15:32 ` Alan Cox
2002-07-12 16:04 ` Kirk Reiser
2002-07-12 16:31 ` Alan Cox
2002-07-12 16:21 ` Dave Jones
2002-07-15 9:46 ` Eric W. Biederman
2002-07-16 5:26 ` H. Peter Anvin
2002-07-15 10:03 ` Eric W. Biederman
2002-07-15 14:10 ` Kirk Reiser
2002-07-15 16:38 ` Eric W. Biederman
2002-07-12 15:46 ` Nicolas Pitre
2002-07-12 16:30 ` Kirk Reiser
2002-07-12 17:03 ` Nicolas Pitre
2002-07-12 16:22 ` J.A. Magallon
2002-07-12 16:49 ` William Park
2002-07-13 14:00 ` Pavel Machek
2002-07-13 17:10 ` Alan Cox
2002-07-12 14:46 ` Richard B. Johnson
2002-07-12 15:42 ` Sandy Harris [this message]
2002-07-12 16:46 ` Kirk Reiser
2002-07-14 0:20 ` Erik Andersen
2002-07-14 14:17 ` Sandy Harris
2002-07-14 16:49 ` Albert D. Cahalan
2002-07-14 17:01 ` Thunder from the hill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D2EF8DB.4DB091FF@storm.ca \
--to=pashley@storm.ca \
--cc=kirk@braille.uwo.ca \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox