Re: Peak (multiple) frequency detection/measurement
Posted: Fri Mar 01, 2013 11:40 pm
tester wrote:(typically?) they are expression of 2^N
They absolutely have to be a power of two - the algorithm depends upon this factor. The other other information confirms mostly what I knew, though the overlap feature is somewhat more complex than I understand.
Anhow, some good news and some bad news...
Good News.
I have managed to get the FFT code working...
Comparing against the FFT primitive at low window sizes, confirm that all is working correctly.
Note that, in order to generate freq/phase plots, the inverse FFT doesn't work at the moment - that can easily be rectified once other matters are dealt with...
Bad News.
My worries about the Ruby processing are confirmed. I can get a 32,768 point FFT to work sometimes. But other times, and for larger sizes, the "excess processing" kicks in and freezes the Ruby primitive.
And a warning - be sure to click the 'calculate' trigger only once - if you click again while the Ruby is already running, FS can choke up, and you might have to close and re-open.
It is very likely that the upper limit will depend on available CPU power, so I would be interested to know some comparative tests using different computers - I have been testing on a 4yr old Q6700 machine, maybe a more modern 'i' processor will perform better.
I will also attempt some optimisations, as I think the current program may not be totally efficient...
1 - Sine and Cosine are put into a lookup table for greater speed. If all files are to be analysed with the same settings, there is no need to re-calculate this table every time - it could even be loaded from a file, possibly.
2 - Currently generates frequency and phase outputs. Phase may not be required for your analysis, in which case it could be removed, saving further trig functions.
If I can squeeze better performance out of it, I will let you know ASAP.