Skip to content

Commit

Permalink
resolve toc workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Jul 26, 2024
1 parent b23e926 commit 62bc012
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 146 deletions.
2 changes: 1 addition & 1 deletion _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ parts:
- caption: Example Workflows
chapters:
- file: notebooks/example-workflows/jingle-bells
- file: notebooks/example-workflows/spy-sounds
- file: notebooks/example-workflows/spy-keypad
- file: notebooks/example-workflows/nino3
2 changes: 1 addition & 1 deletion notebooks/example-workflows/jingle-bells.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"images/ProjectPythia_Logo_Final-01-Blue.svg\" width=250 alt=\"Project Pythia Logo\"></img>"
"[IMAGE]"
]
},
{
Expand Down
81 changes: 24 additions & 57 deletions notebooks/example-workflows/nino3.ipynb

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions notebooks/example-workflows/spy-keypad.ipynb

Large diffs are not rendered by default.

83 changes: 12 additions & 71 deletions notebooks/wavelet-introduction/wavelet-basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@
"- **Time to learn**: 45 minutes"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Background\n",
"Time-series data refers to when data is collected over time, making the order of the data collection and not just the value important. For the purpose of an example, imagine a short piece of music. Each note in the piece can be any note from A to G. Each note varies based on frequency to produce different notes. A higher frequency is associated with a higher pitch, like an A note, while a lower frequency is associated with a lower pitch, like a C note.\n",
"\n",
"With tools like Fourier Transform, it will be obvious when a B and a D note appears in the piece of music. However, this does not encapulsate all the information. What is the order? BDDB is very different from DDDDBD. This is the importance of time and order in data that is lost in first passes of signal processing with tools like Fourier Transform. The power of wavelets is that it can return both information about the frequency and information about the time when the frequency occurred."
"| [Intro to Numpy]| Necessary | Familiarity with working with arrays |\n",
"| [Intro to SciPy] | Helpful | Familiarity with working with wave files and FFT |\n",
"\n",
"- **Time to learn**: 45 minutes"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -92,16 +78,6 @@
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [],
"source": [
"import pywt # PyWavelets\n",
"import numpy as np # working with arrays\n",
"import pandas as pd # working with dataframes\n",
"from scipy.io import wavfile # loading in wav files\n",
"import matplotlib.pyplot as plt # plot data (fourier transform and wav files)\n",
"from scipy.fftpack import fft, fftfreq # working with Fourier Transforms"
"execution_count": 2,
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -137,7 +113,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -150,7 +126,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -169,24 +145,6 @@
"print(f\"length of audio file = {len(signal_data)} time steps\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Convert .wav file to pandas dataframe"
"# Load .wav file data\n",
"sample_rate, signal_data = wavfile.read('jingle_bells.wav')\n",
"\n",
"# Frequency determines the chord\n",
"\n",
"duration = len(signal_data) / sample_rate\n",
"time = np.arange(0, duration, 1/sample_rate) \n",
"\n",
"print(f\"Sample Rate: {sample_rate}\")\n",
"print(f\"duration = {duration} seconds (is the ratio of sample rate and data = {len(signal_data)} / {sample_rate})\")\n",
"print(f\"length of audio file = {len(signal_data)} time steps\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -196,7 +154,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -263,7 +221,7 @@
"4 0.0004 -8540"
]
},
"execution_count": 36,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -282,7 +240,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand All @@ -308,7 +266,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -368,24 +326,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {},
"outputs": [],
"source": [
"fourier_transform = abs(fft(signal_data))\n",
"freqs = fftfreq(len(fourier_transform), (1/sample_rate))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Plot Frequency Prevalence from Fast Fourier Transform"
]
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -402,7 +343,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -434,7 +375,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -467,7 +408,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -508,7 +449,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -603,7 +544,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand Down

0 comments on commit 62bc012

Please sign in to comment.