From stimulus encoding to feature extraction in weakly electric fish.