#discrete fourier transform

32 messages · Page 1 of 1 (latest)

mental sparrow
jade pilot
#

you use exp instead of std::exp

mental sparrow
#

is that an issue? it still produces correct resultss

jade pilot
#

it isn't guaranteed to exist

#

it's from C's <math.h>which <cmath> includes internally

mental sparrow
#

for

f1 = 3
A2 = 3
f2 = 3```

it produces
```k=2 | f: 2 hz | A: 3 | phi: -1.5708 rad | eqn: A * cos(2*pi*2+-1.5708)
k=3 | f: 3 hz | A: 2 | phi: -1.5708 rad | eqn: A * cos(2*pi*3+-1.5708)```

which is correct
#

oh gotcha

jade pilot
#

code looks really really clean though

mental sparrow
#

thank you

#

i feel like it is not optimal though for some reason

jade pilot
#

yes very nice

#

oh?

mental sparrow
#

all i did to optimize it was precomputing the constants

#

and compiling using -ffast-math

#

but not much more

jade pilot
#

hmm

mental sparrow
#

of proficiency in c++

#

is this considered beginner

jade pilot
pine shoal
pine shoal
#

like concepts, meta programming with templates etc

jade pilot
pine shoal
#

so he could check if he using an floating type only or not

#

etc

mental sparrow
#

oh

pine shoal
#

like std::floating_point etc

#

think after you create this library , you tell someone to use it...so instead passing a floating type or double parameters , he passed a int.

#

so making your own concepts too work