Open maxim-zhao opened 5 years ago
I develop ovgenpy, a related program based around an advanced correlation-based trigger. The main algorithm is located at:
https://github.com/jimbo1qaz/ovgenpy/blob/master/ovgenpy/triggers.py#L154
It only uses autocorrelation to adjust windowing, not to prioritize jumping by multiples of the period. But I hope to use the period someday (prioritize jumping by even multiples of the period to avoid octave errors).
If you port this algorithm to sidwizplus, I may be able to retire ovgenpy (which has graphing performance issues and doesn't have a gui yet).
My issue is that my mathematical grasp is not great :) I've implemented a dumb brute force correlation algorithm with weighting to prefer central matches, but it is not working (presumably due to a bug in the implementation, I'm working through it now) and horribly slow. I've read some stuff about faster autocorrelation computation via FFT but not managed to get far with it due to not having the maths to back it up - my last foray into this kind of thing was about 15 years ago and that mostly consisted of using statistical software to do the heavy lifting.
I use numpy/scipy to do the fft correlation, I don't know how the fft works either ;)
To fix your trigger, you could use my unit tests (test_trigger and test_trigger_stride are good, and you can use my wave files too).
https://github.com/jimbo1qaz/ovgenpy/blob/master/tests/test_trigger.py#L39
I think there are some issues with the way I'm doing it - admittedly, I'm trying to start with the basics, which may explain the issues:
I suspect the answers to a lot of this lie in what you've one already,
From @maxim-zhao on October 18, 2018 6:6
Copied from original issue: maxim-zhao/SidWiz#2