Extract max_raw_frequency function