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:
:return:
"""
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(self.name+'_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(self.name+'_intpl', interpl_time, np.vectorize(complex)(realValues, imagValues))
return ts_return
@staticmethod
def multi_frequency_shift(timeseries_list, freqs_list):
......@@ -117,7 +116,19 @@ class TimeSeries:
ts_shift = ts.frequency_shift(freq)
result_list[ts.name] = ts_shift
return result_list
@staticmethod
def interpolate_cmpl_list(timeseries_list, timestep):
""" Interpolates list of complex timeseries with new timestep
:param timestep:
:return:
"""
result_list = {}
for name, ts in timeseries_list.items():
ts_intp = ts.interpolate_cmpl(timestep)
result_list[ts_intp.name] = ts_intp
return result_list
@staticmethod
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