From 4126b24844e9a05f46bf8a004e44d71b97a56ed2 Mon Sep 17 00:00:00 2001 From: David Westgate Date: Mon, 4 Nov 2024 17:47:41 -0800 Subject: [PATCH] obj 2 progress, notebook entry --- code/adaptive-tone-control/README.md | 25 +++++++++++++++++++++++++ code/adaptive-tone-control/main.py | 20 ++++++++++++++++++++ notebook.md | 7 +++++++ 3 files changed, 52 insertions(+) create mode 100644 code/adaptive-tone-control/README.md create mode 100644 code/adaptive-tone-control/main.py diff --git a/code/adaptive-tone-control/README.md b/code/adaptive-tone-control/README.md new file mode 100644 index 0000000..cc3b0a7 --- /dev/null +++ b/code/adaptive-tone-control/README.md @@ -0,0 +1,25 @@ +## Background +Included here is a simple python script to analyze and an manipulate an audio signal by working with individual frequency bands. By implementing this method of tone control (adjusting the amplitudes of different bands), we can improve percieve sound quality as an audio engineer would with a raw sound sample. + +## Setup +Potential libraries needed for debian-based gnu+linux +``` +sudo apt-get install libportaudio2 +``` +Install python libraries +``` +pip install -r requirnments.txt +``` + +## Run +``` +python3 main.py +``` + +## View Source +[main.py](./main.py) + + + +## Reflections, Results, Analysis +TODO \ No newline at end of file diff --git a/code/adaptive-tone-control/main.py b/code/adaptive-tone-control/main.py new file mode 100644 index 0000000..8751be6 --- /dev/null +++ b/code/adaptive-tone-control/main.py @@ -0,0 +1,20 @@ +import string +from scipy.io import wavfile as wav +import scipy.fft as fft +import numpy as np +import sounddevice as sd +import math +import scipy.signal as signal + +print("Portfolio Object 2: Adaptive Tone Control") +sample_rate, data = wav.read("song.wav") + +result = fft.fft(data) + +bands = { + "low": ( 0, 300 ), + "mid": ( 300, 2000 ), + "high": ( 2000,20000) +} + +print('WIP') \ No newline at end of file diff --git a/notebook.md b/notebook.md index 5100b52..5ba6e1e 100644 --- a/notebook.md +++ b/notebook.md @@ -1,3 +1,10 @@ +### Sunday 03-Nov-2024 + +🤔 Lectures this week continued coverage of audio filters, and introduced to us audio effects. By better understanding the theory and some technicaly challenges audio engineers face when working with signals at a given sample rate, frequency range, and variations of amplitude the role of filters becomes apparent. Audio effects were interesting and fun to play with in class, and I find myself somewhat trying to notice which effects were likely used in the music and podcasts I listen to. + +📝 Began work on [adaptive tone control](./code/adaptive-tone-control/README.md) portfolio object + + ### Sunday 27-Oct-2024 🤔 Lectures this week focused primarily on a review of the pre-recorded topics from the previous week, including seeing some examples of using fourier transforms between the frequency and time domain, seeing visual representations in audacity, and listening to examples of applied filters