Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Thomas Bruns
SineTools
Commits
f528a158
Commit
f528a158
authored
Feb 13, 2019
by
Thomas Bruns
Browse files
Indexfehler in remove_counter_carrier() behoben
parent
eec6362c
Changes
1
Hide whitespace changes
Inline
Side-by-side
SineTools.py
View file @
f528a158
...
...
@@ -47,11 +47,11 @@ def sinewave(f,a,phi, ti, offset=0, noise=0, absnoise=0, drift=0, ampdrift=0):
return
s
def
fm_counter_sine
(
fm
,
f
,
x
,
phi
,
ti
,
offset
=
0
,
noise
=
0
,
absnoise
=
0
,
drift
=
0
,
ampdrift
=
0
,
lamb
=
633.0e-9
):
def
fm_counter_sine
(
fm
,
f
,
x
,
phi
,
ti
,
offset
=
0
,
noise
=
0
,
absnoise
=
0
,
drift
=
0
,
ampdrift
=
0
,
lamb
=
633.0e-9
):
"""
#
calculate counter value of heterodyne signal at
\n
carrier freq. fm
x = displacement amplitude
calculate counter value of heterodyne signal at
\n
carrier freq. fm
\n
x = displacement amplitude
\n
initial phase phi
\n
sample times t_i
\n
bias or offset (default 0)
\n
...
...
@@ -70,7 +70,7 @@ def fm_counter_sine(fm, f,x,phi, ti, offset=0, noise=0, absnoise=0, drift=0, amp
d
=
drift
*
x
/
Tau
s
=
2
/
lamb
*
(
x
*
(
1
+
ampdrift
/
Tau
*
ti
)
*
sp
.
sin
(
2
*
sp
.
pi
*
f
*
ti
-
phi
)
+
n
+
d
*
ti
+
offset
)
s
=
1.0
/
lamb
*
(
x
*
(
1
+
ampdrift
/
Tau
*
ti
)
*
sp
.
sin
(
2
*
sp
.
pi
*
f
*
ti
-
phi
)
+
n
+
d
*
ti
+
offset
)
s
=
sp
.
floor
(
s
+
fm
*
ti
)
return
s
...
...
@@ -281,8 +281,8 @@ def remove_counter_carrier(y, diff=False):
d
=
d
-
sp
.
mean
(
d
)
y
=
sp
.
hstack
((
0
,
sp
.
cumsum
(
d
)))
else
:
slope
=
(
y
[
1
]
-
y
[
0
])
# slope of linear increment
y
=
y
-
slope
*
sp
.
linspace
(
0
,
1
,
len
(
y
),
endpoint
=
False
)
# removal of linear increment
slope
=
(
y
[
-
1
]
-
y
[
0
])
# slope of linear increment
y
=
y
-
slope
*
sp
.
linspace
(
0
.0
,
1.0
,
len
(
y
),
endpoint
=
False
)
# removal of linear increment
return
y
# calculate displacement and acceleration to the same analytical s(t)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment