added thin lines to figure 3

This commit is contained in:
Jan Benda 2024-11-22 10:27:37 +01:00
parent db3cf7a4c4
commit 35f5065556
3 changed files with 13 additions and 5 deletions

Binary file not shown.

View File

@ -6,6 +6,7 @@ import pandas as pd
from matplotlib import gridspec, pyplot as plt
from plotstyle import plot_style
from plottools.colors import lighter, darker
from threefish.calc_time import extract_am
from threefish.core import find_code_vs_not, find_folder_name, find_project_data, info
from threefish.defaults import default_figsize
@ -405,7 +406,7 @@ def plt_amplitudes_for_contrasts(c_nrs_orig, cell_here, freq1, freq2, grid_down,
labels = [label_deltaf1(), label_deltaf2(),
label_sum(), label_diff(), label_fbasename_small()]
# ax_u1.legend(ncol = 4, loc = (0,1.2))
plt_single_trace([], ax_u1, frame_cell_orig, freq1, freq2,
scores=np.array(scores)[index], labels=np.array(labels)[index],
colors=np.array(colors)[index],
@ -414,6 +415,14 @@ def plt_amplitudes_for_contrasts(c_nrs_orig, cell_here, freq1, freq2, grid_down,
alpha=np.array(alpha)[index],
thesum=False, B_replace='F', default_colors=False,
c_dist_recalc=c_dist_recalc)
ax_u1.set_ylim(0, 220)
cc = np.arange(0, 8, 0.1)
ax_u1.plot(cc, 1.5 + 33*cc**2, color=darker(colors[2], 0.9), lw=0.5, zorder=100)
ax_u1.plot(cc, 1.5 + 15*cc**2, color=darker(colors[3], 0.8), lw=0.5, zorder=100)
ax_u1.plot(cc, 1.5 + 6.5*cc, color=lighter(colors[0], 0.5), lw=0.5, zorder=80)
ax_u1.plot(cc, 25 + 125*cc, color=lighter(colors[1], 0.5), lw=0.5, zorder=80)
# ax_us.append(ax_u1)
frame_cell = frame_cell_orig[
(frame_cell_orig.df1 == freq1) & (frame_cell_orig.df2 == freq2)]

View File

@ -449,15 +449,14 @@ When stimulating with both foreign signals simultaneously, additional peaks appe
\subsection{Linear and weakly nonlinear regimes}
\begin{figure*}[tp]
\includegraphics[width=\columnwidth]{nonlin_regime.pdf}
\notebl{E: add linear and quadratic functions}
\caption{\label{fig:nonlin_regime} Linear and nonlinear responses of a model P-unit in a three-fish setting in dependence on increasing stimulus amplitudes. The model P-unit was stimulated with two sinewaves of equal amplitude (contrast) at difference frequencies $\bone=30$\,Hz and $\btwo=130$\,Hz relative the receiver's EOD frequency. \btwo{} was set to match the baseline firing rate \fbase{} of the P-unit. The model used has the cell identifier 2013-01-08-aa (table~\ref{modelparams}). \figitem{A--D} Top: the stimulus, an amplitude modulation of the receiver's EOD resulting from the stimulation with the two sine waves. The contrasts of both beats increase from \panel{A} to \panel{D} as indicated. Middle: Spike raster of the model P-unit response. Bottom: power spectrum of the firing rate estimated from the spike raster with a Gaussian kernel ($\sigma=1$\,ms). \figitem{A} At very low stimulus contrasts the response is linear. The only peaks in the response spectrum are at the two stimulating beat frequencies (green and purple marker). \figitem{B} At higher stimulus contrasts, nonlinear responses appear at the sum and the difference of the stimulus frequencies (orange and red marker). \figitem{C} At even stronger stimulation additional peaks appear in the power spectrum. \figitem{D} At a contrast of 10\,\% the response at the sum of the stimulus frequencies almost disappears. \figitem{E} Amplitude of the linear (\bone{}, \btwo{}) and nonlinear (\bdiff{}, \bsum{}) responses of the model P-units as a function of beat contrast (contrasts increase equally for both beats).}
\caption{\label{fig:nonlin_regime} Linear and nonlinear responses of a model P-unit in a three-fish setting in dependence on increasing stimulus amplitudes. The model P-unit was stimulated with two sinewaves of equal amplitude (contrast) at difference frequencies $\bone=30$\,Hz and $\btwo=130$\,Hz relative the receiver's EOD frequency. \btwo{} was set to match the baseline firing rate \fbase{} of the P-unit. The model used has the cell identifier 2013-01-08-aa (table~\ref{modelparams}). \figitem{A--D} Top: the stimulus, an amplitude modulation of the receiver's EOD resulting from the stimulation with the two sine waves. The contrasts of both beats increase from \panel{A} to \panel{D} as indicated. Middle: Spike raster of the model P-unit response. Bottom: power spectrum of the firing rate estimated from the spike raster with a Gaussian kernel ($\sigma=1$\,ms). \figitem{A} At very low stimulus contrasts the response is linear. The only peaks in the response spectrum are at the two stimulating beat frequencies (green and purple marker). \figitem{B} At higher stimulus contrasts, nonlinear responses appear at the sum and the difference of the stimulus frequencies (orange and red marker). \figitem{C} At even stronger stimulation additional peaks appear in the power spectrum. \figitem{D} At a contrast of 10\,\% the response at the sum of the stimulus frequencies almost disappears. \figitem{E} Amplitude of the linear (\bone{}, \btwo{}) and nonlinear (\bdiff{}, \bsum{}) responses of the model P-unit as a function of beat contrast (thick lines). Thin lines indicate the initial linear and quadratic dependence on stimulus amplitude for the linear and non-linear responses, respectively.}
\end{figure*}
The stimuli used in \figref{fig:motivation} had the same not-small amplitude. Whether this stimulus conditions falls into the weakly nonlinear regime as in \citet{Voronenko2017} is not clear. In order to illustrate how the responses to two beat frequencies develop over a range of amplitudes we use a stochastic leaky-integrate-and-fire (LIF) based P-unit model fitted to a specific electrophysiologically measured cell \citep{Barayeu2023}.
At very low stimulus contrasts (less than approximately 0.5\,\% relative to the receiver's EOD amplitude) the spectrum has small peaks only at the beat frequencies (note, $\Delta f_2 = f_{base}$, \subfigref{fig:nonlin_regime}{A}, green and purple). The amplitudes of these peaks initially increase linearly with stimulus amplitude (\subfigref{fig:nonlin_regime}{E}), an indication of the linear response at lowest stimulus amplitudes.
At very low stimulus contrasts (less than approximately 0.5\,\% relative to the receiver's EOD amplitude) the spectrum has small peaks only at the beat frequencies (note, $\Delta f_2 = f_{base}$, \subfigref{fig:nonlin_regime}{A}, green and purple). The amplitudes of these peaks initially increase linearly with stimulus amplitude (\subfigref{fig:nonlin_regime}{E}, thin lines), an indication of the linear response at lowest stimulus amplitudes.
The linear regime is followed by the weakly non-linear regime. In addition to peaks at the stimulus frequencies, peaks at the sum and the difference of the stimulus frequencies appear in the response spectrum (\subfigref{fig:nonlin_regime}{B}, orange and red). The amplitudes of these two peaks initially increase quadratically with stimulus amplitude (\subfigref{fig:nonlin_regime}{E}).
The linear regime is followed by the weakly non-linear regime. In addition to peaks at the stimulus frequencies, peaks at the sum and the difference of the stimulus frequencies appear in the response spectrum (\subfigref{fig:nonlin_regime}{B}, orange and red). The amplitudes of these two peaks initially increase quadratically with stimulus amplitude (\subfigref{fig:nonlin_regime}{E}, thin lines).
At higher stimulus amplitudes (\subfigref{fig:nonlin_regime}{C \& D}) additional peaks appear in the response spectrum. The linear response and the weakly-nonlinear response start to deviate from their linear and quadratic dependence on amplitude (\subfigref{fig:nonlin_regime}{E}). The responses may even decrease for intermediate stimulus contrasts (\subfigref{fig:nonlin_regime}{D}). At high stimulus contrasts, additional nonlinearities in the system, in particular clipping of the firing rate, shape the responses.