RobinSchmidt / RS-MET

Codebase for RS-MET products (Robin Schmidt's Music Engineering Tools)
Other
56 stars 6 forks source link

ScopeScreenScanner fails for stereo signals that cancels itself out. #64

Open elanhickler opened 7 years ago

elanhickler commented 7 years ago

If you send it two opposing sinewaves stereo signal that cancels itself out (180 degrees out of phase) then you get silence and the scanner doesn't know what to do.

Should you think of a clever fix or should I add sync options: Sync L / Sync R / Sync Sum...

oh maybe you should have a switch within scopescanner for those options.

RobinSchmidt commented 7 years ago

yes, i have been leaving this to client code, what analysis signal to send into it. the class itself just accepts a mono signal for analysis. and then in both of our scopes, i feed it the sum of left and right. i think, for my class library, it's most flexible to leave this decision to client code. client code may want to use some kind of other "side-chain" signal, or a filtered input or whatever

RobinSchmidt commented 7 years ago

hmmm...not sure....maybe i could make a subclass that accepts stereo inputs and has a switch which channel to use (or even mix coefficients).

RobinSchmidt commented 7 years ago

just a random thought: might a nonlinear combination of the left and right channel signals be useful - such as the product? in case of a mono-signal, it would amount to squaring - with a little highpass, we'd still get the period (well, maybe multiplied by 2). in case of left = -right, it should work, too. ...well, really, as said - that's just a totally random idea...but might be worth to try

elanhickler commented 7 years ago

I don't know what would work, but in any case, it has to account for the signal going in and out of perfect phase or perfect cancellation. Otherwise just leave it alone and I'll put some options on PrettyScope for left/right/sum sync.

elanhickler commented 7 years ago

hmm, actually, MOTU oscilloscope is superior to your ScreenScanner in a few ways, more stable image and it can handle stereo signals in/out of phase, so there's room for improvement, but I don't want this to distract from the modulation system you're working on.

elanhickler commented 7 years ago

I don't know what MOTU oscilloscope is doing, but one thing it might be doing is seeing which signal is easier to get a lock on, or what signal has a lower frequency, or something.

It is also somehow ensuring that the position/phase of the signal remains in the same place visually. It finds the best possible match, so it will jump around a bit if the signal is unpredictable, but less than it would have otherwise. This is not always desirable though.

Ok, weird, so it seems to be locking onto the higher frequency signal, but only switches when the frequency has significantly changes between the two, so it's not just immediately whatever is higher or lower. It's probably a combination of what signal is higher frequency and cleaner. I think it would be better to lock onto the lower frequency signal when possible.