1 May 2007 14:13
[Propose] ArrayedCollection:plot can accept array arguments to minval & maxval
Hi -
I often collect data into multichannel Buffers and then use
Buffer:plot to view them. However, if the ranges of the channels are
very different this isn't easy because the scaling is the same for
each channel (even with user-specified minval/maxval). Yes, I could
re-scale the values manually before writing to the Buffer. But that's
the wrong way to go about it when for example you want one channel to
be frequency values in Hertz, and one channel to be dB values.
It's a simple modification to allow "minval" and "maxval" to be
arrays, allowing the user to specify different ranges for each
channel. Modified version of GUI/PlusGUI/Math/SignalPlusGUI.sc
attached (also a patch; not sure which format people prefer in
general).
Example:
// 3-channel interlaced data
b = [{1.0.rand}.dup(50), {20.0.rand - 30}.dup(50),
{10.0.rand}.dup(50)].lace(150);
// Compare the results of these two - gives either common or separate rescaling
b.plot(numChannels:3, minval: nil, maxval: nil);
b.plot(numChannels:3, minval: [nil, nil, nil], maxval: [nil, nil, nil]);
Any thoughts on this? Would like to commit if acceptable.
Dan
(Continue reading)
RSS Feed