1. A touch controller for use in a device having a processor and a touch sensor panel, the touch controller being coupled to the processor and the touch sensor panel, and further comprising: an analog front-end (AFE), wherein the AFE is configured to generate raw touch image data based on electrical signals generated by the touch sensor panel in response to one or more detected touches thereto; a coarse processing element configured to, in response to the processor being set to a sleep mode, coarsely process the raw touch image data to generate sparse data and configured to estimate a probability that the raw touch image data is representative of a gesture drawn by a user; and an embedded memory configured to store at least the sparse data, wherein the touch controller is configured to transmit a signal to the processor to wake the processor up and transmit the stored sparse data and new touch image data to the processor, wherein the processor performs gesture recognition based on the sparse data and the new touch image data.