A method of generating synthetic data from time series data, such as from handwritten characters, words, sentences, mathematics, and sketches that are drawn with a stylus on an interactive display or with a finger on a touch device. This computationally efficient method is able to generate realistic variations of a given sample. In a handwriting or sketch recognition context, synthetic data is generated from real data in order to train recognizers and thus improve recognition accuracy when only a limited number of samples are available. Similarly, synthetic data can also be used to test and validate such recognizers. Also discussed is a dynamic time warping based approach for both segmented and continuous data that is designed to be a robust, go-to method for gesture recognition across a variety of modalities using only limited training samples.