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
2
votes
3 answers

Quickest way to combine 2 strings, interleaving string from second column into the first by row throughout the dataframe

I have written a function (incorporating bits and pieces scavenged from stack overflow) that will move throughout a data frame by row, interleaving strings from col-x to col-y, for all two column x,y pair in all rows. I have a working solution. The…
greg
  • 21
  • 3
2
votes
2 answers

Cannot invoke 'append' with an argument list of type '(Range)'

The error I’m seeing is the title: Cannot invoke 'append' with an argument list of type '(Range)' While practicing string interleaving in Swift, I'm trying to append the substring of one string to another. This other question covers…
NonCreature0714
  • 5,744
  • 10
  • 30
  • 52
2
votes
3 answers

interleave list after every n elements

I want to interleave interElem after every 2 list elements. Data: listi <- c(rbind(letters[1:4], list(c(13,37)))) interElem <- c("inter","leavistan") looks like: > listi [[1]] [1] "a" [[2]] [1] 13 37 [[3]] [1] "b" [[4]] [1] 13 37 [[5]] [1]…
Andre Elrico
  • 10,956
  • 6
  • 50
  • 69
2
votes
1 answer

Prolog How can I construct a list of list into a single list by interleaving?

How can I construct a list of a list into one single list with interleaving sublists? like recons([[1,2],[3,4]],X) will give X= [1,3,2,4]? I have been trying hours and my code always gave me very strange results or infinite loop, what I thinking was…
Liu Junhan
  • 203
  • 3
  • 8
2
votes
1 answer

How to efficiently interleave bits from 8 __int16 numbers?

I am building Morton number for spatial indexing, I have 8 unsigned 16 bit numbers that will turn into __int128 number. The efficiency is crucial, so naive solution (loop over everything) or building separate 8 128bit numbers is too expensive. I am…
Evil
  • 460
  • 1
  • 11
  • 25
2
votes
1 answer

Find the shortest interleaved string of A and B with Dynamic Programming

I'm having a problem with a question on dynamic programming. Given two strings A and B find the shortest interleaved string of the two. For example for A = "APPLE", B = "ABSOLUTE" The shortest answer will be "ABPPSOLUTE" Instead answer my function…
2
votes
1 answer

Determine if a sequence is an interleaving of a repetition of two strings

I have this task: Let x be a string over some finite and fixed alphabet (think English alphabet). Given an integer k we use x^k to denote the string obtained by concatenating k copies of x. If x is the string HELLO then x^3 is the string…
DropDropped
  • 1,253
  • 1
  • 22
  • 50
1
vote
3 answers

Push static element between every original element of an array

I have a an array like so: $fruit = array('Apple', 'Orange', 'Banana'); I would like to combine the array with a separator similar to implode but without converting the result to a string. So instead of implode('.', $fruit); //…
Ood
  • 1,445
  • 4
  • 23
  • 43
1
vote
0 answers

Tensorflow tf.data.Dataset interleave() returns Unexpected result

I was following some another example from this link which is about the tf.data.Dataset.interleave() method. import tensorflow as tf import tensorflow.keras as keras def do_range(i): for j in tf.range(i): yield j ds =…
HyeonPhil Youn
  • 428
  • 4
  • 11
1
vote
0 answers

Efficient loading of packed 16 bit data using AVX2

I'm doing interpolation on data returned by a A/D in the form of sequential 12 bit samples packed in 16 bit values A1B1A2B2... My c program works but I'd like to make it faster using AVX2 (remaining Rocketlake and Skylake compatible). My…
user1850479
  • 225
  • 2
  • 12
1
vote
2 answers

How create combined file from two text files in powershell?

How can I create file with combined lines from two different text files and create new file like this one: First line from text file A First line from text file B Second line from text file A Second line from text file B ...
1
vote
2 answers

Interleave/interweave Dask Arrays lazily

I need to frame-by-frame interleave two large HDF5 datasets representing video frames from two channels of a microscopic measurement. I thought Dask would be appropriate for this job and the downstream processes. The two arrays have the same shape…
msg
  • 187
  • 1
  • 13
1
vote
1 answer

Interleave 2 Dataframes on certain columns

I have 2 dataframes df1: StartLocation,StartDevice,StartPort,EndLocation,EndDevice,EndPort,LinkType,Speed…
Mors
  • 71
  • 5
1
vote
1 answer

Kotlin: Merge Multiple Lists then ordering Interleaved merge list

I have class CatalogProduct(id: String, name: String) to declare a product I have two list below: val newestCatalogProductList = mutableListOf() newestCatalogProductList.add(CatalogProduct("A1",…
1
vote
2 answers

Interleave 2 32-bit integers into 64 integer

So I was given the task of interleaving two 32-bit integer into one, like this: a_31,...,a_0 and b_31,...,b_0, return the 64-bit long that contains their bits interleaved: a_31,b_31,a_30,b_30,...,a_0,b_0. I tried doing it by taking the MSB from…
Rika
  • 75
  • 3