Sin Fkt.

Ist es möglich eine Sinus funktion zu verwenden?

Wenn ich die math.h verwenden will kommt immer das:

sdcc: Calling preprocessor...
sdcc: Generating code...
==========================================================================
Linking project
error: missing definition for symbol "_sinf", required by "_output\main.o"
ERROR!
Process terminated with status 1 (0 minutes, 3 seconds)
0 errors, 0 warnings

anscheinend wird das nicht in der LIB von TK unterstützt.

gibt es eine Lösung?

Hi Rio depending on the resolution you need

you could use a lookup table to get sine values

take a look at the analog toolbox project (I think you can find the table in map.c)

the only problem with is that you will have to scale the output to your needs

right now 0 is 128 in the table, negative values are between 127 and 0 and so on

if you need a custom lookup table (16bit, signed format) let me know

I’ll take a look into :wink:

i don’t know how tk did it on MBSID Application?

Does he used a lookup table too or a function for that?

Yes he used the same method

the only difference with between the sid and analog toolbox

is that the sid table uses a table containing only one half of the sine

and ‘mirrors’ this data to get the full wave to save memory..

you mean this file: sid_lfo_table.inc ?

no, it’s called sid_sin_table.inc