1. A method, comprising: in an electronic system: processing an analog signal, wherein the processing comprises: performing analog-to-digital conversion of the analog signal; and applying, prior to the analog-to-digital conversion, gain to at least a portion of the analog signal; and controlling the gain based on processing of a digital output generated based on the analog-to-digital conversion.