From 010335a3945fc2ea27341e18fc66d25474d74a8c Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Mon, 10 May 2021 12:26:00 +0200 Subject: [PATCH] add changes from jupyter server --- .../1-fourier_transform.ipynb | 24 +++++++++++++------ .../2-filter_basics.ipynb | 24 +++++++++++++++---- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/02-FFT_and_Basic_Filtering/1-fourier_transform.ipynb b/02-FFT_and_Basic_Filtering/1-fourier_transform.ipynb index 8183d40..833e874 100644 --- a/02-FFT_and_Basic_Filtering/1-fourier_transform.ipynb +++ b/02-FFT_and_Basic_Filtering/1-fourier_transform.ipynb @@ -238,7 +238,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "scrolled": false, "slideshow": { "slide_type": "fragment" } @@ -429,15 +428,26 @@ "# reconstruct signal\n", "g = np.ones_like(t_) * a0\n", "for k, (ak, bk) in enumerate(zip(a, b)):\n", - " g += ak * np.sin(bk*t_)\n", - "\n", - "# plotting\n", + " g += ak * np.sin(bk*t_)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "# Cell 7b: plotting\n", "plt.plot(t_, square, 'r', label='original signal') \n", "plt.plot(t_, g, 'g', label='Reihenentwicklung')\n", "plt.ticklabel_format(axis='y', style='sci', scilimits=(-1,1))\n", "plt.xlabel('time [sec]')\n", "plt.ylabel('amplitude')\n", - "#plt.ylim(-1.1,1.1)\n", + "#plt.ylim(0.9,1.1)\n", "plt.legend()\n", "plt.show()" ] @@ -494,14 +504,14 @@ "cell_type": "code", "execution_count": null, "metadata": { - "scrolled": true, + "scrolled": false, "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ - "#plotting\n", + "#Cell 8b: plotting\n", "plt.subplot(311)\n", "plt.title('Time Domain')\n", "plt.plot(t, square, linewidth=1)\n", diff --git a/02-FFT_and_Basic_Filtering/2-filter_basics.ipynb b/02-FFT_and_Basic_Filtering/2-filter_basics.ipynb index 1850435..79b7a74 100644 --- a/02-FFT_and_Basic_Filtering/2-filter_basics.ipynb +++ b/02-FFT_and_Basic_Filtering/2-filter_basics.ipynb @@ -12,7 +12,7 @@ "
\n", "
\n", "
Signal Processing
\n", - "
Filtering Basics
\n", + "
Filtering Basics - Solution
\n", "
\n", "
\n", "\n", @@ -157,6 +157,7 @@ }, "outputs": [], "source": [ + "# Cell 1b: print stats\n", "print(st[0].stats)" ] }, @@ -206,7 +207,7 @@ }, "outputs": [], "source": [ - "# filtered traces\n", + "# Cell 2b: filtered traces\n", "stHP = st.copy()\n", "stHP.filter('highpass', freq=f0, corners=corners, zerophase=True)\n", "stLP = st.copy()\n", @@ -229,13 +230,15 @@ "execution_count": null, "metadata": { "slideshow": { + "rise": { + "scroll": true + }, "slide_type": "subslide" } }, "outputs": [], "source": [ - "# ---------------------------------------------------------------\n", - "# plot\n", + "# Cell 2c - plot\n", "plt.rcParams['figure.figsize'] = 17, 17\n", "tx1 = 3000\n", "tx2 = 8000\n", @@ -392,7 +395,7 @@ }, "outputs": [], "source": [ - "# plot - comment single lines to better see the remaining ones\n", + "# Cell 3b: plot - comment single lines to better see the remaining ones\n", "plt.rcParams['figure.figsize'] = 15, 4\n", "plt.plot(t, tr.data, 'k', label='original', linewidth=1.)\n", "plt.plot(t, tr_filt.data, 'b', label='causal, n=2', linewidth=1.2)\n", @@ -491,6 +494,7 @@ }, "outputs": [], "source": [ + "# Cell 5b: plot\n", "plt.rcParams['figure.figsize'] = 17, 21\n", "fig = plt.figure()\n", "ax1 = fig.add_subplot(7,1,1)\n", @@ -574,6 +578,13 @@ "\n", "6) There is no clear S-wave visible. Also in the horizontal components (channel 0 and 1) almost no S-wave energy is visible. This is a clear hint for an explosive type of event. Indeed, this is the recording of a nuclear test explosion. The recording with exactly these bandpass filters was used as cover figure for the book 'Quantitative Seismology' by Keiiti Aki and Paul G. Richards, 2nd edition." ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -594,6 +605,9 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.6" + }, + "rise": { + "scroll": true } }, "nbformat": 4,