debug and add unittests 1
This commit is contained in:
@@ -40,12 +40,12 @@ class SinusAmplitudeModulationStimulus(AbstractStimulus):
|
||||
start_time = self.start_time
|
||||
duration = self.duration
|
||||
|
||||
values = convert_to_array(carrier, amp, mod_freq, contrast, start_time, duration, time_start, total_time, step_size/1000)
|
||||
values = convert_to_array(carrier, amp, mod_freq, contrast, start_time, duration, time_start, total_time, step_size)
|
||||
|
||||
return values
|
||||
|
||||
|
||||
#@jit(nopython=True) # makes it slower?
|
||||
# @jit(nopython=True) # makes it slower?
|
||||
def convert_to_array(carrier_freq, amplitude, modulation_freq, contrast, start_time, duration, time_start, total_time, step_size_s):
|
||||
# if the whole stimulus time has the amplitude modulation just built it at once;
|
||||
if time_start >= start_time and start_time+duration < time_start+total_time:
|
||||
@@ -55,7 +55,7 @@ def convert_to_array(carrier_freq, amplitude, modulation_freq, contrast, start_t
|
||||
return values
|
||||
|
||||
# if it is split into parts with and without amplitude modulation built it in parts:
|
||||
values = np.empty(1)
|
||||
values = np.array([], dtype='float32')
|
||||
|
||||
if time_start < start_time:
|
||||
carrier_before_am = np.sin(2 * np.pi * carrier_freq * np.arange(time_start, start_time, step_size_s))
|
||||
|
||||
Reference in New Issue
Block a user