TSPEAK(1) TSPEAK(1) NNAAMMEE tspeak - take the average of a time series SSYYNNOOPPSSIISS tspeak [-m n] [-M n] [-t] [-v] [filename] DDEESSCCRRIIPPTTIIOONN Tspeak for finding the local maxima and minima of cyclic time series. It performs a "Dicke Fix," i.e., hard limiting at +/- 1 on the deriva‐ tive of the input time series, and filters the hard limited output. The filtering is implemented as a retriggerable one-shot, that will only change state if sufficiently many, (see the -M n, or -m n arguments,) sequential increases, or decreases, in the input time series occur. If the marginal increment is zero, the last state of the one-shot is out‐ put, but not counted as a sequential increase or decrease. Note that this implementation is an approximation of a single pole fil‐ ter. With a hard limiting comparator output of +/- 1 in response to an input time series of -1 to +1, the comparator will change state 3 time units later, (for -M and -m both equal to 3.) The single pole filter output would be -1 + (2 * (1 - (e^(-(t * k))))), which would be zero in three time units, or, -(3 * k) = ln (0.5), or, k = 0.23104906, which is the 1 / time constant, tc, of the single pole filter, or the time con‐ stant = 1 / 0.23104906 = 4.328085126. The advantage of the implementa‐ tion is that the last three input time units "vote," as to whether to change the state of the comparator-a form of hysteresis. When used in signal circuits, the bandwidth, bw, is 1 / (2 * pi * tc), and the average time between zero crossings for white noise is (1 / bw) * e^(((vt / en)^2) / 2), where vt is the comparator threshold, and en the RMS of the noise voltage. If vt = 0, (and en != 0,) and the time constant is 4.328085126, the average time between zero crossings is 2 * pi * 4.328085126 = 27.19416087, (assuming a sample frequency of 1 Hz.) If the sample frequency is 6 minutes = 360 seconds = 0.1 hour, then the average time between zero crossings = time between false positives is 360 * 27.19416087 = 9789.8979132 = 2.719416087 hours. The input file structure is a text file consisting of records, in tem‐ poral order, one record per time series sample. Blank records are ignored, and comment records are signified by a '#' character as the first non white space character in the record. Data records must con‐ tain at least one field, which is the data value of the sample, but may contain many fields-if the record contains many fields, then the first field is regarded as the sample's time, and the last field as the sam‐ ple's value at that time. OOPPTTIIOONNSS --mm nn Minimum successive negative marginal increments for a minima, (3). --MM nn Minimum successive positive marginal increments for a maxima, (3). --tt Sample's time will be included in the output time series. --vv Print the version and copyright banner of the program. ffiilleennaammee Input filename. WWAARRNNIINNGGSS There is little or no provision for handling numerical exceptions. SSEEEE AALLSSOO tsderivative(1), tshcalc(1), tshurst(1), tsintegrate(1), tslogre‐ turns(1), tslsq(1), tsnormal(1), tsshannon(1), tsblack(1), tsbrown‐ ian(1), tsdlogistic(1), tsfBm(1), tsfractional(1), tsgaussian(1), tsin‐ tegers(1), tslogistic(1), tspink(1), tsunfairfractional(1), tswhite(1), tscoin(1), tsunfairbrownian(1), tsfraction(1), tsshannonmax(1), tschangewager(1), tssample(1), tsrms(1), tscoins(1), tsavg(1), tsXsquared(1), tsstockwager(1), tsshannonwindow(1), tsmath(1), tsavg‐ window(1), tspole(1), tsdft(1), tsbinomial(1), tsdeterministic(1), tsnumber(1), tsrmswindow(1), tsshannonstock(1), tsmarket(1), tsstock(1), tsstatest(1), tsunfraction(1), tsshannonaggregate(1), tsin‐ stant(1), tsshannonvolume(1), tsstocks(1), tsshannonfundamental(1), tstrade(1), tstradesim(1), tsrunlength(1), tsunshannon(1), tsroot‐ mean(1), tsrunmagnitude(1), tskurtosis(1), tskurtosiswindow(1), tsroot‐ meanscale(1), tsscalederivative(1), tsgain(1), tsgainwindow(1) tscauchy(1), tslognormal(1), tskalman(1), tsroot(1), tslaplacian(1), tspeak(1) DDIIAAGGNNOOSSTTIICCSS Error messages for incompatible arguments, failure to allocate memory, inaccessible files, and opening and closing files. AAUUTTHHOORRSS ---------------------------------------------------------------------- A license is hereby granted to reproduce this software source code and to create executable versions from this source code for personal, non-commercial use. The copyright notice included with the software must be maintained in all copies produced. THIS PROGRAM IS PROVIDED "AS IS". THE AUTHOR PROVIDES NO WARRANTIES WHATSOEVER, EXPRESSED OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, TITLE, OR FITNESS FOR ANY PARTICULAR PURPOSE. THE AUTHOR DOES NOT WARRANT THAT USE OF THIS PROGRAM DOES NOT INFRINGE THE INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY IN ANY COUNTRY. Copyright (c) 1994-2011, John Conover, All Rights Reserved. Comments and/or bug reports should be addressed to: john@email.johncon.com (John Conover) ---------------------------------------------------------------------- January 17, 2008 TSPEAK(1)