add changes from jupyter server

This commit is contained in:
Kasper D. Fischer 2021-05-10 12:26:00 +02:00
parent 856e5fbf7d
commit 010335a394
2 changed files with 36 additions and 12 deletions

View File

@ -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",

View File

@ -12,7 +12,7 @@
" <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n",
" <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n",
" <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">Signal Processing</div>\n",
" <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Filtering Basics</div>\n",
" <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Filtering Basics - Solution</div>\n",
" </div>\n",
" </div>\n",
"</div>\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,