
We detected 25766 chirps in this dataset which included 27 valid trials of recordings that lasted 6 hours each. The number of detected chirps is close to the currently largest reported dataset by \textcite{obotiWhyBrownGhost2022} which contains multiple different experiments. This was achieved by extending the chirp detection algorithm by \textcite{henningerTrackingActivityPatterns2020}. We added a dynamic search frequency and combined peaks of the envelope in the EOD amplitude, the envelope of the dynamic search frequency, and the instantaneous frequency for chirp detection. The chirps we detected on a dataset published by \textcite{raabElectrocommunicationSignalsIndicate2021} indicate that individuals that win the competition for a superior shelter chirp less than the losers. Moreover, in some of these pairings, chirps emitted by the loser are temporally correlated with the offset of an agonistic interaction. This indicates, that chirps might be used by losers to terminate chasing events.

\subsection{Assessing detection performance}

While our chirp detector detected many chirps, the performance of the algorithm was not quantified yet. We only used a small trial dataset to visually asses whether chirps are detected or not. Additionally, the EOD$f$ of the fish in the trial data set were rather far apart, making it easy to correctly assign chirps. To assess the performance of our analysis data set, we visually inspected each iteration of the algorithm (in 5 seconds snippets) for one whole recording. However, for future uses of this detector, it is imperative to quantify the detection performance and tune the parameters accordingly. This is especially important considering that the main innovation of this algorithm is not to detect but to correctly assign chirps. We predict that the performance in the correct assignment will most likely drop with decreasing difference frequencies. If this is the case we have to quantify this parameter as well. In conclusion, future work on this algorithm should include a synthetic data set that reflects the natural variability to quantify the detection performances of multiple chirp detection parameters.

\subsection{The problem of normalization}

Currently, a major flaw of the chirp detector is that the peak detection parameters are fixed for each feature, and decided upon by trial and error. We reached the most error-free performance with high thresholds. A side effect is that the great majority of the chirps are only detected on a single electrode. If chirps would be detectable on multiple electrodes, the smallest number of electrodes on which a chirp must be detected could be used as an additional detection parameter. But to do this, ideally, we would need to be able to use the same peak detection parameters across all electrodes and for all features. And to achieve this we should normalize our feature arrays not only across features but also across electrodes. The difficulty with normalization arises with the rolling windows and the changing electrodes. If there is no chirp in a certain window, normalizing across electrodes over just that window would scale up all noise so that the peak detector would find many peaks. Most of the time
 these peaks do not occur at the same time and thus are not falsely detected as chirps, but sometimes, they are. The current method to fix this is to not normalize at all and hard-code peak detection thresholds. This solution is not flexible and might fail completely for new data sets without manually adjusting the parameters. The seemingly easy approach would be to save the data of all feature arrays for each iteration to disk and normalize across all data before running the chirp detector. But the fact that for each iteration we jump between electrodes makes this step complicated and impractical. Another approach could be, to determine 'chirp-less' windows by a single parameter before normalization. If e.g. there in no peak in the search frequency, we could just skip to the next window instead of running the whole detection routine. Normalization could then be performed only in windows that have a peak in search frequency. 

\subsection{Why can the instantaneous frequency go down during a chirp?} \label{ref:insta}

While computing the instantaneous frequency we often encountered troughs instead of peaks in frequency during chirps. We simply circumvented this issue by taking the absolute of this instantaneous frequency. This phenomenon is critical because chirps are defined by a positive frequency excursion and not by a decrease in frequency. This decrease was only found after we computed the band pass filter which is filtering \SI{5}{\hertz} around the baseline of the EOD$f$ of the individual fish. If we band pass-filtered in a way so that the chirp was still included in the signal, all peaks in the instantaneous frequency were positive. This indicates that the narrow band pass filter around the signal is causing these frequency drops. One explanation for this issue could be the reduced amplitude during a chirp. The band pass filter removes the high frequency components that a chirp introduces. If the amplitude reduction is high enough, the frequency information shifts to noise.  If this noise has only low frequency components the instantaneous frequency drops. If the chirp contrast is low and the amplitude of the baseline does not decrease strongly, the increase in frequency that is common during a chirp might be reflected in a peak. But if the contrast is high and the amplitude in the baseline breaks down this would reflect in a trough in the instantaneous frequency. Against this theory stands the fact that we observed the troughs in frequency in cases where the amplitude of the baseline did not break down strongly. 

\vspace{\baselineskip}

Another explanation are the properties of the band pass filter which can introduce a phase shift while the fish emits chirps. If the phase is shifted backward the frequency temporarily increases, and vice versa for forward phase shifts. We still do not fully understand this change in frequency yet. Further analysis should include plotting the transfer function of the filter since narrow pass bands could introduce anomalies. Additionally, we would like to simulate chirps with different parameters, such as chirp phase, height, width, and contrast to understand which parameters might result in a trough of the instantaneous frequency.

\subsection{Losers chirped more than winners}

The detected chirps in this experiment indicate that winners chirped less than losers in this competition experiment. We can hypothesize that chirps are used as a submissive signal conveying information about the physical condition \parencite{davies1978deep}, and therefore can settle the competition without fights that escalate. 
This result shows similarities to rises, another signal variation used by \textit{Aperonotus leptorhynchus}. \textcite{raabElectrocommunicationSignalsIndicate2021} showed that the loser of a competition experiment emitted more rises than the winner of the competition. Furthermore, the outcome of the competition is influenced by the body size: A larger body size is a predictor for winning the competition for the shelter \parencite{raabElectrocommunicationSignalsIndicate2021}. The frequencies of the individuals, on the other hand, do not seem to play a role in the outcome of the competition experiment. This needs to be further analyzed because the EOD$f$ is sexually dimorphic \parencite{meyer1987hormone}, and we did not take the sex of the pairings into account for our analysis.  

\subsection{Why chirps might only terminate chasing in some dyads}

Our results indicated that chirps can terminate chasing, hence we computed the chirp rate to the chasing on- or offset and physical events. Only for the chasing offset we could find a connection for some pairings in the competition experiment in a way that the chirp increases right before the offset of the chasing event. \textcite{raabElectrocommunicationSignalsIndicate2021} showed that rises are used by the subordinate to motivate mutual assessment. In the few cases where we observed increasing chirp frequencies at the offset of a chasing event, chirps may have been used by the loser of the competition to signal submission. Still, the mean for all pairings did not show a correlation of chirps and the chasing offsets. This can be explained by not including factors like sex and size difference in our analysis. The sex of the fish has an important role for the communication behavior in the mating season, where, the female emits a big chirp to signalize the spawning \parencite{hagedornCourtSparkElectric1985a, henningerStatisticsNaturalCommunication2018}. The size difference is also important for the outcome of the competition experiment, so there may be a link between the increase of chirping behavior and the offset of the chasing events with the size difference. This should be dissected further in the analysis of the behavioral data set. 

\subsection{Summary}

In conclusion, we were able to build the first chirp detector that might be usable on large data sets including multiple and freely moving individuals. Chrips can be detected by combining features from the changes in amplitude, instantaneous frequency, and a dynamic search window that is above the fish's own EOD$f$. We tested this detector on a data set of a competition experiment. We found that more chirps are produced when the size difference between the individuals was small and that the subordinates sometimes drastically increase their chirp frequency before a chasing event ends. This is the first step towards analyzing chirp-correlated behaviors in complex laboratory or field recordings to gain a clearer picture of the potentially multiple meanings of chirps. These first observations could inspire hypotheses that can then be verified in controlled experiments. 