Fixed f_freq to freq in generate_data()