A computer-implemented method for analyzing a physiological signal, comprising: selecting multiple first time intervals, each first time interval of the multiple first time intervals containing an instance of a pattern of interest in a recording of the physiological signal; segmenting each first time interval of the multiple first time intervals into a plurality of time segments; determining whether the physiological signal increases or decreases in each time segment of the plurality of time segments within the first time intervals, wherein determining whether the physiological signal increases or decreases comprises combining physiological signal characteristics in parallel time segments within the respective first time intervals; representing each respective time segment by a respective character, wherein the respective character denotes whether the physiological signal increases or decreases in the respective time segment; concatenating the characters representing the time segments to form a string, the string being a signature of the pattern of interest, such that the signature is computed responsively to the combination of the physiological signal characteristics in the parallel time segments; and identifying a further occurrence of the pattern of interest in the physiological signal during a second time interval by matching the signal in the second time interval to the signature, wherein matching the signal in the second time interval to the signature comprises representing the signal in the second time interval using a character sequence and finding an occurrence of the string in the character sequence; the method further comprising calculating a scaling parameter of the signal in the first time interval, wherein calculating the scaling parameter comprises identifying a first dominant frequency in a first spectrum of the signal in the first time interval, and wherein matching the signal in the second time interval to the signature comprises scaling the signal in the second time interval responsively to the scaling parameter to match the signal in the first time interval, wherein scaling the signal in the second time interval comprises identifying a second dominant frequency in a second spectrum of the signal in the second time interval and scaling the second spectrum so that the second dominant frequency matches the first dominant frequency. selecting multiple first time intervals, each first time interval of the multiple first time intervals containing an instance of a pattern of interest in a recording of the physiological signal; segmenting each first time interval of the multiple first time intervals into a plurality of time segments; determining whether the physiological signal increases or decreases in each time segment of the plurality of time segments within the first time intervals, wherein determining whether the physiological signal increases or decreases comprises combining physiological signal characteristics in parallel time segments within the respective first time intervals; representing each respective time segment by a respective character, wherein the respective character denotes whether the physiological signal increases or decreases in the respective time segment; concatenating the characters representing the time segments to form a string, the string being a signature of the pattern of interest, such that the signature is computed responsively to the combination of the physiological signal characteristics in the parallel time segments; and identifying a further occurrence of the pattern of interest in the physiological signal during a second time interval by matching the signal in the second time interval to the signature, wherein matching the signal in the second time interval to the signature comprises representing the signal in the second time interval using a character sequence and finding an occurrence of the string in the character sequence; the method further comprising calculating a scaling parameter of the signal in the first time interval, wherein calculating the scaling parameter comprises identifying a first dominant frequency in a first spectrum of the signal in the first time interval, and wherein matching the signal in the second time interval to the signature comprises scaling the signal in the second time interval responsively to the scaling parameter to match the signal in the first time interval, wherein scaling the signal in the second time interval comprises identifying a second dominant frequency in a second spectrum of the signal in the second time interval and scaling the second spectrum so that the second dominant frequency matches the first dominant frequency.