Adding loops over frequency