public SAXRecords ts2saxByChunking ( double [ ] ts , int paaSize , double [ ] cuts , double nThreshold ) throws SAXException { SAXRecords saxFrequencyData = new SAXRecords ( ) ; // Z normalize it double [ ] normalizedTS = tsProcessor . znorm ( ts , nThreshold ) ; // perform PAA conversion if needed double [ ] paa = tsProcessor . paa ( normalizedTS , paaSize ) ; // Convert the PAA to a string. char [ ] currentString = tsProcessor . ts2String ( paa , cuts ) ; // create the datastructure for ( int i = 0 ; i < currentString . length ; i ++ ) { char c = currentString [ i ] ; int pos = ( int ) Math . floor ( i * ts . length / currentString . length ) ; saxFrequencyData . add ( String . valueOf ( c ) . toCharArray ( ) , pos ) ; } return saxFrequencyData ; }
Converts the input time series into a SAX data structure via chunking and Z normalization .