updating changes

This commit is contained in:
saschuta 2024-03-20 17:01:38 +01:00
parent 11b02d70c9
commit d983863c99
15 changed files with 1036 additions and 334 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View File

@ -124,10 +124,10 @@ def model_and_data2(eod_metrice = False, width=0.005, nffts=['whole'], powers=[1
trial_nr = 1000000#1000000
save_names = [
'calc_RAM_model-2__nfft_whole_power_1_afe_0.009_RAM_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_11_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
'calc_RAM_model-2__nfft_whole_power_1_afe_0.009_RAM_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_500000_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
'calc_RAM_model-2__nfft_whole_power_1_afe_0.009_RAM_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_'+str(trial_nr)+'_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
'calc_RAM_model-2__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_11_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
'calc_RAM_model-2__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_500000_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
'calc_RAM_model-2__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_'+str(trial_nr)+'_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
]

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -61,7 +61,7 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
stack_final = get_axis_on_full_matrix(full_matrix, mat)
abs_matrix = np.abs(stack_final)
abs_matrix, add_nonlin_title, resize_val = rescale_colorbar_and_values(abs_matrix)
abs_matrix, add_nonlin_title, resize_val = rescale_colorbar_and_values(abs_matrix,add_nonlin_title = 'k')
ax.axhline(0, color = 'white', linestyle = ls, linewidth = lw)
@ -85,9 +85,9 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
#################
# power spectra data
log = 'log'#'log'
ylim_log = (-14.2, 3)
nfft = 2 ** 15
log = 'log'#'log'#'log'#'log'
ylim_log = (-14.2, 3)#(-14.2, 3)
nfft = 2 ** 13
xlim_psd = [0, 300]
DF1_desired_orig = [133, 166]#33
@ -97,8 +97,8 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
# subplot_spec=grid[1])
markers = ['s', 'o']
DF1_desired, DF2_desired, fr, eod_fr, arrays_len = plt_data_full_model(c1, chose_score, detections, devs, dfs, end, grid[3], mult_type, sorted_on, markers = ['s', 'o'],clip_on = True, DF2_desired = DF2_desired_orig, DF1_desired = DF1_desired_orig, alpha = [1, 0.5], log = log, ylim_log = ylim_log, nfft = nfft, xlim_psd = xlim_psd)
ms = 14
DF1_desired, DF2_desired, fr, eod_fr, arrays_len = plt_data_full_model(c1, chose_score, detections, devs, dfs, end, grid[3], mult_type, sorted_on, ms = ms, markers = ['s', 'o'],clip_on = True, DF2_desired = DF2_desired_orig, DF1_desired = DF1_desired_orig, alpha = [1,1], log = log, ylim_log = ylim_log, nfft = nfft, xlim_psd = xlim_psd)
#################
@ -120,6 +120,7 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
DF2_frmult = np.array(DF2_desired_orig) / fr
#embed()
DF1_frmult[0] = 1
DF2_frmult[1] = 0.32339256#1.06949369
print(DF1_frmult)
print(DF2_frmult)
@ -129,8 +130,8 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
#DF2_frmult[0] = 0.1
#DF1_frmult[1] = 0.4
#DF2_frmult[1] = 0.6
ylim_log = (-15, 3)
#ylim_log = (-25.2, 3)
ylim_log = (-10, 3) #
#########################
# punkte die zur zweiten Reihe gehören
@ -156,48 +157,27 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
way = '' # 'mult'#'absolut'
ways = ['mult_minimum_1', 'absolut', 'mult_env_3', 'mult_f1_3', 'mult_f2_3', 'mult_minimum_3', 'mult_env_1',
'mult_f1_1', 'mult_f2_1', ]
length = 1 # 5
length = 2 # 5
reshuffled = '' # ,
alphas = [1,0.5]
for g in range(len(DF1_desired)):
axp = plt.subplot(grid0[g])
#
a_size = 0.0125#25#0.04#0.015
model_done = False
if model_done:
old = False
if old:
fr = plt_model_full_model(axp, a_f1s=[0.03], af_2 = 0.1, cells=[cell],trials_nr = arrays_len[g], add_pp=250, single_waves=['_SeveralSumWave_', ], cell_start=11,
zeros='ones', perc = 0.25, several_peaks_nr = 2, alpha = alphas[g], log = log, nfft = nfft, freqs_mult1 = DF1_frmult[g], freqs_mult2 = DF2_frmult[g], xlim = [0, 170], a_frs=[1], add_half=0, show=True)#01
# ATTENTION: Diese Zelle ('2012-07-03-ak-invivo-1') braucht längere Abschnitte, mindsetesn 5 Sekunden damit das Powerspectrum nicht so niosy ist!
#embed()dev_spikes='original',
fr = plt_model_full_model2(grid0, reshuffled=reshuffled, datapoints=50, limit=10.2,
reshuffle=reshuffled, dev=0.0005, a_f1s=[a_size], af_2 = a_size, array_len=[20,20],
stimulus_length=length, way=way, plus_q=plus_q,
diagonal=diagonal, runs=1,nfft = nfft,xlim_psd = xlim_psd, ylim_log = ylim_log,
cells=[cell], dev_spikes = '05', markers = markers,DF1_frmult = DF1_frmult, DF2_frmult = DF2_frmult,
show=True, log = log,ms = ms, clip_on = True) #arrays_len a_f1s=[0.02]"2012-12-13-an-invivo-1"'2013-01-08-aa-invivo-1'
else:
fr = plt_model_full_model2(axp, dev_spikes='original', reshuffled=reshuffled, datapoints=50, limit=10.2,
reshuffle=reshuffled, dev=0.0005, a_f1s=[0.15], af_2 = 0.15, trials_nr=arrays_len[g],
stimulus_length=length, way=way, plus_q=plus_q, freq1_ratio=DF1_frmult[g],
diagonal=diagonal, freq2_ratio=DF2_frmult[g], runs=5,nfft = nfft,
cells=['2013-01-08-aa-invivo-1'], marker = makers[g],
show=True, log = 'log', clip_on = True) # a_f1s=[0.02]"2012-12-13-an-invivo-1"
if g == 0:
axp.text(1,1, 'Model', ha = 'right', va = 'top', transform=axp.transAxes)
axes.append(axp)
if g == 0:
remove_xticks(axp)
axp.set_xlabel('')
else:
axp.set_xlabel('Frequency [Hz]')
axp.set_xlim(xlim_psd)
if log == 'log':
axp.set_ylim(ylim_log)
axp.set_ylabel('dB')
join_y(axes[1::])
#.share
#ax.plot(fr_noise * f1 / fr_waves, fr_noise * f2 / fr_waves, 'o', ms=5, markeredgecolor=color012,
@ -452,22 +432,45 @@ def plt_model_full_model(axp, min=0.2, cells=[], a_f2 = 0.1, perc = 0.05, alpha
axp.set_xlabel('Frequency [Hz]')
return fr
def plt_model_full_model2(ax, reshuffled='reshuffled',af_2 = 0.1, datapoints=1000, dev=0.0005, limit=10.2, a_f1s=[0.03],
def plt_model_full_model2(grid0, reshuffled='reshuffled',af_2 = 0.1, datapoints=1000, dev=0.0005, limit=10.2, a_f1s=[0.03],
pdf=True, printing=False, plus_q='minus', freq1_ratio=1 / 2, diagonal='diagonal',
freq2_ratio=2 / 3, way='absolut', stimulus_length=0.5, runs=1, trials_nr=500, cells=[],
show=False, nfft=int(4096), beat='', nfft_for_morph=4096 * 4, gain=1,
sampling_factors=[''],
fish_receiver='Alepto', end_f1=4645,
fish_emitter='Alepto', marker = 'o',
fish_jammer='Alepto', reshuffle='reshuffled',clip_on = True,
redo_level='celllevel', step=10, zeros='zeros', corr='ratecorrrisidual',
sampling_factors=[''],DF2_frmult = [],DF1_frmult = [],
fish_receiver='Alepto', end_f1=4645,array_len = [],
fish_emitter='Alepto', marker = 'o',xlim_psd = [], ylim_log = [],
fish_jammer='Alepto', reshuffle='reshuffled', markers = [], clip_on = True,
redo_level='celllevel',ms = 14, step=10, zeros='zeros', corr='ratecorrrisidual',
us_name='', dev_spikes='original', start_f1=20, log = '',plot=False):
plot_style()
model_cells = pd.read_csv(load_folder_name('calc_model_core') + "/models_big_fit_d_right.csv")
if len(cells) < 1:
cells = len(model_cells)
axes = []
ps = []
results_diff = pd.DataFrame()
for g in range(len(DF2_frmult)):
# embed()
freq2_ratio = DF2_frmult[g]
freq1_ratio = DF1_frmult[g]
#embed()
ax = plt.subplot(grid0[g])
axes.append(ax)
trials_nr = array_len[g]
marker = markers[g]
#embed()
#model_done = True
#if model_done:
#old = False
#if old:
# fr = plt_model_full_model(ax, a_f1s=[a_size], af_2 = 0.1, cells=[cell],trials_nr = arrays_len[g], add_pp=250, single_waves=['_SeveralSumWave_', ], cell_start=11,
# zeros='ones', perc = 0.25, several_peaks_nr = 2, alpha = alphas[g], log = log, nfft = nfft, freqs_mult1 = DF1_frmult[g], freqs_mult2 = DF2_frmult[g], xlim = [0, 170], a_frs=[1], add_half=0, show=True)#01
#else:
for cell_here in cells:
# sachen die ich variieren will
###########################################
@ -481,6 +484,7 @@ def plt_model_full_model2(ax, reshuffled='reshuffled',af_2 = 0.1, datapoints=100
for a_f2 in a_f2s:
# ,0.05,0.01, 0.005, 0.1, 0.2] # 0.001,
for a_f1 in a_f1s:
#embed()
a_frs = [1]
titles_amp = ['base eodf'] # ,'baseline to Zero',]
for a, a_fr in enumerate(a_frs):
@ -596,8 +600,12 @@ def plt_model_full_model2(ax, reshuffled='reshuffled',af_2 = 0.1, datapoints=100
third_fr = fr * freq1_ratio
else:
two_third_fr = fr * freq2_ratio
try:
third_fr = fr * freq1_ratio
except:
print('freq1 something')
embed()
#embed()
if plus_q == 'minus':
two_third_fr = -two_third_fr
third_fr = -third_fr
@ -611,15 +619,16 @@ def plt_model_full_model2(ax, reshuffled='reshuffled',af_2 = 0.1, datapoints=100
sampling_rate = 1 / deltat
base_cut, mat_base, smoothed0, mat0 = find_base_fr2(sampling_rate, spikes_base, deltat,
stimulus_length, time_array, dev=dev)
fr = np.mean(base_cut)
#fr = np.mean(base_cut)
frate, isis_diff = ISI_frequency(time_array, spikes_base[0], fill=0.0)
isi = np.diff(spikes_base[0])
cv0 = np.std(isi) / np.mean(isi)
cv1 = np.std(frate) / np.mean(frate)
#embed()
for ff, freq1 in enumerate(freqs1):
freq1 = [freq1]
freq2 = [freqs2[ff]]
#embed()
# time_var = time.time()
# if printing:
@ -657,25 +666,26 @@ def plt_model_full_model2(ax, reshuffled='reshuffled',af_2 = 0.1, datapoints=100
print('Generation process' + str(time.time() - t1))
results_diff = pd.DataFrame()
if 'f1' not in results_diff.keys():
results_diff['f1'] = freq1
results_diff['f2'] = freq2
results_diff['f0'] = eod_fr
results_diff['fr'] = fr
else:
#embed()#.loc[position_diff, 'f1']
results_diff.loc[g, 'f1'] = freq1[0]
results_diff.loc[g, 'f2'] = freq2[0]
results_diff.loc[g, 'f0'] = eod_fr
results_diff.loc[g, 'fr'] = fr
if run == 0:
##################################
# power spectrum
# embed()
if dev_spikes == 'original':
nfft = 2 ** 15
#nfft = 2 ** 15
# embed()
p0, p02, p01, p012, fs = calc_ps(nfft, [np.mean(mat012, axis=0)],
[np.mean(mat01, axis=0)],
@ -684,48 +694,96 @@ def plt_model_full_model2(ax, reshuffled='reshuffled',af_2 = 0.1, datapoints=100
test=False, sampling_rate=sampling_rate)
else:
nfft = 2 ** 15
#nfft = 2 ** 15
p0, p02, p01, p012, fs = calc_ps(nfft, smoothed012,
smoothed01, smoothed02, smoothed0,
test=False, sampling_rate=sampling_rate)
if log == 'log':
p012 = 10 * np.log10(p012 / np.max(p012))
# pp_mean = np.log
p_arrays = [p012]
for j in range(len(p_arrays)):
sampling = 40000
ps.append(p012)
#p_arrays = [p012]
p0_means = []
for j in range(len(ps)):
sampling = 40000
try:
ax = axes[j]
except:
print('axes something thing')
embed()
#for i in range(len(p0)):
# ax.plot(fs, ps[j], color='grey')
if log == 'log':
#p012 = 10 * np.log10(ps[j] / np.max(ps))
#embed()
p012 = log_calc_psd(ax, 'green', [], log, ps[j], np.max(ps))
else:
p012 = ps[j]
for i in range(len(p0)):
ax.plot(fs, p_arrays[j][i], color='grey')
p0_mean = np.mean(p_arrays[j], axis=0)
p0_mean = p012[0]#np.mean(ps[j], axis=0)
p0_means.append(p0_mean)
try:
ax.plot(fs, p0_mean, color='black') # plt_peaks(ax[0], p01, fs, 'orange')
DF1 = np.abs(results_diff.f1.iloc[-1] - results_diff.f0.iloc[-1])
DF2 = np.abs(results_diff.f2.iloc[-1] - results_diff.f0.iloc[-1])
except:
print('m something')
embed()
try:
DF1 = np.abs(results_diff.f1.iloc[j] - results_diff.f0.iloc[j])
DF2 = np.abs(results_diff.f2.iloc[j] - results_diff.f0.iloc[j])
except:
print('something')
embed()
fr = results_diff.fr.iloc[j]
#embed()
for p in range(len(p0_means)):
freqs = [np.abs(DF1), np.abs(DF1 * 2),
#for p in range(len(p0_means)):
freqs = [np.abs(DF1),
np.abs(DF2), np.abs(DF2 * 2),
np.abs(np.abs(DF1) - np.abs(DF2)),
np.abs(DF1) + np.abs(DF2), fr]
colors = [color01, color01,color02, color02,
color01_2, color012, color0]
labels = ['DF1', 'DF1_H1', 'DF1_H3', 'DF1_H4', 'DF2', 'DF2_H1',
'DF2_H2', 'DF2_H3', '|DF1-DF2|', '|DF1+DF2|', 'baseline']
colors = [color01, color02,color02,
color01_2, color012, color0]# np.abs(DF2 * 2), color02,'DF2_H1',
labels = ['DF1', 'DF1_H3', 'DF2',
'DF2_H2', '|DF1-DF2|', '|DF1+DF2|', 'baseline']
marker = markers[j]#'DF1_H1','DF1_H4',
#embed()
plt_peaks_several(labels, freqs, p0_means, 0, ax,
p0_means[p], colors, fs, marker = marker, clip_on = clip_on, alpha=0.7)
plt_peaks_several(labels, freqs, p0_mean, 0, ax,
p0_mean , colors, fs, emb = False, exact = False, marker = marker, log = log, perc = 0.08, add_log = 2.5, ms = ms, clip_on = clip_on)
ax.set_xlim(0, 300)
ax.set_ylim(0 - 20,
np.max(np.max(p_arrays)) + 70) # np.min(np.min(p0_means))
#ax.set_ylim(0 - 20,
# np.max(np.max(ps)) + 70) # np.min(np.min(p0_means))
#if j == 0:
# ax.legend(ncol=2)
if j == 0:
ax.text(1, 1, 'Model', ha='right', va='top', transform=ax.transAxes)
if j == 0:
remove_xticks(ax)
ax.set_xlabel('')
else:
ax.set_xlabel('Frequency [Hz]')
if log == 'log':
ax.set_xlim(xlim_psd)#
ax.set_ylim(ylim_log)
ax.set_ylabel('dB')
join_y(axes)#[1::]
#embed()
test = False
if test:
plt.plot(p0_means[0])
plt.plot(p0_means[1])
axes.append(ax)
return fr
def plt_data_full_model(c1, chose_score, detections, devs, dfs, end, grid, mult_type, sorted_on, log = 'log',markers = ['s', 'o'], marker = 'o', clip_on = False, alpha = [],DF2_desired = [-33, -100], DF1_desired = [133, 66], ylim_log = (-15, 3), nfft = 2 ** 13, xlim_psd = [0, 235]):
def plt_data_full_model(c1, chose_score, detections, devs, dfs, end, grid, mult_type, sorted_on, ms = 14, log = 'log',markers = ['s', 'o'], marker = 'o', clip_on = False, alpha = [],DF2_desired = [-33, -100], DF1_desired = [133, 66], ylim_log = (-15, 3), nfft = 2 ** 13, xlim_psd = [0, 235]):
# mean_type = '_MeanTrialsIndexPhaseSort_Min0.25sExcluded_'
extract = ''
datasets, data_dir = find_all_dir_cells()
@ -820,6 +878,9 @@ def plt_data_full_model(c1, chose_score, detections, devs, dfs, end, grid, mult_
if test:
mt_sorted[['DF1, DF2', 'm1, m2']]
mt_sorted['DF1, DF2']
ax00s = []
p_means_all_all = {}
choices = [[[0, 1, 2,3, 6]] * 6, [[0, 1, 2, 3, 4]] * 6]
for gg in range(len(DF1_desired)):
# embed()
@ -990,11 +1051,12 @@ def plt_data_full_model(c1, chose_score, detections, devs, dfs, end, grid, mult_
color0_burst, color0_burst,
color0, color0]
ax00 = plt.subplot(grid0[gg])
ax00s.append(ax00)
if gg == 0:
ax00.text(1, 1, 'Data', ha='right', va = 'top', transform=ax00.transAxes)
# todo: da nicht alle vier über einander plotten das ist das problem!
#embed()
choice = [[3,6]]*6
choice = choices[gg]
arrays_len.append(len(spikes_pure['012']))
#labels = labels_all_motivation(DF1, DF2, fr_isi)
@ -1010,6 +1072,9 @@ def plt_data_full_model(c1, chose_score, detections, devs, dfs, end, grid, mult_
'fr_given_burst_corr_individual', 'highest_fr_burst_corr_individual',
'fr', 'fr_given',
'highest_fr'] # '$|$DF1-DF2$|$=' + str(np.abs(np.abs(DF1) - np.abs(DF2))) + 'Hz',
#freqs = [fr_isi, np.abs(DF2), np.abs(DF1),
# np.abs(DF1) + np.abs(DF2), 2 * np.abs(DF2), 2 * np.abs(DF1),
# np.abs(np.abs(DF1) - np.abs(DF2)), ]
if len(alpha)> 0:
alphas = [alpha[gg]]*len(labels)
else:
@ -1018,9 +1083,9 @@ def plt_data_full_model(c1, chose_score, detections, devs, dfs, end, grid, mult_
ax00, fr_isi = plt_psds_ROC(arrays, ax00, ax_ps, cell, colors_p, f, grid0,
group_mean, nfft, p_means, p_means_all, ps, 4,
spikes_pure, time_array, range_plot=[3], names=names,
ax01=ax00, clip_on = clip_on, xlim_psd=xlim_psd, alphas = alphas, marker = markers[gg], choice = choice, labels = labels, ylim_log=ylim_log, log=log, text_extra=False)
ax01=ax00, ms = ms, clip_on = clip_on, xlim_psd=xlim_psd, alphas = alphas, marker = markers[gg], choice = choice, labels = labels, ylim_log=ylim_log, log=log, text_extra=False)
# [arrays[-1]]arrays, ax00, ax_ps, cell, colors_p, f, [-1]grid0, group_mean, nfft, p_means, p_means_all, ps, row,spikes_pure, time_array,
ax00.show_spines('lb')
ax00.show_spines('b')
if gg == 0:
ax00.legend(ncol=6, loc=(-1.16, 1.1))
if gg != len(DF1_desired) - 1:

View File

@ -5517,11 +5517,15 @@ groups and electrogenic mechanisms.},
Volume = {130}
}
@Article{Schlungbaum2023,
@article{Schlungbaum2023,
title={Detecting a periodic signal by a population of spiking neurons in the weakly nonlinear response regime},
author={Schlungbaum, Maria and Lindner, Benjamin},
journal={arXiv preprint arXiv:2305.13100},
year={2023}
journal={The European Physical Journal E},
volume={46},
number={11},
pages={108},
year={2023},
publisher={Springer}
}
@article{Schmiedt1982,

View File

@ -5517,11 +5517,15 @@ groups and electrogenic mechanisms.},
Volume = {130}
}
@Article{Schlungbaum2023,
@article{Schlungbaum2023,
title={Detecting a periodic signal by a population of spiking neurons in the weakly nonlinear response regime},
author={Schlungbaum, Maria and Lindner, Benjamin},
journal={arXiv preprint arXiv:2305.13100},
year={2023}
journal={The European Physical Journal E},
volume={46},
number={11},
pages={108},
year={2023},
publisher={Springer}
}
@article{Schmiedt1982,

View File

@ -86,7 +86,11 @@
\usepackage{cite}
% Use nameref to cite supporting information files (see Supporting Information section for more info)
\usepackage{nameref,hyperref}
\usepackage{nameref}%,hyperref
\usepackage[breaklinks=true,colorlinks=true,citecolor=blue!30!black,urlcolor=blue!30!black,linkcolor=blue!30!black]{hyperref}
\usepackage{natbib}%sort,comma,,round
\setcitestyle{super,comma,sort&compress}%authoryear,
% line numbers
\usepackage[right]{lineno}
@ -98,6 +102,7 @@
% color can be used to apply background shading to table cells only
\usepackage[table]{xcolor}
% array package and thick rules for tables
\usepackage{array}
@ -118,6 +123,8 @@
\hline
\noalign{\global\arrayrulewidth\savedwidth}}
% Remove comment for double spacing
%\usepackage{setspace}
%\doublespacing
@ -134,8 +141,8 @@
\renewcommand{\figurename}{Fig}
% Use the PLoS provided BiBTeX style
\bibliographystyle{plos2015}
%\bibliographystyle{}%plos2015
\bibliographystyle{}%alpha}%}%alpha}%apalike}
% Remove brackets from numbering in List of References
\makeatletter
\renewcommand{\@biblabel}[1]{\quad#1.}
@ -508,7 +515,7 @@ While the sensory periphery can often be well described by linear models, this i
}
\end{figure*}
Recent theoretical and modelling work on leaky integrate-and-fire (LIF) model neurons revealed specific pattern of nonlinear interactions when driven with weak sinewaves\cite{Voronenko2017}. This situation is reminiscent of the real fish's situation in which three electric fish interact. The active electrosensory system is then exposed to the two AMs arising from the interactions with either foreign fish's field. Previous recordings in the natural habitat showed interactions of three animals in which two animals interacted closely (strong signals) and were interrupted by an intruding animal (weak signal). The intruder was detected at spatial distances that led to an extremely faint intruder signal while the strong signal of the other animal is present\cite{Henninger2018}. When the receiver fish with EOD frequency \feod{} is alone, the P-unit fire action potentials at a spontaneous baseline rate. Accordingly, a peak at \fbase{} is present in the power spectrum of the neuronal response (\subfigrefb{fig:motivation}{A}, bottom).\notejg{more baseline trials, fake it, if needed}. Phase-locking to the own field also leads to a representation of \feod{} in their firing rate (see \figref{fig:cells_suscept}\panel{B})\cite{Sinz2020}. The beat frequency when two fish interact is also represented in the respective responses and accordingly, there is a peak in power spectrum at $\Delta f_1$ or $\Delta f_2$ (\subfigrefb{fig:motivation}{B, C}, respectively). When three fish encounter, all their waveforms interfere with both beat frequencies being present in the superimposed signal (\subfigrefb{fig:motivation}{D}, top). The power spectrum of the neuronal activity contains both previously seen peaks, but also nonlinear interaction peaks at the sum frequency \bsum{} and the difference frequency \bdiff{} (\subfigrefb{fig:motivation}{D}, bottom). The latter is known as the social envelope\cite{Stamper2012Envelope, Savard2011}. The neuron shown here, clearly encodes the envelope. Whether P-units in general encode envelopes has been subject of controversy, some works do not consider P-units as envelope encoders\cite{Middleton2006}, while others identify some P-units as envelope encoders\cite{Savard2011}.
Recent theoretical and modelling work on leaky integrate-and-fire (LIF) model neurons revealed specific pattern of nonlinear interactions when driven with weak sinewaves\cite{Voronenko2017}. This situation is reminiscent of the real fish's situation in which three electric fish interact. The active electrosensory system is then exposed to the two AMs arising from the interactions with either foreign fish's field. Previous recordings in the natural habitat showed interactions of three animals in which two animals interacted closely (strong signals) and were interrupted by an intruding animal (weak signal). The intruder was detected at spatial distances that led to an extremely faint intruder signal while the strong signal of the other animal is present\cite{Henninger2018}. When the receiver fish with EOD frequency \feod{} is alone, the P-unit fire action potentials at a spontaneous baseline rate. Accordingly, a peak at \fbase{} is present in the power spectrum of the neuronal response (\subfigrefb{fig:motivation}{A}, bottom).\notejg{more baseline trials, working on it}. Phase-locking to the own field also leads to a representation of \feod{} in their firing rate (see \figref{fig:cells_suscept}\panel{B})\cite{Sinz2020}. The beat frequency when two fish interact is also represented in the respective responses and accordingly, there is a peak in power spectrum at $\Delta f_1$ or $\Delta f_2$ (\subfigrefb{fig:motivation}{B, C}, respectively). When three fish encounter, all their waveforms interfere with both beat frequencies being present in the superimposed signal (\subfigrefb{fig:motivation}{D}, top). The power spectrum of the neuronal activity contains both previously seen peaks, but also nonlinear interaction peaks at the sum frequency \bsum{} and the difference frequency \bdiff{} (\subfigrefb{fig:motivation}{D}, bottom). The latter is known as the social envelope\cite{Stamper2012Envelope, Savard2011}. The neuron shown here, clearly encodes the envelope. Whether P-units in general encode envelopes has been subject of controversy, some works do not consider P-units as envelope encoders\cite{Middleton2006}, while others identify some P-units as envelope encoders\cite{Savard2011}.
The P-unit responses can be partially explained by simple linear filters. The linear relation of the cellular response and the stimulus can be captured by the first-order susceptibility (or transfer function). As in Volterra series, higher-order terms describe the nonlinear interactions. We quantify the nonlinearity of P-unit encoding by estimating the second-order susceptibility from white-noise responses\cite{Voronenko2017,Neiman2011fish,Nikias1993}. We address whether the theory still holds for neurons that do not encode the foreign signals directly but respond to the AM of a carrier. For this study we re-use a large set of recordings of afferents of both the active (P-units) and the passive electrosensory (ampullary cells) to work out which cellular features determine which cells show nonlinear encoding.
@ -566,7 +573,7 @@ In a high-CV P-unit we could not find such nonlinear structures, neither in the
We calculated the second-order susceptibility surfaces at \fsum{} by extracting the respective spectral components of the P-unit responses to RAM stimuli. How does this relate to the pure sinewave situation that approximates the interference of real animals? The relevant signals are the the beat frequencies \bone{} and \btwo{} that arise from the interference of the receiving fish's own and either of the foreign EODs (\figref{fig:motivation}). The response power spectrum showed peaks from nonlinear interaction at the sum of the two beat frequencies (orange marker, \subfigrefb{fig:motivation}{D}) and at the difference between the two beat frequencies (red circle, \subfigrefb{fig:motivation}{D}). In the example $\Delta f_{2}$ was similar to \fbase{}, corresponding to the horizontal line in the RAM-based second-order susceptibility matrix in \subfigrefb{model_and_data}\,\panel[iii]{C}. In the three-fish example, there was a second, less prominent, nonlinearity at the difference between the two beat frequencies (red circle, \subfigrefb{fig:motivation}{D}), that cannot be explained with the second-order susceptibility matrix in \subfigrefb{model_and_data}\,\panel[iii]{C}, in which only the nonlinearity at \fsum{} in the response is addressed (\Eqnref{eq:crosshigh}).
\begin{figure*}[!ht]
\includegraphics[width=\columnwidth]{model_full}
\caption{\label{fig:model_full} \figitem[]{A} Full second-order susceptibility of the model of an electrophysiologically recorded P-unit (see table~\ref{modelparams} for model parameters of 2012-07-03-ak). White lines -- coordinate axis. The nonlinearity at \fsum{} in the firing rate is quantified in the upper right and lower left quadrants (\Eqnref{eq:susceptibility}). The nonlinearity at \fdiff{} in the firing rate is quantified in the upper left and lower right quadrants. Baseline firing rate $\fbase{}=120$\,Hz. Absolute value of the model second-order susceptibility, with $N=1$\,million stimulus realizations and the intrinsic noise split (see methods). The colored markers highlight the nonlinear effects found in \subfigrefb{fig:motivation}{D}. \figitem{B} Power spectral density of model responses (left) and the respective recorded data (right) under pure sinewave stimulation. \figitem{C} Same as \panel[]{B} but for frequency combinations off the nonlinear structure. \note[TODO]{Better combination of off-axis frequency components, round for off-axis stimuli}}
\caption{\label{fig:model_full} \figitem[]{A} Full second-order susceptibility of the model of an electrophysiologically recorded P-unit (see table~\ref{modelparams} for model parameters of 2012-07-03-ak). White lines -- coordinate axis. The nonlinearity at \fsum{} in the firing rate is quantified in the upper right and lower left quadrants (\Eqnref{eq:susceptibility}). The nonlinearity at \fdiff{} in the firing rate is quantified in the upper left and lower right quadrants. Baseline firing rate $\fbase{}=120$\,Hz. Absolute value of the model second-order susceptibility, with $N=1$\,million stimulus realizations and the intrinsic noise split (see methods). The colored markers highlight the nonlinear effects found in \subfigrefb{fig:motivation}{D}. \figitem{B} Power spectral density of model responses (left) and the respective recorded data (right) under pure sinewave stimulation. \figitem{C} Same as \panel[]{B} but for frequency combinations off the nonlinear structure. \note[TODO]{Better combination of off-axis frequency components. Still working on the units of the second-order susceptibility in this plot. In \panel[]{B} left the green and blue markers are at the same position.}}
\end{figure*}
%section \ref{intrinsicsplit_methods}).\figitem{A} Absolute value of the second-order susceptibility of an electrophysiologically recorded P-unit. RAM stimulus realizations $N=11$. Diagonal bands appear when the sum of the frequencies \fsum{} or the difference \fdiff{} is equal to \fbase{}. \figitem{B} The diagonals, that were present in \panel{A}, are complemented by vertical and horizontal lines when \fone{} or \ftwo{} are equal to \fbase{}. Note that the different scale of the second-order susceptibility is associated with the higher signal-to-ratio in case of 1 million repeats in \panel{B}.
@ -574,7 +581,7 @@ The second-order susceptibility can also be calculated for the full matrix inclu
The smaller \fdiff{} power spectral peak observed during pure sine-wave stimulation (\subfigrefb{fig:motivation}{D}) can be explained by the fading of the horizontal line in the upper-left quadrant (\subfigrefb{fig:model_full}{A}, \cite{Schlungbaum2023}). If we choose different frequency combinations, weak or no nonlinear spectral peaks are observed \subfigrefb{fig:model_full}{C}. Even though the second-order susceptibilities here were estimated form data and models with an modulated (EOD) carrier (\figrefb{fig:model_full}) they are in good accordance with the second-order susceptibilities found in LIF models without a carrier\cite{Voronenko2017, Schlungbaum2023}.
If two frequencies not part of the triangular structure are chosen with pure sine wave stimulation no nonlinearity peaks appear (\subfigrefb{fig:model_full}{C}). \note{Das Modell Bespiel fehlt noch da arbeite ich noch dran.}
If two frequencies not part of the triangular structure are chosen with pure sine wave stimulation no nonlinearity peaks appear (\subfigrefb{fig:model_full}{C}).
\begin{figure*}[!ht]
\includegraphics[width=\columnwidth]{data_overview_mod}
@ -625,6 +632,8 @@ A possible readout mechanism should be the topic of future studies that need to
\subsection*{Behavioral relevance of nonlinear interactions}
The behavioral relevance of the weak signal detection in P-units is evident from the courtship context observed in freely interacting animals\cite{Henninger2018}. Outside courtship behavior, the encoding of secondary or social envelopes is a common need\cite{Stamper2012Envelope}. In a previous study it was demonstrated that information about low-frequency secondary envelopes would not be present in P-units' responses but would arise thorough nonlinear processing downstream in the ELL \cite{Middleton2006,Middleton2007}. Based on our work we would predict that only a small subset of cells, with low CVs, should encode the social envelopes under white noise stimulation. An absence of low-CVs cells in the population analyzed in the previous studies could explain their conclusions. On the other hand, another study showed that P-units with strong nonlinearities, low firing rates and high CVs could indeed encode social envelopes\cite{Savard2011}. These findings are in contrast to the previously mentioned work\cite{Middleton2007} and, at first glance, also to our results. The missing link, that has not been considered in this work, might be the bursting of P-units, the repeated firing of spikes after one EOD period interleaved with longer intervals of quietness\cite{Chacron2004}. Bursting was not explicitly addressed in the previous work, still the reported high CVs of the envelope encoding P-units indicate a higher rate of bursting\cite{Savard2011}. How bursts influence the second-order susceptibility of P-units will be addressed in following works (in preparation).
Note that in this work we operated in a regime of weak stimuli and that the envelope encoding addressed in \cite{Savard2011,Middleton2007} operates in a regime of strong stimuli, where the firing rate is saturated. The exact transition from the nonlinearities in a regime of weak stimuli to a regime of strong stimuli could be addressed in further P-unit studies.
Sinusoidal AMs are relevant in interactions with a few fish. We can understand the noise as the presence of many animals with individual EOD frequencies at the same time. Under noise stimulation, nonlinearities were demonstrated to be strong for weak stimuli but were shown to decrease for stronger noise stimuli (\figrefb{fig:cells_suscept}). As long as the noise signal is weak, those fish are distant and the nonlinearity is maintained. An increasing stimulus amplitude would indicate that many fish are close to the receiver and a decrease of nonlinear effects can be observed. These findings imply that the nonlinear effects arising in the presence of three fish decline the more fish join. \lepto{} usually prefers small groups of fish\cite{Stamper2010}. Thus, the described second-order susceptibility might still be behaviorally relevant under natural conditions. The decline of nonlinear effects when several fish are present might be an adaptive process reducing the number of frequencies represented in its primary sensory afferents to a minimum. Such representation would still leave room to create nonlinear effects at later processing steps in higher-order neurons.
The afferents of the passive electrosensory system, the ampullary cells, were found to exhibit much stronger nonlinearities than P-units (\figref{fig:data_overview_mod}). The adequate stimulus for this system is a direct stimulation not an amplitude modulation. In this sense the ampullary cells are closer to the LIF models used by Voroneko and colleagues\cite{Voronenko2017} and we can thus expect that the same nonlinear mechanisms are at work here. For the ampullary system, the sinewave stimulation is not as relevant as for the P-unit system. Ampullary cells encode low-frequency exogenous electric signals such as muscle potentials induced by prey movement\cite{Kalmijn1974, Engelmann2010, Neiman2011fish}. The simultaneous muscle activity of a swarm of prey (such as \textit{Daphnia}) resembles Gaussian white noise\cite{Neiman2011fish}, similar to the stimuli used here. Our results show some similarities with the analyses by Neiman and Russel\cite{Neiman2011fish} who study the encoding in ampullary afferents in the paddlefish. There, the power spectrum of the spontaneous activity also shows a peak at the baseline frequency (internal oscillator) but also at the oscillation frequency measured at the epithelium and interactions of both. Most of the latter disappear in the case of external stimulation, though. Here we find only peaks at the baseline frequency of the neuron and its harmonics. There are interesting similarities and dissimilarities; stimulus encoding in the paddlefish as well as in the brown ghost is very linear for low frequencies and there are nonlinearities in both systems. Linear encoding in the paddlefish shows a gap in the spectrum at the frequency of the epitheliar oscillation, instead the nonlinear response is very pronounced there. In \lepto{}, the dominating frequency under baseline conditions is the baseline firing rate, and we do see increased nonlinearity in this frequency range. The baseline frequency, however, is outside the linear coding range\cite{Grewe2017} while it is within the linear coding range in paddlefish\cite{Neiman2011fish}. Interestingly, the nonlinear response in the paddlefish ampullaries increases with stimulus intensity while it disappears in our case (\subfigrefb{fig:data_overview_mod}{F}). The population of ampullary cells is much more homogeneous with respect to the baseline rate (131$\pm$29\,Hz) and stimulus encoding properties than the P-units\cite{Grewe2017}. This implies that, if the stimulus contains the appropriate frequency components that sum up to the baseline rate, there should be a nonlinear response at a frequency that is similar for the full population of ampullary cells (the baseline frequency) that is outside the linear coding range. Postsynaptic cells integrating ampullary input might be able to extract this nonlinear response from the input population. How such nonlinear effects in ampullary cells might influence prey detection should be addressed in further studies.
@ -741,7 +750,7 @@ The absolute value of a second-order susceptibility matrix is visualized in \fig
We expect to see nonlinear susceptibility when $\omega_1 + \omega_2 = \fbase{}$. To characterize this we calculated the peakedness of the nonlinearity (PNL) as
\begin{equation}
\label{eq:nli_equation}
\nli{} = \frac{\max_{\fbase{}-5\,\rm{Hz} \leq f \leq \fbase{}+5\,\rm{Hz}} D(f)}{\mathrm{med}(D(f))}
\nli{} = \frac{ D(\max(\fbase{}-5\,\rm{Hz} \leq f \leq \fbase{}+5\,\rm{Hz}))}{\mathrm{med}(D(f))}
\end{equation}
For this index, the second-order susceptibility matrix was projected onto the diagonal $D(f)$, by taking the mean of the anti-diagonals. The peakedness at the frequency $\fbase{}$ in $D(f)$ was quantified by finding the maximum of $D(f)$ in the range $\fbase{} \pm 5$\,Hz (\subfigrefb{fig:cells_suscept}{G}) and dividing it by the median of $D(f)$.
@ -889,8 +898,10 @@ A big portion of the total noise was assigned to the signal component ($c_{signa
% here. See http://journals.plos.org/plosone/s/latex for
% step-by-step instructions.
%
\bibliography{references}
\bibliographystyle{apalike}%alpha}%}%alpha}%apalike}
\bibliography{journalsabbrv,references}
%\bibliography{references}
%\bibliography{journalsabbrv,references}
\newpage
\section*{Supporting information}
@ -913,17 +924,17 @@ CVs in P-units can range up to 1.5 \cite{Grewe2017, Hladnik2023}. We show the sa
\begin{figure*}[hp]%hp!
\includegraphics{trialnr}
\caption{\label{fig:trialnr} Change of the median second-order susceptibility depending on the stimulus repetition number $\n{}$.
\includegraphics[width=\columnwidth]{trialnr}
\caption{\label{fig:trialnr} Change of the median second-order susceptibility depending on the stimulus repetition number $\n{}$. Grey -- 5th to 95th percentile of the second-order susceptibility.
}
\end{figure*}
\bibliographystyle{iscience}
%\bibliographystyle{iscience}
%\bibliographystyle{apalike}%alpha}%}%alpha}%apalike}
%\bibliographystyle{elsarticle-num-names}%elsarticle-num-names}
%\ExecuteBibliographyOptions{sorting=nty}
%\bibliographystyle{authordate2}
\bibliography{journalsabbrv,references}
%\bibliography{journalsabbrv,references}
%\begin{thebibliography}{00}
\end{document}

