frequency-correlation value

- add function to estimate the frequency-correlation value
- fix some small bugs
I think it is more or less the same, I would suggest we stick to one method and use it throughout the code. So, rfind?