     if not data[0]?
       return
 
+    # apply the gain
     for i in [0..(data[0].length-1)]
       data[0][i] *= @gain
-
     for i in [0..(data[1].length-1)]
       data[1][i] *= @gain
 
+    # update the spectrogram
     for i in [0..(SPECTROGRAM_LENGTH-1)]
       for j in [(NGRAMS-1)..1]
         @image[0][i*NGRAMS + j] = @image[0][i*NGRAMS + j - 1]

        start.push((i+0.05)*angle)
        end.push((i+0.95)*angle)
        fill_alpha.push(1-0.08*j)


    @hist_source.set('data', {
      inner_radius: inner, outer_radius: outer, start_angle: start, end_angle: end, fill_alpha: fill_alpha

      renderers: [glyph.ref()]
      axes: [xaxis.ref(), yaxis.ref()]
      tools: []
      width: @image_width
      height: @image_height
    )

    return plot_model