View File

@ -86,7 +86,8 @@
\usepackage{cite}
% Use nameref to cite supporting information files (see Supporting Information section for more info)
\usepackage{nameref,hyperref}
\usepackage{nameref}%,hyperref
\usepackage[breaklinks=true,colorlinks=true,citecolor=blue!30!black,urlcolor=blue!30!black,linkcolor=blue!30!black]{hyperref}
% line numbers
\usepackage[right]{lineno}
@ -98,6 +99,7 @@
% color can be used to apply background shading to table cells only
\usepackage[table]{xcolor}
% array package and thick rules for tables
\usepackage{array}
@ -118,6 +120,8 @@
\hline
\noalign{\global\arrayrulewidth\savedwidth}}
% Remove comment for double spacing
%\usepackage{setspace}
%\doublespacing
@ -508,7 +512,7 @@ While the sensory periphery can often be well described by linear models, this i
}
\end{figure*}
Recent theoretical and modelling work on leaky integrate-and-fire (LIF) model neurons revealed specific pattern of nonlinear interactions when driven with weak sinewaves\cite{Voronenko2017}. This situation is reminiscent of the real fish's situation in which three electric fish interact. The active electrosensory system is then exposed to the two AMs arising from the interactions with either foreign fish's field. Previous recordings in the natural habitat showed interactions of three animals in which two animals interacted closely (strong signals) and were interrupted by an intruding animal (weak signal). The intruder was detected at spatial distances that led to an extremely faint intruder signal while the strong signal of the other animal is present\cite{Henninger2018}. When the receiver fish with EOD frequency \feod{} is alone, the P-unit fire action potentials at a spontaneous baseline rate. Accordingly, a peak at \fbase{} is present in the power spectrum of the neuronal response (\subfigrefb{fig:motivation}{A}, bottom).\notejg{more baseline trials, fake it, if needed}. Phase-locking to the own field also leads to a representation of \feod{} in their firing rate (see \figref{fig:cells_suscept}\panel{B})\cite{Sinz2020}. The beat frequency when two fish interact is also represented in the respective responses and accordingly, there is a peak in power spectrum at $\Delta f_1$ or $\Delta f_2$ (\subfigrefb{fig:motivation}{B, C}, respectively). When three fish encounter, all their waveforms interfere with both beat frequencies being present in the superimposed signal (\subfigrefb{fig:motivation}{D}, top). The power spectrum of the neuronal activity contains both previously seen peaks, but also nonlinear interaction peaks at the sum frequency \bsum{} and the difference frequency \bdiff{} (\subfigrefb{fig:motivation}{D}, bottom). The latter is known as the social envelope\cite{Stamper2012Envelope, Savard2011}. The neuron shown here, clearly encodes the envelope. Whether P-units in general encode envelopes has been subject of controversy, some works do not consider P-units as envelope encoders\cite{Middleton2006}, while others identify some P-units as envelope encoders\cite{Savard2011}.
Recent theoretical and modelling work on leaky integrate-and-fire (LIF) model neurons revealed specific pattern of nonlinear interactions when driven with weak sinewaves\cite{Voronenko2017}. This situation is reminiscent of the real fish's situation in which three electric fish interact. The active electrosensory system is then exposed to the two AMs arising from the interactions with either foreign fish's field. Previous recordings in the natural habitat showed interactions of three animals in which two animals interacted closely (strong signals) and were interrupted by an intruding animal (weak signal). The intruder was detected at spatial distances that led to an extremely faint intruder signal while the strong signal of the other animal is present\cite{Henninger2018}. When the receiver fish with EOD frequency \feod{} is alone, the P-unit fire action potentials at a spontaneous baseline rate. Accordingly, a peak at \fbase{} is present in the power spectrum of the neuronal response (\subfigrefb{fig:motivation}{A}, bottom).\notejg{more baseline trials, working on it}. Phase-locking to the own field also leads to a representation of \feod{} in their firing rate (see \figref{fig:cells_suscept}\panel{B})\cite{Sinz2020}. The beat frequency when two fish interact is also represented in the respective responses and accordingly, there is a peak in power spectrum at $\Delta f_1$ or $\Delta f_2$ (\subfigrefb{fig:motivation}{B, C}, respectively). When three fish encounter, all their waveforms interfere with both beat frequencies being present in the superimposed signal (\subfigrefb{fig:motivation}{D}, top). The power spectrum of the neuronal activity contains both previously seen peaks, but also nonlinear interaction peaks at the sum frequency \bsum{} and the difference frequency \bdiff{} (\subfigrefb{fig:motivation}{D}, bottom). The latter is known as the social envelope\cite{Stamper2012Envelope, Savard2011}. The neuron shown here, clearly encodes the envelope. Whether P-units in general encode envelopes has been subject of controversy, some works do not consider P-units as envelope encoders\cite{Middleton2006}, while others identify some P-units as envelope encoders\cite{Savard2011}.
The P-unit responses can be partially explained by simple linear filters. The linear relation of the cellular response and the stimulus can be captured by the first-order susceptibility (or transfer function). As in Volterra series, higher-order terms describe the nonlinear interactions. We quantify the nonlinearity of P-unit encoding by estimating the second-order susceptibility from white-noise responses\cite{Voronenko2017,Neiman2011fish,Nikias1993}. We address whether the theory still holds for neurons that do not encode the foreign signals directly but respond to the AM of a carrier. For this study we re-use a large set of recordings of afferents of both the active (P-units) and the passive electrosensory (ampullary cells) to work out which cellular features determine which cells show nonlinear encoding.
@ -566,7 +570,7 @@ In a high-CV P-unit we could not find such nonlinear structures, neither in the
We calculated the second-order susceptibility surfaces at \fsum{} by extracting the respective spectral components of the P-unit responses to RAM stimuli. How does this relate to the pure sinewave situation that approximates the interference of real animals? The relevant signals are the the beat frequencies \bone{} and \btwo{} that arise from the interference of the receiving fish's own and either of the foreign EODs (\figref{fig:motivation}). The response power spectrum showed peaks from nonlinear interaction at the sum of the two beat frequencies (orange marker, \subfigrefb{fig:motivation}{D}) and at the difference between the two beat frequencies (red circle, \subfigrefb{fig:motivation}{D}). In the example $\Delta f_{2}$ was similar to \fbase{}, corresponding to the horizontal line in the RAM-based second-order susceptibility matrix in \subfigrefb{model_and_data}\,\panel[iii]{C}. In the three-fish example, there was a second, less prominent, nonlinearity at the difference between the two beat frequencies (red circle, \subfigrefb{fig:motivation}{D}), that cannot be explained with the second-order susceptibility matrix in \subfigrefb{model_and_data}\,\panel[iii]{C}, in which only the nonlinearity at \fsum{} in the response is addressed (\Eqnref{eq:crosshigh}).
\begin{figure*}[!ht]
\includegraphics[width=\columnwidth]{model_full}
\caption{\label{fig:model_full} \figitem[]{A} Full second-order susceptibility of the model of an electrophysiologically recorded P-unit (see table~\ref{modelparams} for model parameters of 2012-07-03-ak). White lines -- coordinate axis. The nonlinearity at \fsum{} in the firing rate is quantified in the upper right and lower left quadrants (\Eqnref{eq:susceptibility}). The nonlinearity at \fdiff{} in the firing rate is quantified in the upper left and lower right quadrants. Baseline firing rate $\fbase{}=120$\,Hz. Absolute value of the model second-order susceptibility, with $N=1$\,million stimulus realizations and the intrinsic noise split (see methods). The colored markers highlight the nonlinear effects found in \subfigrefb{fig:motivation}{D}. \figitem{B} Power spectral density of model responses (left) and the respective recorded data (right) under pure sinewave stimulation. \figitem{C} Same as \panel[]{B} but for frequency combinations off the nonlinear structure. \note[TODO]{Better combination of off-axis frequency components, round for off-axis stimuli}}
\caption{\label{fig:model_full} \figitem[]{A} Full second-order susceptibility of the model of an electrophysiologically recorded P-unit (see table~\ref{modelparams} for model parameters of 2012-07-03-ak). White lines -- coordinate axis. The nonlinearity at \fsum{} in the firing rate is quantified in the upper right and lower left quadrants (\Eqnref{eq:susceptibility}). The nonlinearity at \fdiff{} in the firing rate is quantified in the upper left and lower right quadrants. Baseline firing rate $\fbase{}=120$\,Hz. Absolute value of the model second-order susceptibility, with $N=1$\,million stimulus realizations and the intrinsic noise split (see methods). The colored markers highlight the nonlinear effects found in \subfigrefb{fig:motivation}{D}. \figitem{B} Power spectral density of model responses (left) and the respective recorded data (right) under pure sinewave stimulation. \figitem{C} Same as \panel[]{B} but for frequency combinations off the nonlinear structure. \note[TODO]{Better combination of off-axis frequency components. Still working on the units of the second-order susceptibility in this plot. In \panel[]{B} left the green and blue markers are at the same position.}}
\end{figure*}
%section \ref{intrinsicsplit_methods}).\figitem{A} Absolute value of the second-order susceptibility of an electrophysiologically recorded P-unit. RAM stimulus realizations $N=11$. Diagonal bands appear when the sum of the frequencies \fsum{} or the difference \fdiff{} is equal to \fbase{}. \figitem{B} The diagonals, that were present in \panel{A}, are complemented by vertical and horizontal lines when \fone{} or \ftwo{} are equal to \fbase{}. Note that the different scale of the second-order susceptibility is associated with the higher signal-to-ratio in case of 1 million repeats in \panel{B}.
@ -574,7 +578,7 @@ The second-order susceptibility can also be calculated for the full matrix inclu
The smaller \fdiff{} power spectral peak observed during pure sine-wave stimulation (\subfigrefb{fig:motivation}{D}) can be explained by the fading of the horizontal line in the upper-left quadrant (\subfigrefb{fig:model_full}{A}, \cite{Schlungbaum2023}). If we choose different frequency combinations, weak or no nonlinear spectral peaks are observed \subfigrefb{fig:model_full}{C}. Even though the second-order susceptibilities here were estimated form data and models with an modulated (EOD) carrier (\figrefb{fig:model_full}) they are in good accordance with the second-order susceptibilities found in LIF models without a carrier\cite{Voronenko2017, Schlungbaum2023}.
If two frequencies not part of the triangular structure are chosen with pure sine wave stimulation no nonlinearity peaks appear (\subfigrefb{fig:model_full}{C}). \note{Das Modell Bespiel fehlt noch da arbeite ich noch dran.}
If two frequencies not part of the triangular structure are chosen with pure sine wave stimulation no nonlinearity peaks appear (\subfigrefb{fig:model_full}{C}).
\begin{figure*}[!ht]
\includegraphics[width=\columnwidth]{data_overview_mod}
@ -625,6 +629,8 @@ A possible readout mechanism should be the topic of future studies that need to
\subsection*{Behavioral relevance of nonlinear interactions}
The behavioral relevance of the weak signal detection in P-units is evident from the courtship context observed in freely interacting animals\cite{Henninger2018}. Outside courtship behavior, the encoding of secondary or social envelopes is a common need\cite{Stamper2012Envelope}. In a previous study it was demonstrated that information about low-frequency secondary envelopes would not be present in P-units' responses but would arise thorough nonlinear processing downstream in the ELL \cite{Middleton2006,Middleton2007}. Based on our work we would predict that only a small subset of cells, with low CVs, should encode the social envelopes under white noise stimulation. An absence of low-CVs cells in the population analyzed in the previous studies could explain their conclusions. On the other hand, another study showed that P-units with strong nonlinearities, low firing rates and high CVs could indeed encode social envelopes\cite{Savard2011}. These findings are in contrast to the previously mentioned work\cite{Middleton2007} and, at first glance, also to our results. The missing link, that has not been considered in this work, might be the bursting of P-units, the repeated firing of spikes after one EOD period interleaved with longer intervals of quietness\cite{Chacron2004}. Bursting was not explicitly addressed in the previous work, still the reported high CVs of the envelope encoding P-units indicate a higher rate of bursting\cite{Savard2011}. How bursts influence the second-order susceptibility of P-units will be addressed in following works (in preparation).
Note that in this work we operated in a regime of weak stimuli and that the envelope encoding addressed in \cite{Savard2011,Middleton2007} operates in a regime of strong stimuli, where the firing rate is saturated. The exact transition from the nonlinearities in a regime of weak stimuli to a regime of strong stimuli could be addressed in further P-unit studies.
Sinusoidal AMs are relevant in interactions with a few fish. We can understand the noise as the presence of many animals with individual EOD frequencies at the same time. Under noise stimulation, nonlinearities were demonstrated to be strong for weak stimuli but were shown to decrease for stronger noise stimuli (\figrefb{fig:cells_suscept}). As long as the noise signal is weak, those fish are distant and the nonlinearity is maintained. An increasing stimulus amplitude would indicate that many fish are close to the receiver and a decrease of nonlinear effects can be observed. These findings imply that the nonlinear effects arising in the presence of three fish decline the more fish join. \lepto{} usually prefers small groups of fish\cite{Stamper2010}. Thus, the described second-order susceptibility might still be behaviorally relevant under natural conditions. The decline of nonlinear effects when several fish are present might be an adaptive process reducing the number of frequencies represented in its primary sensory afferents to a minimum. Such representation would still leave room to create nonlinear effects at later processing steps in higher-order neurons.
The afferents of the passive electrosensory system, the ampullary cells, were found to exhibit much stronger nonlinearities than P-units (\figref{fig:data_overview_mod}). The adequate stimulus for this system is a direct stimulation not an amplitude modulation. In this sense the ampullary cells are closer to the LIF models used by Voroneko and colleagues\cite{Voronenko2017} and we can thus expect that the same nonlinear mechanisms are at work here. For the ampullary system, the sinewave stimulation is not as relevant as for the P-unit system. Ampullary cells encode low-frequency exogenous electric signals such as muscle potentials induced by prey movement\cite{Kalmijn1974, Engelmann2010, Neiman2011fish}. The simultaneous muscle activity of a swarm of prey (such as \textit{Daphnia}) resembles Gaussian white noise\cite{Neiman2011fish}, similar to the stimuli used here. Our results show some similarities with the analyses by Neiman and Russel\cite{Neiman2011fish} who study the encoding in ampullary afferents in the paddlefish. There, the power spectrum of the spontaneous activity also shows a peak at the baseline frequency (internal oscillator) but also at the oscillation frequency measured at the epithelium and interactions of both. Most of the latter disappear in the case of external stimulation, though. Here we find only peaks at the baseline frequency of the neuron and its harmonics. There are interesting similarities and dissimilarities; stimulus encoding in the paddlefish as well as in the brown ghost is very linear for low frequencies and there are nonlinearities in both systems. Linear encoding in the paddlefish shows a gap in the spectrum at the frequency of the epitheliar oscillation, instead the nonlinear response is very pronounced there. In \lepto{}, the dominating frequency under baseline conditions is the baseline firing rate, and we do see increased nonlinearity in this frequency range. The baseline frequency, however, is outside the linear coding range\cite{Grewe2017} while it is within the linear coding range in paddlefish\cite{Neiman2011fish}. Interestingly, the nonlinear response in the paddlefish ampullaries increases with stimulus intensity while it disappears in our case (\subfigrefb{fig:data_overview_mod}{F}). The population of ampullary cells is much more homogeneous with respect to the baseline rate (131$\pm$29\,Hz) and stimulus encoding properties than the P-units\cite{Grewe2017}. This implies that, if the stimulus contains the appropriate frequency components that sum up to the baseline rate, there should be a nonlinear response at a frequency that is similar for the full population of ampullary cells (the baseline frequency) that is outside the linear coding range. Postsynaptic cells integrating ampullary input might be able to extract this nonlinear response from the input population. How such nonlinear effects in ampullary cells might influence prey detection should be addressed in further studies.
@ -741,7 +747,7 @@ The absolute value of a second-order susceptibility matrix is visualized in \fig
We expect to see nonlinear susceptibility when $\omega_1 + \omega_2 = \fbase{}$. To characterize this we calculated the peakedness of the nonlinearity (PNL) as
\begin{equation}
\label{eq:nli_equation}
\nli{} = \frac{\max_{\fbase{}-5\,\rm{Hz} \leq f \leq \fbase{}+5\,\rm{Hz}} D(f)}{\mathrm{med}(D(f))}
\nli{} = \frac{ D(\max(\fbase{}-5\,\rm{Hz} \leq f \leq \fbase{}+5\,\rm{Hz}))}{\mathrm{med}(D(f))}
\end{equation}
For this index, the second-order susceptibility matrix was projected onto the diagonal $D(f)$, by taking the mean of the anti-diagonals. The peakedness at the frequency $\fbase{}$ in $D(f)$ was quantified by finding the maximum of $D(f)$ in the range $\fbase{} \pm 5$\,Hz (\subfigrefb{fig:cells_suscept}{G}) and dividing it by the median of $D(f)$.
@ -913,8 +919,8 @@ CVs in P-units can range up to 1.5 \cite{Grewe2017, Hladnik2023}. We show the sa
\begin{figure*}[hp]%hp!
\includegraphics{trialnr}
\caption{\label{fig:trialnr} Change of the median second-order susceptibility depending on the stimulus repetition number $\n{}$.
\includegraphics[width=\columnwidth]{trialnr}
\caption{\label{fig:trialnr} Change of the median second-order susceptibility depending on the stimulus repetition number $\n{}$. Grey -- 5th to 95th percentile of the second-order susceptibility.
}
\end{figure*}

View File

@ -10224,7 +10224,7 @@ def plt_spikes_ROC(ax0, colors, spikes_pure, xlim, lw = None, key_names=[''], j
# array_chosen=1,color012_minus = 'purple', mean_types=[], color012='orange', color01_2='purple', log='log'
def plt_psds_ROC(arrays, ax00, ax_ps, cell, colors_p, f, grid0, group_mean, nfft, p_means, p_means_all, ps, row,
spikes_pure, time_array, names=['0', '02', '01', '012'], color_psd='black', add_burst_corr=False,
xlim_psd=[0, 235], clip_on = True,labels= [], choice = [], marker = 'o', text_extra = True, alphas = [], range_plot = [], ylim_log=(-15, 3), ylim_psd=[], log='log', ax01 = None):
xlim_psd=[0, 235], clip_on = True, ms = 14, labels= [],ax00s = [], choice = [], marker = 'o', text_extra = True, alphas = [], range_plot = [], ylim_log=(-15, 3), ylim_psd=[], log='log', ax01 = None):
psd_type = 'mean_freq'
if not range_plot:
range_plot = range(len(arrays))
@ -10234,7 +10234,7 @@ def plt_psds_ROC(arrays, ax00, ax_ps, cell, colors_p, f, grid0, group_mean, nfft
try:
ref, ax00 = plt_single_pds(nfft, f, p_means, p_means_all[names[j]], ylim_psd, xlim_psd, color_psd, names,
ps,
arrays, ax_ps, grid0, row + 1, j, p_means_all, ax00 = ax01, psd_type='mean_freq', log=log)
arrays, ax_ps, grid0, row + 1, j, p_means_all, ax00s = ax00s, ax00 = ax01, psd_type='mean_freq', log=log)
except:
print('ref not working')
embed()
@ -10321,9 +10321,10 @@ def plt_psds_ROC(arrays, ax00, ax_ps, cell, colors_p, f, grid0, group_mean, nfft
#embed()
# add_log = 10.5#2.5
try: # todo: if log müsste hier was anderes rein, das log veränderte nämlich!#2.5
#embed()
plt_peaks_several(np.array(labels)[choice[j]], np.array(freqs)[choice[j]], pp, j,
ax00, pp_mean, np.array(colors_p)[choice[j]], f, texts_left=left, add_log=1.5, text_extra=text_extra,
exact=False, add_texts=extra, rots=np.array(rots)[j], ms=14, perc=0.08, log=log,
exact=False, add_texts=extra, rots=np.array(rots)[j], ms=ms, perc=0.08, log=log,
clip_on=clip_on, alphas = alphas, marker = marker) # True
except:
print('peaks thing2')
@ -10722,13 +10723,16 @@ def find_nix_full_path(c, cell, data_dir):
# , cut, delays_length, delays_length_m, effective_duration, frame,
def plt_single_pds(nfft, f, p_means, p_mean_all_here, ylim_psd, xlim_psd, color_psd, names, ps, arrays, ax_ps, grid0,
row, j, p_means_all, psd_type='mean_freq', log='log', ax00 = None):
row, j, p_means_all, psd_type='mean_freq',ax00s = [], log='log', ax00 = None):
# embed()
if psd_type == 'single':
ref = np.max([p_means_all['012'][0], p_means_all['01'][0], p_means_all['02'][0], p_means_all['0'][0]])
if not ax00:
if not ax00s:
ax00 = ax00s[j]
else:
ax00 = plt.subplot(grid0[row + 2, j])
ax_ps.append(ax00)
nfft = 2 ** 16
@ -18808,17 +18812,19 @@ def join_x(axts_all):
axts_all[0].get_shared_x_axes().join(*axts_all)
def join_y(axts_all):
def join_y(axts_all, mult_val = 1.00):
axts_all[0].get_shared_y_axes().join(*axts_all)
#embed()
if axts_all[0].get_ylim()[-1] != axts_all[1].get_ylim()[-1]:
try:
first = axts_all[0].get_ylim()[-1]
second = axts_all[1].get_ylim()[-1]
for a in range(len(axts_all)-1):
first = axts_all[a].get_ylim()#[-1]
second = axts_all[a+1].get_ylim()#[-1]
starting_val = np.min([first[0], second[0]])
end_val = np.max([first[1], second[1]])
axts_all[0].set_ylim(starting_val, end_val)
axts_all[1].set_ylim(starting_val, end_val)
axts_all[a].set_ylim(starting_val, end_val*mult_val)
axts_all[a+1].set_ylim(starting_val, end_val*mult_val)
except:
print('joiny something')
#embed()
@ -38514,7 +38520,7 @@ def restrict_cell_type(cells, cell_type):
return cells,p_units_cells,pyramidals
def plt_peaks_several(labels, freqs, p_arrays, j, axs_p, p0_means, colors, fs, marker = 'o', markeredgecolors=[], zorder = 2, ha ='left', rot = 45, add_texts = [], limit = None, texts_left = [], add_log = 2, rots =[], several_peaks_nr = 2, exact = True, text_extra = False, perc = 0.04, rel='rel', alphas = [], extend = False, edgecolor = None, ms =25, clip_on = False, several_peaks = True, alpha = 1, log =''):
def plt_peaks_several(labels, freqs, p_arrays, j, axs_p, p0_means, colors, fs, emb = False, marker = 'o', markeredgecolors=[], zorder = 2, ha ='left', rot = 45, add_texts = [], limit = None, texts_left = [], add_log = 2, rots =[], several_peaks_nr = 2, exact = True, text_extra = False, perc = 0.04, rel='rel', alphas = [], extend = False, edgecolor = None, ms =25, clip_on = False, several_peaks = True, alpha = 1, log =''):
df_passed = [] # ,
for ff, f in enumerate(range(len(freqs))):
@ -38531,6 +38537,7 @@ def plt_peaks_several(labels, freqs, p_arrays, j, axs_p, p0_means, colors, fs, m
condition = np.min(np.abs(df_passed - freqs[f])) < 10
if condition:
count = 0
for df in df_passed:
@ -38555,7 +38562,8 @@ def plt_peaks_several(labels, freqs, p_arrays, j, axs_p, p0_means, colors, fs, m
if j == 0:
add = (np.max(np.max(p_arrays)) * perc*count)
add_text = add + add_ext *count
# embed()
if emb:
embed()
else:
add = (np.max(np.max(p_arrays)) * 0.01) # * 0.01
add_text = (np.max(np.max(p_arrays)) * perc) # * 0.01
@ -39461,11 +39469,15 @@ def plt_model_big(ax, ls = '--', lw = 0.5, cell = '2012-07-03-ak-invivo-1'):
stack = get_stack_one_quadrant(cell, cell_add, cells_save, path, save_name, direct_load = True)
full_matrix = create_full_matrix2(np.array(stack), np.array(stack_rev))
stack_final = get_axis_on_full_matrix(full_matrix, stack)
#stack_final, add_nonlin_title, resize_val = rescale_colorbar_and_values(stack_final)#, add_nonlin_title = 'k'
add_nonlin_title = ''
im = plt_RAM_perc(ax, perc, np.abs(stack_final))
set_clim_same_here([im], mats=[np.abs(stack_final)], lim_type='up', nr_clim='perc', clims='', percnr=95)
set_xlabel_arrow(ax, xpos=1, ypos=-0.07)
set_ylabel_arrow(ax, xpos=-0.07, ypos=0.97)
cbar, left, bottom, width, height = colorbar_outside(ax, im, add=5, width=0.01)
cbar.set_label(nonlin_title(add_nonlin_title=' ['), rotation=90, labelpad=8)
cbar.set_label(nonlin_title(add_nonlin_title=' ['+add_nonlin_title), rotation=90, labelpad=8)
ax.axhline(0, color='white', linewidth=lw, linestyle=ls)
ax.axvline(0, color='white', linewidth=lw, linestyle=ls)
return perc, im, stack_final