Commit f528a158 authored by Thomas Bruns's avatar Thomas Bruns
Browse files

Indexfehler in remove_counter_carrier() behoben

parent eec6362c
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment