forked from TorchDSP/torchsig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
155 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ff639336-c092-4882-b08e-78f8b82f741e", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"## Tutorial Notebook Example\n", | ||
"\n", | ||
"last updated: 2023-07-23\n", | ||
"\n", | ||
"This is a test notebook to show how we can include examples and tutorials as non-executed jupyter notebooks that get built during our documentation building on readthedocs. This way, we can still include code and code output to show the capabilities of TorchSig.\n", | ||
"\n", | ||
"This is just a template for how to do this and should be replaced :)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "d2d7597b-7f82-4493-b3b1-d4ef7b9c24b8", | ||
"metadata": {}, | ||
"source": [ | ||
"### Generate Complex Sinusoid Example Data\n", | ||
"\n", | ||
"TODO: Explain steps in tutorial in more detail" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "7888b4a8-0b66-4d29-bf40-6bce2b83a288", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import matplotlib.pyplot as plt\n", | ||
"import numpy as np\n", | ||
"\n", | ||
"num_samples = 4096\n", | ||
"x = np.exp(2j * np.pi * 2.0 / num_samples * np.arange(num_samples))\n", | ||
"\n", | ||
"plt.figure()\n", | ||
"plt.plot(x.real, c='b')\n", | ||
"plt.plot(x.imag, c='r')\n", | ||
"plt.title('Test plot')\n", | ||
"plt.xlabel('samples')\n", | ||
"plt.ylabel('amplitude')\n", | ||
"plt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "2e3151e0-813b-4c07-bc86-72c72f92f6ee", | ||
"metadata": {}, | ||
"source": [ | ||
"### Apply TorchSig Transform\n", | ||
"\n", | ||
"TODO: Explain steps in tutorial in more detail" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "462b7078-f064-4a2b-ba18-8c8b320e35ef", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from torchsig.transforms import AddNoise\n", | ||
"\n", | ||
"t = AddNoise(noise_power_db=-20)\n", | ||
"\n", | ||
"y = t(x)\n", | ||
"\n", | ||
"plt.figure()\n", | ||
"plt.plot(y.real, c='b')\n", | ||
"plt.plot(y.imag, c='r')\n", | ||
"plt.title('Test plot')\n", | ||
"plt.xlabel('samples')\n", | ||
"plt.ylabel('amplitude')\n", | ||
"plt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b2166e37-6a60-4088-9c60-d2bb62d7834b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,7 @@ numba | |
recommonmark>=0.7.1 | ||
six | ||
sphinx-rtd-theme>=0.4.3 | ||
Sphinx>=3.4.3 | ||
Sphinx>=3.4.3 | ||
nbsphinx | ||
ipykernel | ||
pypandoc |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ TorchSig | |
transforms | ||
models | ||
utils | ||
TutorialNotebookExample | ||
|
||
.. automodule:: torchsig | ||
:members: | ||
|
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