Animals acquire information about sensory stimuli around them and encode it using an analogue or a pulse-based code. Behaviourally relevant features need to be extracted from this representation for further processing. In the electrosensory system of weakly electric fish, single P-type electroreceptor afferents accurately encode the time course of random modulations in electric-field amplitude. We applied a stimulus estimation method and a signal-detection method to both P-receptor afferents and their targets, the pyramidal cells in the electrosensory lateral-line lobe. We found that although pyramidal cells do not accurately convey detailed information about the time course of the stimulus, they reliably encode up- and downstrokes of random modulations in electric-field amplitude. The presence of such temporal features is best signalled by short bursts of spikes, probably caused by dendritic processing, rather than by isolated spikes. Furthermore, pyramidal cells outperform P-receptor afferents in signalling the presence of temporal features in the stimulus waveform. We conclude that the sensory neurons are specialized to acquire information accurately with little processing, whereas the following stage extracts behaviourally relevant features, thus performing a nonlinear pattern-recognition task.