Questions tagged [interleave]

Interleave - mix two or more digital signals by alternating between them.

To interleave is to mix two or more digital signals by alternating between them.

75 questions
31
votes
6 answers

Merging two lists in Haskell

Can't figure out how to merge two lists in the following way in Haskell: INPUT: [1,2,3,4,5] [11,12,13,14] OUTPUT: [1,11,2,12,3,13,4,14,5]
bogatyrjov
  • 5,317
  • 9
  • 37
  • 61
10
votes
4 answers

Interleave List of Lists in Haskell

I was wondering how could I write a function in Haskell that interleaves a list of lists into a single lists, for example, if I had a function called interleavelists :: [[a]] -> [a] it should be able to interleave the elements. Example: [[1,2,3]…
user1950055
  • 157
  • 1
  • 10
7
votes
4 answers

How to do bit striping on pixel data?

I have 3 buffers containing R, G, B bit data running on a 32-bit processor. I need to combine the three bytes in the following way: R[0] = 0b r1r2r3r4r5r6r7r8 G[0] = 0b g1g2g3g4g5g6g7g8 B[0] = 0b b1b2b3b4b5b6b7b8 int32_t Out = 0b r1g1b1r2g2b2r3g3…
Terry
  • 79
  • 1
7
votes
4 answers

What does interleaved stereo PCM linear Int16 big endian audio look like?

I know that there are a lot of resources online explaining how to deinterleave PCM data. In the course of my current project I have looked at most of them...but I have no background in audio processing and I have had a very hard time finding a…
William Rosenbloom
  • 2,506
  • 1
  • 14
  • 37
6
votes
0 answers

Are MongoDB bulk updates atomic if they apply to the same document?

For the following command where query can only ever match one document (note that bulkWrite() is ordered by default): final BulkWriteResult res = db.getCollection("mycol").bulkWrite(Arrays.asList( new UpdateOneModel<>(query, new…
elhefe
  • 3,404
  • 3
  • 31
  • 45
6
votes
4 answers

How can I interleave rows from 2 data frames together?

How can I interleave rows from 2 data frames together like a perfect riffle shuffle? Example data: df1 <- data.frame(df = 1, id = 1:5, chr = 'puppies') df2 <- data.frame(df = 2, id = 1:5, chr = 'kitties') df1: df id chr 1 1 1 puppies 2 1 …
Edward R. Mazurek
  • 2,107
  • 16
  • 29
5
votes
3 answers

Interleaving NumPy arrays with mismatching shapes

I would like to interleave multiple numpy arrays with differing dimensions along a particular axis. In particular, I have a list of arrays of shape (_, *dims), varying along the first axis, which I would like to interleave to obtain another array of…
user78729
  • 73
  • 4
5
votes
6 answers

How to interleave two given vectors in APL

I'm trying to solve a problem using APL, for which I have two vectors v1 and v2, with relative length of at most +1, depending on the input. That means that ((≢v1)-(≢v2))∊¯1 0 1. What would be the best way to interleave said vectors, so to create a…
J. Sallé
  • 213
  • 1
  • 8
4
votes
1 answer

Can Atomic values change during an "&&" operation?

I am aware of the next scenario: (Weird formatting, I know) private final AtomicBoolean aBoolean = new AtomicBoolean(true); public void doSomething() { if ( aBoolean.get() // line A && …
Delark
  • 1,141
  • 2
  • 9
  • 15
3
votes
2 answers

interleave mutliple arrays in javascript

We have an Array of arrays, which we want to interleave into a single array: i.e: masterArray = [[1, 2, 3], ['c', 'd', 'e']] => [1, 'c', 2, 'd', 3, 'e'], if arrays are not of equal length, pad it to the longest innerArray's length. i.e [1, 2, 3],…
hello world
  • 306
  • 1
  • 6
  • 28
3
votes
2 answers

Extension of interleave in clojure

I want to write a function to interleave two given sequences. The function should work like this: user=> (ext-interl '(1 2 3 4 5 6 7 8) '(a b c)) (1 a 2 b 3 c 4 a 5 b 6 c 7 a 8 b) The process will end when it reaches the longer sequence. My code…
Xiufen Xu
  • 531
  • 1
  • 3
  • 19
3
votes
1 answer

How to convert PCM audio stream for online play

I have access to an audio stream of PCM audio buffers. I should be clear I do not have access to the audio file. I only have access to a stream of 4096 byte chunks of the audio data. The PCM buffers come in with the following format: PCM Int…
William Rosenbloom
  • 2,506
  • 1
  • 14
  • 37
3
votes
4 answers

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

I would like to take an array like this and combine it into 1 single array. array (size=2) 0 => array (size=10) 0 => string '1' 1 => string 'a' 2 => string '3' 3 => string 'c' 1 => array…
Keith
  • 1,352
  • 3
  • 21
  • 48
2
votes
0 answers

error : interleave() got an unexpected keyword argument 'deterministic', when using tensorflow_datasets

Hei, error happens when using and processing dataset from tfds. import tensorflow_datasets as tfds cifar_builder = tfds.builder("cifar100") cifar_builder.download_and_prepare() print(cifar_builder.info) train_cifar_dataset =…
Zhang Wei
  • 31
  • 3
2
votes
2 answers

How do I interleave two Rust vectors by chunks of threes into a new vector?

I need an idiomatic way to interlace these two vectors: let v1 = vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0]; let v2 = vec![7.0, 8.0, 9.0, 10.0, 11.0, 12.0]; The output I expect is: [1.0, 2.0, 3.0, 7.0, 8.0, 9.0, 4.0, 5.0, 6.0, 10.0, 11.0, 12.0]; I used…
Ecumene
  • 87
  • 6
1
2 3 4 5