Neocortical responses typically adapt to repeated sensory stimulation, improving sensitivity to stimulus changes, but possibly also imposing limitations on perception. For example, it is unclear whether information about stimulus frequency is perturbed by adaptation or encoded by precise response timing. We addressed this question in rat barrel cortex by comparing performance in behavioral tasks with either whisker stimulation, which causes frequency-dependent adaptation, or optical activation of cortically expressed channelrhodopsin-2, which elicits non-adapting neural responses. Circumventing adaption by optical activation substantially improved cross-hemispheric discrimination of stimulus frequency. This improvement persisted when temporal precision of optically evoked spikes was reduced. We were able to replicate whisker-driven behavior only by applying adaptation rules mimicking sensory-evoked responses to optical stimuli. Conversely, in a change-detection task, animals performed better with whisker than optical stimulation. Our results directly demonstrate that sensory adaptation critically governs the perception of stimulus patterns, decreasing fidelity under steady-state conditions in favor of change detection.