deinterleave
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/deinterleave package

1.0.0 • Public • Published

deinterleave unstable Build Status

Deinterleaves elements in an array.

npm install deinterleave

const deinterleave = require('deinterleave')
 
let array = [1,0,1,0,1,0,1,0]
deinterleave(array, 2)
 
// array is [1,1,1,1,0,0,0,0]

API

deinterleave(source, stride=2)

Rearrange source elements so that it has planar layout:

[a,b,c, a,b,c, ...][a,a,a,..., b,b,b,..., c,c,c]

Source can be an Array, TypedArray or any array-like object. stride indicates number of elements per group, eg. in case of audio buffer it is number of channels.

License

© 2017 Dima Yv. MIT License

Package Sidebar

Install

npm i deinterleave

Weekly Downloads

9

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dfcreative