Searching \ for '[PIC] tan function on a 8 bit PIC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/microchip/math/index.htm?key=tan
Search entire site for: 'tan function on a 8 bit PIC'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] tan function on a 8 bit PIC'
2008\08\27@115758 by alan smith

picon face
I did some searching, and saw some routines on arctan, but wondering is doing a tan calculation out the the reach of a 18F processor.  What I am eventually implementing is audio eq calculations.


     

2008\08\27@122551 by Walter Banks

picon face
Alan,

About a year ago I wrote a fixed point transcendental library.
It is not a problem to calculate tan on a micro including the
18F but I would avoid using it if it is possible to use a
separate algorithm  in applications.

w..


alan smith wrote:

> I did some searching, and saw some routines on arctan, but wondering is doing a tan calculation out the the reach of a 18F processor.  What I am eventually implementing is audio eq calculations.

2008\08\27@123024 by John Temples

flavicon
face
On Wed, 27 Aug 2008, alan smith wrote:

> I did some searching, and saw some routines on arctan, but wondering is doing a tan calculation out the the reach of a 18F processor.  What I am eventually implementing is audio eq calculations.

Hi-Tech PICC-18 using 24-bit floats:

#include <math.h>

void main(void)
{
    float x, y;

    x = tan(y);
}

Memory Summary:
    Program space        used   947h (  2375) of 20000h bytes   (  1.8%)
    Data space           used    43h (    67) of   F00h bytes   (  1.7%)

--
John W. Temples, III

2008\08\27@125151 by Dario Greggio

face picon face
alan smith wrote:

> I did some searching, and saw some routines on arctan, but wondering is doing a tan calculation out the the reach of a 18F processor.  What I am eventually implementing is audio eq calculations.

Could you look into C18 SRC folder?

--
Ciao, Dario

2008\08\27@131114 by sergio masci

flavicon
face


On Wed, 27 Aug 2008, alan smith wrote:

> I did some searching, and saw some routines on arctan, but wondering is
> doing a tan calculation out the the reach of a 18F processor.  What I am
> eventually implementing is audio eq calculations.

Yes you can calculate tan on an 18F. I guess the real question is how fast
do you need to calculate it.

I've written a floating point tan library function for the XCSB compiler
and that generates code for the dumber 16F.

Regards
Sergio Masci

2008\08\27@131533 by A K

flavicon
face
You can approximate via interpolation and a discrete TAN lookup table
rather quickly.


sergio masci wrote:
{Quote hidden}

2008\08\27@131917 by peter green

flavicon
face
alan smith wrote:
> I did some searching, and saw some routines on arctan, but wondering is doing a tan calculation out the the reach of a 18F processor.
It will certainly be able to do it. Whether it will be able to do it at
the speed and accuracy that your application requires is another matter.

2008\08\27@141152 by Scott Dattalo

face
flavicon
face
> I did some searching, and saw some routines on arctan, but wondering is
> doing a tan calculation out the the reach of a 18F processor.  What I am
> eventually implementing is audio eq calculations.

Hi Alan,

Why do you specifically need to calculate tan()?

You might get away with the approximation:

tan(x) ~ x for small x

But if you need to calculate all the way out to tan(pi/2), you're in for a
surprise!

Scott

2008\08\27@153518 by alan smith

picon face

Yep...come to the conclusion that the lil ol 18F won't cut it.  True I can use a look up table, but I found an easier method....find a part that has things built in, in as much as the function I need for the audio eq.  Wolfson has a part, and yes it limits the choice of centre frequencies I can choose, for this particular app it will fit just fine.

Thanks for the replies

--- On Wed, 8/27/08, Scott Dattalo <spam_OUTscottTakeThisOuTspamdattalo.com> wrote:

{Quote hidden}

> --

More... (looser matching)
- Last day of these posts
- In 2008 , 2009 only
- Today
- New search...