Firing-rate-modulated spike detection and neural decoding co-design