Open ssfrr opened 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.
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.
My vote for frame-major. In my experience, reading a single channel chunk (many frames) of data for processing is a more common requirement.
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:
Vector
s as being vertical, which means that 1D SampleBufs and 1-channel 2D (Nx1) SampleBufs map onto each other. That said, I've always found that distinction to be a bit awkward anyways.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