Commit 810e0f9b authored by Markus Mirz's avatar Markus Mirz

fix interpolation functions

parent c9fe0586
......@@ -70,16 +70,15 @@ class TimeSeries:
return fft_freqs[:freqs_num], np.abs(fft_values[:freqs_num])/freqs_num
def interpolate_cmpl(self, timestep):
""" Not tested yet!
Interpolates complex timeseries with timestep
""" Interpolates complex timeseries with new timestep
:param timestep:
interpl_time = np.arange(self.time[0], self.time[-1], timestep)
realValues = interp1d(interpl_time, self.values.real)
imagValues = interp1d(interpl_time, self.values.imag)
ts_return = TimeSeries('_intpl', time, np.vectorize(complex)(realValues, imagValues))
return timeseries
realValues = np.interp(interpl_time, self.time, self.values.real)
imagValues = np.interp(interpl_time, self.time, self.values.imag)
ts_return = TimeSeries('_intpl', interpl_time, np.vectorize(complex)(realValues, imagValues))
return ts_return
def multi_frequency_shift(timeseries_list, freqs_list):
......@@ -118,6 +117,18 @@ class TimeSeries:
result_list[] = ts_shift
return result_list
def interpolate_cmpl_list(timeseries_list, timestep):
""" Interpolates list of complex timeseries with new timestep
:param timestep:
result_list = {}
for name, ts in timeseries_list.items():
ts_intp = ts.interpolate_cmpl(timestep)
result_list[] = ts_intp
return result_list
def create_emt_from_dp(timeseries_list, freqs_list, new_name = 'emt_signal'):
""" Calculate shifted frequency results of all time series in list
Markdown is supported
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