Skip to content

Instantly share code, notes, and snippets.

@schlameel

schlameel/deinterleave.py

Last active Jul 24, 2020
Embed
What would you like to do?
De-interleave data using numpy
import numpy as np
CHANNEL_COUNT = 2
frames = np.array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1])
deinterleaved = [frames[idx::CHANNEL_COUNT] for idx in range(CHANNEL_COUNT)]
print(deinterleaved[0])
# prints "[0 0 0 0 0 0 0 0 0 0]"
print(deinterleaved[1])
# prints "[1 1 1 1 1 1 1 1 1 1]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.