JuliaAudio / SampledSignals.jl

Core types for regularly-sampled multichannel signals like Audio, RADAR and Software-Defined Radio
Other
75 stars 25 forks source link

channel-major vs frame-major? #59

Open ssfrr opened 4 years ago

ssfrr commented 4 years ago

Given that there are likely a number of breaking changes coming down the pike, this might be a good time to think about whether keeping each channel's data contiguous is the right design.

Pros of channel-major:

Pros of frame-major:

There are probably other pros and cons I'm not thinking of right now. I just wanted to mark this to see if anyone had thoughts, given that there's a bit of activity lately.

cc @mchitre @haberdashPI

haberdashPI commented 4 years ago

I am also currently using channel-major by default in SignalOperators, and am leaning towards moving to frame-major by default. I have almost identical reasons for it though, and no new insights to add here.

ssfrr commented 4 years ago

Thanks, it's nice to hear some confirmation.

Another consideration is that it's kind of nice that for the frame-major orientation the memory layout is the same between a Array and a Vector{NTuple}, which is another reasonable way to represent multichannel signals, and lets you iterate frames easily.

mchitre commented 4 years ago

My vote for frame-major. In my experience, reading a single channel chunk (many frames) of data for processing is a more common requirement.