Add function to populate freq <-> index mapping