seanvelasco / lttb

Largest-Triangle-Three-Buckets algorithm for downsampling time-series data while retaining original shape including sharp inflections

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is LTTB?

Largest Triangle Three Buckets is a downsampling algorithm for time series data.

Installation

npm install @seanvelasco/lttb

Usage

import LTTB from '@seanvelasco/lttb'

const threshold = 300

const untreatedData = [...]

// Accepts an array of numbers (number[]) or typed arrays (Uint8Array, Uint16Array, Uint32Array, etc)

const downsampledData = LTTB(untreatedData, threshold)

About

Largest-Triangle-Three-Buckets algorithm for downsampling time-series data while retaining original shape including sharp inflections


Languages

Language:TypeScript 100.0%