{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "59938c83",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x2848a0aa1a0>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 418712 characters]",
      "text/plain": [
       "<Figure size 1500x1200 with 4 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "desired_signal = np.genfromtxt(\"./simulation_data/simple_desired_signal.txt\", dtype=int)/(2**(15)-1)\n",
    "corrupted_signal = np.genfromtxt(\"./simulation_data/simple_corrupted_signal.txt\", dtype=int)/(2**(15)-1)\n",
    "noise_signal = np.genfromtxt(\"./simulation_data/simple_noise_signal.txt\", dtype=int)/(2**(15)-1)\n",
    "output = np.genfromtxt(\"./filter_output/simple_output_simulated.txt\", dtype=int)/(2**(15)-1)\n",
    "t = np.linspace(0, len(corrupted_signal), len(corrupted_signal))\n",
    "\n",
    "# Schriftgrößen für LaTeX-Dokument\n",
    "plt.rcParams.update({\n",
    "    'font.size': 16,          # Standardtext\n",
    "    'axes.titlesize': 18,     # Titel\n",
    "    'axes.labelsize': 17,     # Achsenbeschriftungen\n",
    "    'xtick.labelsize': 15,    # Tick-Beschriftungen\n",
    "    'ytick.labelsize': 15,\n",
    "    'legend.fontsize': 15     # Legende\n",
    "})\n",
    "\n",
    "# Plots des Filterprozesses\n",
    "figure1, (ax0, ax1, ax2, ax3) = plt.subplots(4, 1, figsize=(15, 12), sharex=True, sharey=True)\n",
    "# ax0.set_ylim(-0.2, 0.2)\n",
    "ax0.plot(t, desired_signal, c='deepskyblue')\n",
    "ax1.plot(t, corrupted_signal, c='royalblue')\n",
    "ax2.plot(t, noise_signal, c='chocolate')\n",
    "ax3.plot(t, output, c='green')\n",
    "\n",
    "ax0.set_title('Desired signal')\n",
    "ax1.set_title('Corrupted signal')\n",
    "ax2.set_title('Reference noise signal')\n",
    "ax3.set_title('Filter output')\n",
    "\n",
    "ax3.set_xlabel('time(ms)')\n",
    "ax0.set_ylabel('Amplitude')\n",
    "ax1.set_ylabel('Amplitude')\n",
    "ax2.set_ylabel('Amplitude')\n",
    "ax3.set_ylabel('Amplitude')\n",
    "\n",
    "ax0.legend(['Desired signal'], loc='upper right')\n",
    "ax1.legend(['Corrupted signal'], loc='upper right')\n",
    "ax2.legend(['Reference noise signal'], loc='upper right')\n",
    "# ax3.legend([f'{coefficients} Coefficients, {step_size} Stepsize'], loc='upper right')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.10.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
