Square Wave Transform source code
Square Wave Transform Tool for MATLAB Skliar O., Monge R. E., Oviedo G. and Gapper S. (2016). A New Method for the Analysis of Signals: The Square Wave Transform, Revista de Matemática: Teoría y Aplicaciones 2016, Vol. 23(1), pp. 85110. Skliar O., Monge R. E. and Gapper S. (2016). Analysis of time series and signals using the Square Wave Method. arXiv:1608.02166 [cs.NA]. Usage
The outputs are a twocolumn matrix If, within a certain time interval, a given time series is an adequate representation of a signal, then the SWM analysis of that time series, in that same time interval, can also be considered an analysis of that signal in that interval. The approximation obtained with the SWM for each of the numerical values in the time series analyzed is outstanding. Let V_{i} (for i = 1,2,…,n) be the i th value of the time series analyzed, and V_{icomp}, the corresponding approximation computed by adding all the square waves (whose coefficients and frequencies were computed by the SWM implementation) for that point. Thus, V_{i}  V_{icomp} is the modulus (absolute value) of the difference between those two values. There will be a modulus of this type for each data point in the time series. We can, therefore, compute a maximum of this difference between the time series: D_{m}=max V_{i}  V_{icomp}. Therefore, each computation using the
swt.m
 
Square Wave Transform Tool for C Skliar O., Monge R. E., Oviedo G. and Gapper S. (2016). A New Method for the Analysis of Signals: The Square Wave Transform, Revista de Matemática: Teoría y Aplicaciones 2016, Vol. 23(1), pp. 85110. Skliar O., Monge R. E. and Gapper S. (2016). Analysis of time series and signals using the Square Wave Method. arXiv:1608.02166 [cs.NA]. Usage
The C source code (which has a dependency on BLAS and LAPACK–standard linear algebra routines) implements the basic functionality of the SWM as a simple command line program that requires three arguments. The first parameter corresponds to the sampling frequency in Hz of the data to be analyzed. The second parameter corresponds to the time interval in seconds of the entire data set. Finally, the third parameter must reference a text file with one line per data point to be analyzed. The code is clearly commented and each important step in the calculation has been placed in separate functions to make it easy to adapt to other hardware environments. The outputs are a list of dyads in standard output (which can be redirected using shell features) and a single numerical value that indicates the approximation quality, referred to as If, within a certain time interval, a given time series is an adequate representation of a signal, then the SWM analysis of that time series, in that same time interval, can also be considered an analysis of that signal in that interval. The approximation obtained with the SWM for each of the numerical values in the time series analyzed is outstanding. Let V_{i} (for i = 1,2,…,n) be the i th value of the time series analyzed, and V_{icomp}, the corresponding approximation computed by adding all the square waves (whose coefficients and frequencies were computed by the SWM implementation) for that point. Thus, V_{i}  V_{icomp} is the modulus (absolute value) of the difference between those two values. There will be a modulus of this type for each data point in the time series. We can, therefore, compute a maximum of this difference between the time series: D_{m}=max V_{i}  V_{icomp}. Therefore, each computation using the C code defined here will have the following outputs:
swt.c

Back to publications