Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
+
Functions
_
a
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
+
Variables
_
a
b
c
d
e
f
g
h
l
m
n
p
q
r
s
t
u
w
y
Typedefs
Enumerations
+
Classes
Class List
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
+
Enumerator
a
b
c
d
e
f
i
k
l
m
n
o
r
s
t
u
w
y
Related Functions
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
x
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerations
_
a
b
c
d
e
f
g
i
m
n
p
s
t
u
x
+
Enumerator
_
a
b
c
d
e
f
g
h
i
m
n
o
p
q
r
s
t
u
w
x
+
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
lib
inertial-sense-sdk
hw-libs
misc
sig_gen.cpp
Go to the documentation of this file.
1
#include <math.h>
2
3
#include "
misc/sig_gen.h
"
4
5
#define PI 3.14159265358979
6
#define TWOPI 6.28318530717959
7
8
//static float g_freqHz, g_amplitude, g_periodSec, g_time;
9
10
11
//void init_sig_gen( float loopPeriodSec, float freqHz, float amplitude )
12
//{
13
//g_freqHz = freqHz;
14
//g_amplitude = amplitude;
15
//g_periodSec = loopPeriodSec;
16
//g_time = 0;
17
//}
18
19
20
float
step_sinwave
(
float
*sig_gen,
float
freqHz,
float
amplitude,
float
periodSec )
21
{
22
*sig_gen += freqHz * periodSec *
TWOPI
;
23
24
// Unwrap Angle
25
if
( *sig_gen >
PI
)
26
*sig_gen -=
TWOPI
;
27
28
return
amplitude * sinf( *sig_gen );
29
}
TWOPI
#define TWOPI
Definition:
sig_gen.cpp:6
sig_gen.h
PI
#define PI
Definition:
sig_gen.cpp:5
step_sinwave
float step_sinwave(float *sig_gen, float freqHz, float amplitude, float periodSec)
Initialize signal generator.
Definition:
sig_gen.cpp:20
inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:05