chirp-AM fig
This commit is contained in:
parent
037ebeb9b4
commit
692747466a
16
chirp_ams.py
16
chirp_ams.py
@ -21,7 +21,8 @@ def despine(axis, spines=None, hide_ticks=True):
|
|||||||
axis.yaxis.set_ticks([])
|
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):
|
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'!")
|
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()):
|
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
|
non_chirper_freq_profile = np.ones(time.shape) * non_chirper_freq
|
||||||
|
|
||||||
chirper_freq = eodfs["other"] if condition == "other" else eodfs["self"]
|
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,
|
_, chirper_signal, _, chirper_freq_profile = create_chirp(eodf=chirper_freq,
|
||||||
ampl_reduction=c_ampl_dip, chirptimes=chirp_times, duration=duration, dt=dt)
|
chirpsize=chirp_size,
|
||||||
|
chirpduration=chirp_duration,
|
||||||
|
ampl_reduction=chirp_amplitude_dip, chirptimes=chirp_times, duration=duration, dt=dt)
|
||||||
|
|
||||||
other_ampl = contrast/100
|
other_ampl = contrast/100
|
||||||
if condition == "self":
|
if condition == "self":
|
||||||
@ -65,7 +68,7 @@ if __name__ == "__main__":
|
|||||||
grid_shape = (5 + len(eod_contrasts) - 1, 7)
|
grid_shape = (5 + len(eod_contrasts) - 1, 7)
|
||||||
|
|
||||||
conditions = ["other", "self"]
|
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):
|
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,
|
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,
|
chirp_duration, chirp_amplitude_dip, chirp_times,
|
||||||
@ -113,10 +116,11 @@ if __name__ == "__main__":
|
|||||||
despine(ax, spines=["top", "left", "right"])
|
despine(ax, spines=["top", "left", "right"])
|
||||||
ax.set_xticks(np.arange(0.0, total_duration + 0.001, 0.25))
|
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_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:
|
else:
|
||||||
despine(ax, spines=["top", "bottom", "left", "right"])
|
despine(ax, spines=["top", "bottom", "left", "right"])
|
||||||
|
|
||||||
|
|
||||||
fig.subplots_adjust(left=0.1, bottom=0.1, top=0.99, right=0.99)
|
fig.subplots_adjust(left=0.1, bottom=0.1, top=0.99, right=0.99)
|
||||||
plt.show()
|
plt.savefig("Chirp_induced_ams.pdf")
|
||||||
|
plt.close()
|
@ -30,13 +30,19 @@ Dimensionalities involved, The beat frequency, the distance (contrast), the chir
|
|||||||
* without chirps
|
* without chirps
|
||||||
* with self-generated chirps
|
* with self-generated chirps
|
||||||
* with foreign generated chirps
|
* with foreign generated chirps
|
||||||
|
Won't do, this is trivial?!
|
||||||
|
|
||||||
### 2. Use Alex' model to get the P-unit responses
|
### 2. Use Alex' model to get the P-unit responses
|
||||||
|
|
||||||
|
* implement the Chripstimulus class
|
||||||
* move along the same lines as for the input signals
|
* 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
|
## Random thoughts
|
||||||
|
|
||||||
* who is sending the chrips? Henninger and also Hupe illustrate the subordinant fish is chirping.
|
* 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.
|
* Raab et al show this is also the case with rises.
|
||||||
* Check role of AFRs and rises in Tallarovic et al, Hupe et al.
|
* Check role of AFRs and rises in Tallarovic et al, Hupe et al.
|
||||||
|
* we actually do not observe chirps without stimulation
|
||||||
|
Loading…
Reference in New Issue
Block a user