diff --git a/chirp_ams.py b/chirp_ams.py index 8660dbe..cb9f6a1 100644 --- a/chirp_ams.py +++ b/chirp_ams.py @@ -21,7 +21,8 @@ def despine(axis, spines=None, hide_ticks=True): axis.yaxis.set_ticks([]) -def get_signals(eodfs, condition, contrast, c_size, c_duration, c_ampl_dip, chirp_times, duration, dt): +def get_signals(eodfs, condition, contrast, chirp_size, chirp_duration, chirp_amplitude_dip, + chirp_times, duration, dt): if not isinstance(condition, str) or ("self" not in condition and "other" not in condition): raise ValueError("Condition argument must be either 'self' or 'other'!") if not isinstance(eodfs, dict) or (not "self" in eodfs.keys() or not "other" in eodfs.keys()): @@ -33,8 +34,10 @@ def get_signals(eodfs, condition, contrast, c_size, c_duration, c_ampl_dip, chir non_chirper_freq_profile = np.ones(time.shape) * non_chirper_freq chirper_freq = eodfs["other"] if condition == "other" else eodfs["self"] - _, chirper_signal, _, chirper_freq_profile = create_chirp(eodf=chirper_freq, chirpsize=c_size, chirpduration=c_duration, - ampl_reduction=c_ampl_dip, chirptimes=chirp_times, duration=duration, dt=dt) + _, chirper_signal, _, chirper_freq_profile = create_chirp(eodf=chirper_freq, + chirpsize=chirp_size, + chirpduration=chirp_duration, + ampl_reduction=chirp_amplitude_dip, chirptimes=chirp_times, duration=duration, dt=dt) other_ampl = contrast/100 if condition == "self": @@ -65,7 +68,7 @@ if __name__ == "__main__": grid_shape = (5 + len(eod_contrasts) - 1, 7) conditions = ["other", "self"] - fig = plt.figure(figsize=(4.5, 4.5)) + fig = plt.figure(figsize=(4.5, 5.5)) for i, condition in enumerate(conditions): time, self_signal, self_freq, other_signal, other_freq = get_signals(eod_frequencies, condition, eod_contrasts[0], chirp_size, chirp_duration, chirp_amplitude_dip, chirp_times, @@ -113,10 +116,11 @@ if __name__ == "__main__": despine(ax, spines=["top", "left", "right"]) ax.set_xticks(np.arange(0.0, total_duration + 0.001, 0.25)) ax.set_xticklabels(np.arange(0.0, total_duration * 1000+1, 250), fontsize=7) - ax.set_xlabel("times [ms]", fontsize=9) + ax.set_xlabel("time [ms]", fontsize=9) else: despine(ax, spines=["top", "bottom", "left", "right"]) fig.subplots_adjust(left=0.1, bottom=0.1, top=0.99, right=0.99) - plt.show() \ No newline at end of file + plt.savefig("Chirp_induced_ams.pdf") + plt.close() \ No newline at end of file diff --git a/chirps_as_probing_signals.md b/chirps_as_probing_signals.md index 8dc8ac3..188b3ed 100644 --- a/chirps_as_probing_signals.md +++ b/chirps_as_probing_signals.md @@ -30,13 +30,19 @@ Dimensionalities involved, The beat frequency, the distance (contrast), the chir * without chirps * with self-generated chirps * with foreign generated chirps +Won't do, this is trivial?! ### 2. Use Alex' model to get the P-unit responses +* implement the Chripstimulus class * move along the same lines as for the input signals +* create the stimulus for a range of contrasts, with self of the other fish chirping, each stimulus phase contains a phase in wich there is no foreign fish. +* calculate a bunch (10) trials for each condition and estimate the detecatability of a foreign fish +* estimate the distance between the responses without the other fish and the beat response as well as the chirp response. ## Random thoughts * who is sending the chrips? Henninger and also Hupe illustrate the subordinant fish is chirping. * Raab et al show this is also the case with rises. * Check role of AFRs and rises in Tallarovic et al, Hupe et al. +* we actually do not observe chirps without stimulation