Add function to calculate windows sizes based on frequency