danstowell@0: danstowell@0: # Configuration options that you might like to change danstowell@0: danstowell@0: example_is_audio = True # if False, generates simple sparse data for probing; else loads an audio file danstowell@0: examplegram_startindex = 550 # just choosing which bit to plot danstowell@0: danstowell@0: #examplewavpath = "~/birdsong/linhart2015mar/concatall/perfolder/PC1101-rep-day2.wav" danstowell@0: examplewavpath = "509.WAV" danstowell@0: examplewavpath = "renneschiffchaff20130320bout1filt.wav" danstowell@0: danstowell@0: srate = 22050. danstowell@0: wavdownsample = 2 # eg 44 kHz audio, factor of 2, gets loaded as 22 kHz. for no downsampling, set this ratio to 1 danstowell@0: danstowell@0: audioframe_len = 128 danstowell@0: audioframe_stride = 64 danstowell@0: danstowell@0: specbinlow = 10 danstowell@0: specbinnum = 32 danstowell@0: danstowell@0: featframe_len = 9 danstowell@0: featframe_stride = 16 danstowell@0: numfilters = 6 danstowell@0: minibatchsize = 16 danstowell@0: numtimebins = 160 # 128 # 48 # NOTE that this size needs really to be compatible with downsampling (maxpooling) steps if you use them. danstowell@0: danstowell@0: danstowell@0: ########################################################### danstowell@0: # Below, we calculate some other things based on the config danstowell@0: danstowell@0: import os danstowell@0: examplewavpath = os.path.expanduser(examplewavpath) danstowell@0: danstowell@0: danstowell@0: hopsize_secs = audioframe_stride / float(srate) danstowell@0: print("Specgram frame hop size: %.3g ms" % (hopsize_secs * 1000)) danstowell@0: specgramlen_secs = hopsize_secs * numtimebins danstowell@0: print("Specgram duration: %.3g s" % specgramlen_secs) danstowell@0: