def set_scale(self):
f_min = float(self.lower_freq)<EOL>f_max = float(self.higher_freq)<EOL>y_min = f_min<EOL>y_max = f_max<EOL>for y in range(self.image_height):<EOL><INDENT>freq = y_min + y / (self.image_height - <NUM_LIT:1.0>) * (y_max - y_min)<EOL>fft_bin = freq / f_max * (self.fft_size / <NUM_LIT:2> + <NUM_LIT:1>)<EOL>if fft_bin < self.fft_size / <NUM_LIT:2>:<EOL><INDENT>alpha = fft_bin - int(fft_bin)<EOL>self.y_to_bin.append((int(fft_bin), alpha * <NUM_LIT:255>))<EOL><DEDENT><DEDENT>
generate the lookup which translates y-coordinate to fft-bin