Dust Analyzer (still "beta") [was: quickie signal analyzer proto]

VST, AU, AAX, CLAP, etc. Plugin Virtual Effects Discussion
Post Reply New Topic
RELATED
PRODUCTS

Post

Update 0.3.0:
  • some performance optimizations, cleanup
  • slight color adjustment (mostly obvious for curves on top of fill)
  • very basic scope-mode (sort of "virtual phoshor" type affair, auto-correlation tracking for really stable wave-form analysis)
  • probably some bug-fixes I forgot
The scope visual quality isn't that great, but I didn't want to spend too much CPU on it, and didn't feel like writing fancy GPU shaders either so..

Post

Since the "auto-correlation" (well, technically cross-correlation between snapshots) algorithm is so ridiculously simple (and cheap), yet effective, I thought I'd share how I do it, since many simple scopes seem to have trouble tracking wave-forms with high resonance filtering, etc...

So here's the algorithm:

1. Collect a fixed-length "snapshot" of sample data. It does not matter if it overlaps with the previous snapshot, and it doesn't matter how much it overlaps (if it does). It's perfectly acceptable to just pick "last N samples at the time of refresh" even if "refresh" is totally irregular. We'll find "best fit" either way. The snapshot needs to be a bit longer than what we're going to draw, so we can shift it around to match the previous frame, while keeping the boundaries hidden (twice as long works well).

2. We need to keep track of the "draw offset" (explained below) and previous snapshot FFT result.

3. When updating, first make a copy of the previous FFT result into a temporary buffer (or use two buffers and "ping pong"). Then FFT the new data (with windowing to weight the middle) into the "preserved" buffer (pack a second channel in imaginary component of complex FFT for stereo).

4. With the new transform, and previous transform in the temporary buffer, multiply all the bins of the previous transform with the complex conjugates of the current transform (ie do frequency domain correlation). Whatever weird shuffled FFT-order is fine, so (reversible) in-place algorithms without re-ordering are great.

5. Take IFFT of the temporary buffer, then search for the largest real component (the imaginary component isn't useful) that satisfies the constraint that when the buffer index (using "warp-around negative" for the second half) is added (well, subtracted actually if you implement it as above) to the previous frame's "draw offset" (which is saved), we can take snapshot data from that offset while staying inside buffer boundaries.

6. Once the best match is found, add it to the "draw offset" to get the new offset for drawing. The constraint avoids choosing offsets that would result in wrap-around while drawing. Leave the current snapshot's FFT into the buffer for next frame to match against.

It's obviously not "perfect" but it's certainly more predictable than typical frequency-weighted zero-crossing or similar approaches, and the total cost is: one FFT, one IFFT, one array pass of complex multiply and one linear search.

Post

Quick demonstration why correlation tracking is nice:


Apologizes Robin for using your plugin as the "failure case" example.. I certainly think it's great in general.

Post

so far i used Robin's scope for my stuff, and it did the job very nicely, very good to have the Freeze function
i only wish the colors were different, but oh well
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

next version coming also traditional "thin lines" mode for the scope.

Post

mystran wrote:The scope visual quality isn't that great, but I didn't want to spend too much CPU on it, and didn't feel like writing fancy GPU shaders either so..
dont worry, compared with other scope visuals it can stand for sure.

ps. thank you for another fast update.
Last edited by murnau on Sat Apr 27, 2013 8:42 pm, edited 2 times in total.
Whoever wants music instead of noise, joy instead of pleasure, soul instead of gold, creative work instead of business, passion instead of foolery, finds no home in this trivial world of ours.

Post

also coming in the next version: alternative scope "slave sync" tracking mode that uses regular tracking on left channel only, while the right channel is synced to the left channel.. so if you have similar signals (but frequencies not matching) you can still compare them easily. It doesn't quite visually align detuned waves yet (but it does stabilize them, just the detuning adds an offset), but working on that.. :)

Post

any chance to have a darker alternative background color like black?
Whoever wants music instead of noise, joy instead of pleasure, soul instead of gold, creative work instead of business, passion instead of foolery, finds no home in this trivial world of ours.

Post

murnau wrote:any chance to have a darker alternative background color like black?
For the spectrum? Yeah, I could add an option to invert the colors (that's how I draw it anyway).

Post

cool! :love:
Whoever wants music instead of noise, joy instead of pleasure, soul instead of gold, creative work instead of business, passion instead of foolery, finds no home in this trivial world of ours.

Post

Apparently the server hosting my website is experiencing some trouble, and apparently the provider is working to fix the situation.

Post

Since my site is still borken so can't post updated version, I'll post a teaser video of another in-development feature instead (sorry for the quality, youtube doesn't like small-size originals it seems):

Post

xy mode is teh bomb ;]
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

Urgh.. so I was profiling the thing to see why it was taking so much CPU.. and the very nice profiler called Very Sleepy (any developers reading this: be sure to install this thing immediately, it's great) reported various things, but among those the fact that apparently I had screwed up the part where I was supposed to tell OpenGL to forget vertical sync... so in general my new GUI-framework just got a ridiculous performance boost.

Also another silly framework bug fixed today (confirmation dialogs for "save/load defaults" in all recent plugins showed the plugin name as message box text, and the longer intended contents in title-bar).. so I guess tomorrow is "general updates" day.

Post

mystran wrote:Since the "auto-correlation" (well, technically cross-correlation between snapshots) algorithm is so ridiculously simple (and cheap), yet effective, I thought I'd share how I do it, since many simple scopes seem to have trouble tracking wave-forms with high resonance filtering, etc...

So here's the algorithm: [...]
do i get that right that - from a high level perspective - the algorithm effectively computes an offset that maximizes the cross-correlation between the buffer shown in the current frame and the buffer shown in the previous frame?

...or stated differently: finds the lag, for which the cross-correlation between previous and current buffer is at its maximum and shifts the current buffer by that amount?


as for the "true" frequencies of spectral peaks - this might be helpful:

https://ccrma.stanford.edu/~jos/sasp/Op ... ctrum.html
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post Reply

Return to “Effects”