This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lets build an audio dataset of random sinus chunks! | |
def sinus_dataset_generator(num_examples, fs, samples, frequency_range): | |
"""Builds a dataset of sinus. | |
Args: | |
num_examples: number of examples to generate (int) | |
fs: sample rate of the sinus | |
samples: number of samples to generate (int) | |
frequency_range: a list of two values defining [lower, upper] frequency range (int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AUDIO_CHUNK_SIZE = 1024 | |
RATE = 44100 | |
# build the model | |
kernel_size = (1,5) | |
input_audio = Input(shape=(1, AUDIO_CHUNK_SIZE, 1)) | |
net = Convolution2D(filters=64, kernel_size=kernel_size,activation='relu',padding='same')(input_audio) | |
net = AveragePooling2D((1,2))(net) | |
net = Convolution2D(filters=32, kernel_size=kernel_size,activation='relu',padding='same')(net) |
NewerOlder