diff --git a/Figures_Model.py b/Figures_Model.py index a5b81d2..f849679 100644 --- a/Figures_Model.py +++ b/Figures_Model.py @@ -97,11 +97,11 @@ def model_comparison(): def stimulus_development(): - time_start = -0.020 - time_duration = 0.080 - - stimulus = SinusoidalStepStimulus(745, 0.2, 0.1, 0.1) - step_size = 0.000005 + time_start = -0.040 + time_duration = 0.80 + # freq, contrast, start_time=0, duration=np.inf, amplitude=1 + stimulus = SinusoidalStepStimulus(745, 0.5, 0, 0.02) + step_size = 0.00005 stim_array = stimulus.as_array(time_start, time_duration, step_size) rectified = hF.rectify_stimulus_array(stim_array) @@ -119,14 +119,13 @@ def stimulus_development(): axes[2].plot(time, filtered) axes[2].set_title("rectified plus dendritic filter") - axes[0].set_ylim((-1.15, 1.15)) - axes[1].set_ylim((-1.15, 1.15)) - axes[2].set_ylim((-1.15, 1.15)) + for ax in axes: + ax.set_ylim((-1.55, 1.55)) for ax in axes: ax.set_ylabel("Amplitude [mV]") axes[2].set_xlabel("Time [s]") - axes[0].set_xlim((0, 0.05)) + axes[0].set_xlim((-0.02, 0.04)) # axes[2].set_ylim((0, 1.05)) plt.tight_layout() diff --git a/stimuli/SinusoidalStepStimulus.py b/stimuli/SinusoidalStepStimulus.py index 64b77cf..7a28e3d 100644 --- a/stimuli/SinusoidalStepStimulus.py +++ b/stimuli/SinusoidalStepStimulus.py @@ -45,7 +45,9 @@ class SinusoidalStepStimulus(AbstractStimulus): def convert_to_array(frequency, amplitude, contrast, start_time, duration, time_start, total_time, step_size_s): full_time = np.arange(time_start, time_start + total_time, step_size_s) full_carrier = np.sin(2 * np.pi * frequency * full_time) - if start_time > time_start+duration or start_time+duration < time_start: + if start_time > time_start+total_time or start_time+duration < time_start: + if contrast != 0: + print("SinusoidalStepStimulus: converted to array in a range outside of step!") return full_carrier * amplitude else: if start_time >= time_start: diff --git a/thesis/Masterthesis.log b/thesis/Masterthesis.log index a532555..651c4c2 100755 --- a/thesis/Masterthesis.log +++ b/thesis/Masterthesis.log @@ -1,4 +1,4 @@ -This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex 2018.11.12) 4 SEP 2020 10:57 +This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex 2018.11.12) 5 SEP 2020 11:22 entering extended mode restricted \write18 enabled. %&-line parsing enabled. @@ -595,9 +595,9 @@ ublic/amsfonts/cm/cmr8.pfb> -Output written on Masterthesis.pdf (13 pages, 327767 bytes). +Output written on Masterthesis.pdf (13 pages, 325756 bytes). PDF statistics: - 345 PDF objects out of 1000 (max. 8388607) + 344 PDF objects out of 1000 (max. 8388607) 222 compressed objects within 3 object streams 50 named destinations out of 1000 (max. 500000) 114 words of extra memory for PDF output out of 10000 (max. 10000000) diff --git a/thesis/Masterthesis.pdf b/thesis/Masterthesis.pdf index 1621ec8..ddf50f1 100644 Binary files a/thesis/Masterthesis.pdf and b/thesis/Masterthesis.pdf differ diff --git a/thesis/Masterthesis.synctex.gz b/thesis/Masterthesis.synctex.gz index d1b3c7c..1ecef7d 100644 Binary files a/thesis/Masterthesis.synctex.gz and b/thesis/Masterthesis.synctex.gz differ diff --git a/thesis/figures/stimulus_development.pdf b/thesis/figures/stimulus_development.pdf index ffef6ce..a29f5f4 100644 Binary files a/thesis/figures/stimulus_development.pdf and b/thesis/figures/stimulus_development.pdf differ