PHPackages                             rmatil/sax - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rmatil/sax

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rmatil/sax
==========

PHP Implementation of Symbolic Aggregate Approximation

028[1 issues](https://github.com/rmatil/SAX/issues)JavaScript

Since Aug 25Pushed 11y ago1 watchersCompare

[ Source](https://github.com/rmatil/SAX)[ Packagist](https://packagist.org/packages/rmatil/sax)[ RSS](/packages/rmatil-sax/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SAX
===

[](#sax)

PHP Implementation of Symbolic Aggregate Approximation ([SAX](http://www.cs.ucr.edu/~eamonn/SAX.htm))

Implementation of the suffix tree is based on the idea of "makagonov" on [Stackoverflow](http://stackoverflow.com/a/14580102)

### Installation

[](#installation)

Using composer:
`$ php composer.phar require "rmatil/sax":"dev-master"`

### Usage

[](#usage)

#### Step 1

[](#step-1)

Define a reference time series:

```
// time series used as reference
$referenceTimeSeries =  array(
                            array("time" => 123451, "count" => 2),
                            array("time" => 123452, "count" => 1),
                            array("time" => 123453, "count" => 6),
                            array("time" => 123454, "count" => 4),
                            array("time" => 123455, "count" => 5),
                            array("time" => 123456, "count" => 0)
                        );
```

#### Step 2

[](#step-2)

Define a single or multiple time series to analyse:

```
// single / multiple time series to analyse
$analysisTimeSeries = array(
                        array(
                            array("time" => 123411, "count" => -1),
                            array("time" => 123412, "count" => 1),
                            array("time" => 123413, "count" => 2),
                            array("time" => 123414, "count" => -1),
                            array("time" => 123415, "count" => 6),
                            array("time" => 123416, "count" => 30)
                        ));

// create a new instance of sax using the time series from above using the default alphabet size of 5
$sax = new SAX( $referenceTimeSeries, $analysisTimeSeries );

// or define the alphabet size by yourself ( must be greater than 2 and smaller than 11 )
$sax = new SAX( $referenceTimeSeries, $analysisTimeSeries, 8);
```

#### Step 3

[](#step-3)

Define a feature window length and a scanning window length:

```
// tarzan needs the feature window length and the scanning window length
// as parameters
$surprises = $sax->tarzan( 1, 2 );
```

### Documentation

[](#documentation)

An auto generated documentation can be found [here](http://rmatil.github.io/SAX/docs/).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/300a50e6d7985f685d905bf314f45e742e430b17fc32a14b0855ba1b91b30f29?d=identicon)[rmatil](/maintainers/rmatil)

---

Top Contributors

[![rmatil](https://avatars.githubusercontent.com/u/3106589?v=4)](https://github.com/rmatil "rmatil (49 commits)")

### Embed Badge

![Health badge](/badges/rmatil-sax/health.svg)

```
[![Health](https://phpackages.com/badges/rmatil-sax/health.svg)](https://phpackages.com/packages/rmatil-sax)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
