<commit_before>Collections = require('base').Collections

all_palettes = require('../palettes/palettes').all_palettes
ColorMapper = require('../mappers/color/linear_color_mapper').LinearColorMapper

NUM_SAMPLES = 1024
SAMPLING_RATE = 44100
MAX_FREQ = SAMPLING_RATE / 2
FREQ_SAMPLES = NUM_SAMPLES / 8
SPECTROGRAM_LENGTH = 512

window.TIMESLICE = 40 # ms

BORDER = 50

NGRAMS = 1020

HIST_NUM_BINS = 16

FREQ_SLIDER_MAX = MAX_FREQ
FREQ_SLIDER_MIN = 0
FREQ_SLIDER_START = FREQ_SLIDER_MAX/2

GAIN_DEFAULT = 1
GAIN_MIN = 1
GAIN_MAX = 20

requestAnimationFrame = window.requestAnimationFrame || \
  window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||\
  window.msRequestAnimationFrame

class SpectrogramApp
  constructor: () ->

    @gain = GAIN_DEFAULT

    @paused = false

    @throttled_request_data = _.throttle((=> @request_data()), 40)

    @spec_plot = new SpectrogramPlot({
      width: NGRAMS, height: SPECTROGRAM_LENGTH/2, border: BORDER
    })

    @power_plot = new SimpleIndexPlot({
      x0: 0, x1: window.TIMESLICE, y0: -0.5, y1: 0.5, width: 550, height: 220, border: BORDER
    })

    @fft_plot = new SimpleIndexPlot({
      x0: FREQ_SLIDER_MIN, x1: FREQ_SLIDER_MAX, y0: -1, y1: 10, width: 550, height: 220, border: BORDER
    })<commit_msg>expand range for fft y axis<commit_after>Collections = require('base').Collections

all_palettes = require('../palettes/palettes').all_palettes
ColorMapper = require('../mappers/color/linear_color_mapper').LinearColorMapper

NUM_SAMPLES = 1024
SAMPLING_RATE = 44100
MAX_FREQ = SAMPLING_RATE / 2
FREQ_SAMPLES = NUM_SAMPLES / 8
SPECTROGRAM_LENGTH = 512

window.TIMESLICE = 40 # ms

BORDER = 50

NGRAMS = 1020

HIST_NUM_BINS = 16

FREQ_SLIDER_MAX = MAX_FREQ
FREQ_SLIDER_MIN = 0
FREQ_SLIDER_START = FREQ_SLIDER_MAX/2

GAIN_DEFAULT = 1
GAIN_MIN = 1
GAIN_MAX = 20

requestAnimationFrame = window.requestAnimationFrame || \
  window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||\
  window.msRequestAnimationFrame

class SpectrogramApp
  constructor: () ->

    @gain = GAIN_DEFAULT

    @paused = false

    @throttled_request_data = _.throttle((=> @request_data()), 40)

    @spec_plot = new SpectrogramPlot({
      width: NGRAMS, height: SPECTROGRAM_LENGTH/2, border: BORDER
    })

    @power_plot = new SimpleIndexPlot({
      x0: 0, x1: window.TIMESLICE, y0: -0.5, y1: 0.5, width: 550, height: 220, border: BORDER
    })

    @fft_plot = new SimpleIndexPlot({
      x0: FREQ_SLIDER_MIN, x1: FREQ_SLIDER_MAX, y0: -1, y1: 20, width: 550, height: 220, border: BORDER
    })
{'fraction_non_alphanumeric': 0.1092896174863388, 'fraction_numerical': 0.047619047619047616, 'mean_word_length': 4.273662551440329, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6807865', 'n_tokens_mistral': 1063, 'n_tokens_neox': 948, 'n_words': 201}