Attempt at refactoring cfrequency
Added test for non windowed cfrequency