|
|
|
@@ -70,6 +70,7 @@
|
|
|
|
|
"\n",
|
|
|
|
|
"# Low-Level ANR Algorithmmus (wie in C)\n",
|
|
|
|
|
"def anr_function_c(input, ref_noise, coefficients, mu, adaption_step = 1):\n",
|
|
|
|
|
" counter = 0\n",
|
|
|
|
|
" sample_count = len(input)\n",
|
|
|
|
|
" filter_line = np.zeros(coefficients)\n",
|
|
|
|
|
" sample_line = np.zeros(coefficients)\n",
|
|
|
|
@@ -88,11 +89,15 @@
|
|
|
|
|
" output[n] = error\n",
|
|
|
|
|
" # update_filter_coeffcients: Filterkoeffizienten adaptieren\n",
|
|
|
|
|
" if (n % adaption_step) == 0: # bei Rate x/adatpion_step: if (n % adaption_step) < x:\n",
|
|
|
|
|
" #if abs(error) > 0.00: # nur adaptieren wenn Fehler über Schwellwert\n",
|
|
|
|
|
" counter += 1\n",
|
|
|
|
|
" filter_line += mu * error * sample_line\n",
|
|
|
|
|
" # Filterkoeffizienten expoertieren\n",
|
|
|
|
|
" coeffient_matrix[n, :] = filter_line\n",
|
|
|
|
|
" print(f\"Anpassungen: {counter}\")\n",
|
|
|
|
|
" return output, coeffient_matrix\n",
|
|
|
|
|
" \n",
|
|
|
|
|
"\n",
|
|
|
|
|
"\n"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
@@ -642,7 +647,7 @@
|
|
|
|
|
"])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Punktweiser Mittelwert\n",
|
|
|
|
|
"mean_curve = np.mean(all_curves, axis=0)\n",
|
|
|
|
|
"mean_gain = np.mean(all_curves, axis=0)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Plot\n",
|
|
|
|
|
"plt.figure(figsize=(15, 7))\n",
|
|
|
|
@@ -651,7 +656,7 @@
|
|
|
|
|
"plt.plot(x, male_scratching, linestyle='-.', linewidth=1.5, alpha=0.7, label='Scratching Noise')\n",
|
|
|
|
|
"plt.plot(x, male_drinking, linestyle=':', linewidth=1.5, alpha=0.7, label='Drinking Noise')\n",
|
|
|
|
|
"plt.plot(x, male_coughing, linestyle=(0, (3, 1, 1, 1)), linewidth=1.5, alpha=0.7, label='Coughing Noise')\n",
|
|
|
|
|
"plt.plot(x, mean_curve, linestyle='--', color='red', linewidth=2.5, label='Mean SNR-Gain')\n",
|
|
|
|
|
"plt.plot(x, mean_gain, linestyle='--', color='red', linewidth=2.5, label='Mean SNR-Gain')\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"plt.rcParams.update({\n",
|
|
|
|
|
" \"text.usetex\": True,\n",
|
|
|
|
@@ -946,7 +951,7 @@
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"# Reduced Update Plot\n",
|
|
|
|
|
"#Single Reduced Update Plot\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"import matplotlib.ticker as mtick\n",
|
|
|
|
|
"from scipy.interpolate import make_interp_spline\n",
|
|
|
|
@@ -954,7 +959,7 @@
|
|
|
|
|
"PLOT = False\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Daten aus .csv laden\n",
|
|
|
|
|
"data_reduced_update = np.loadtxt('reduced_update.txt', delimiter=\",\")\n",
|
|
|
|
|
"data_reduced_update = np.loadtxt('reduced_update.txt', delimiter=\",\", skiprows=1)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Daten laden\n",
|
|
|
|
|
"x = data_reduced_update[:, 0]\n",
|
|
|
|
@@ -986,7 +991,7 @@
|
|
|
|
|
"plt.figure(figsize=(15, 7))\n",
|
|
|
|
|
"plt.plot(x_smooth, gain_smooth, linestyle='--', color='indianred', linewidth=2, alpha=0.9, label='SNR-Gain')\n",
|
|
|
|
|
"plt.plot(x_smooth, cycles_smooth, linestyle='-.', color='skyblue', linewidth=2, alpha=0.9, label='Cycles/Sample')\n",
|
|
|
|
|
"plt.plot(x_smooth, comp_smooth, linestyle=':', color='forestgreen', linewidth=2, alpha=0.9, label='DSP Computing')\n",
|
|
|
|
|
"plt.plot(x_smooth, comp_smooth, linestyle=':', color='forestgreen', linewidth=2, alpha=0.9, label='DSP Load')\n",
|
|
|
|
|
"plt.plot([x_max, x_max], [y1_max, y2_max], color='black', linestyle=':', linewidth=2)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"plt.scatter(x, reduced_gain, color='indianred', s=40)\n",
|
|
|
|
@@ -1023,6 +1028,265 @@
|
|
|
|
|
" plt.savefig(f'plots/fig_snr_reduced_update', dpi=600)\n",
|
|
|
|
|
"plt.show()\n"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"#Single Error Threshold Plot\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"import matplotlib.ticker as mtick\n",
|
|
|
|
|
"from scipy.interpolate import make_interp_spline\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"PLOT = False\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Daten aus .csv laden\n",
|
|
|
|
|
"data_error_threshold = np.loadtxt('threshold_evaluation/error_threshold_breathing.csv', delimiter=\";\", skiprows=1)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Daten laden\n",
|
|
|
|
|
"x = data_error_threshold[:, 0]\n",
|
|
|
|
|
"error_gain = data_error_threshold[:, 2]\n",
|
|
|
|
|
"error_cycles = data_error_threshold[:, 6]\n",
|
|
|
|
|
"error_computing = data_error_threshold[:, 7]\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Sortieren\n",
|
|
|
|
|
"idx = np.argsort(x)\n",
|
|
|
|
|
"x = x[idx]\n",
|
|
|
|
|
"error_gain = error_gain[idx]\n",
|
|
|
|
|
"error_cycles = error_cycles[idx]\n",
|
|
|
|
|
"error_computing = error_computing[idx]\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Smoothing\n",
|
|
|
|
|
"x_smooth = np.linspace(x.min(), x.max(), 300)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"gain_smooth = make_interp_spline(x, error_gain)(x_smooth)\n",
|
|
|
|
|
"cycles_smooth = make_interp_spline(x, error_cycles)(x_smooth)\n",
|
|
|
|
|
"comp_smooth = make_interp_spline(x, error_computing)(x_smooth)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"diff_smooth = np.abs(gain_smooth - cycles_smooth)\n",
|
|
|
|
|
"idx_max = np.argmax(diff_smooth)\n",
|
|
|
|
|
"x_max = x_smooth[idx_max]\n",
|
|
|
|
|
"y1_max = gain_smooth[idx_max]\n",
|
|
|
|
|
"y2_max = cycles_smooth[idx_max]\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Plot\n",
|
|
|
|
|
"plt.figure(figsize=(15, 7))\n",
|
|
|
|
|
"plt.plot(x_smooth, gain_smooth, linestyle='--', color='indianred', linewidth=2, alpha=0.9, label='SNR-Gain')\n",
|
|
|
|
|
"plt.plot(x_smooth, cycles_smooth, linestyle='-.', color='skyblue', linewidth=2, alpha=0.9, label='Cycles/Sample')\n",
|
|
|
|
|
"plt.plot(x_smooth, comp_smooth, linestyle=':', color='forestgreen', linewidth=2, alpha=0.9, label='DSP Load')\n",
|
|
|
|
|
"plt.plot([x_max, x_max], [y1_max, y2_max], color='black', linestyle=':', linewidth=2)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"plt.scatter(x, error_gain, color='indianred', s=40)\n",
|
|
|
|
|
"plt.scatter(x, error_cycles, color='skyblue', s=40)\n",
|
|
|
|
|
"plt.scatter(x, error_computing, color='forestgreen', s=40)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"plt.text(x_max, (y1_max + y2_max)/2+0.21,\n",
|
|
|
|
|
" f'Maximum Offset at {x_max:.2f}',\n",
|
|
|
|
|
" fontsize=20,\n",
|
|
|
|
|
" ha='left')\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"plt.rcParams.update({\n",
|
|
|
|
|
" \"text.usetex\": True,\n",
|
|
|
|
|
" \"font.family\": \"serif\",\n",
|
|
|
|
|
" 'font.size': 16, # Standardtext\n",
|
|
|
|
|
" 'axes.labelsize': 30, # Achsenbeschriftungen\n",
|
|
|
|
|
" 'xtick.labelsize': 25, # Tick-Beschriftungen\n",
|
|
|
|
|
" 'ytick.labelsize': 25,\n",
|
|
|
|
|
" 'legend.fontsize': 25 # Legende\n",
|
|
|
|
|
"})\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"plt.xlabel(\"Error Threshold\")\n",
|
|
|
|
|
"plt.ylabel(\"Relative Performance\")\n",
|
|
|
|
|
"plt.grid(True, linestyle='-.', alpha=0.4)\n",
|
|
|
|
|
"#Spines auf ganzen Plot anwenden\n",
|
|
|
|
|
"plt.gca().yaxis.set_major_formatter(mtick.PercentFormatter(1.0))\n",
|
|
|
|
|
"plt.gca().spines['top'].set_visible(False)\n",
|
|
|
|
|
"plt.gca().spines['right'].set_visible(False)\n",
|
|
|
|
|
"#plt.gca().invert_xaxis()\n",
|
|
|
|
|
"plt.legend(frameon=False, loc='upper right')\n",
|
|
|
|
|
"plt.tight_layout()\n",
|
|
|
|
|
"if PLOT == True:\n",
|
|
|
|
|
" plt.savefig(f'plots/fig_snr_error_threshold', dpi=600)\n",
|
|
|
|
|
"plt.show()\n"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"#Multi Error Threshold Plot\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"import matplotlib.ticker as mtick\n",
|
|
|
|
|
"from scipy.interpolate import make_interp_spline\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"PLOT = False\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Daten aus .csv laden\n",
|
|
|
|
|
"error_threshold_breathing = np.loadtxt('threshold_evaluation/error_threshold_breathing.csv', delimiter=\";\", skiprows=1)\n",
|
|
|
|
|
"error_threshold_chewing = np.loadtxt('threshold_evaluation/error_threshold_chewing.csv', delimiter=\";\", skiprows=1)\n",
|
|
|
|
|
"error_threshold_coughing = np.loadtxt('threshold_evaluation/error_threshold_coughing.csv', delimiter=\";\", skiprows=1)\n",
|
|
|
|
|
"error_threshold_drinking = np.loadtxt('threshold_evaluation/error_threshold_drinking.csv', delimiter=\";\", skiprows=1)\n",
|
|
|
|
|
"error_threshold_scratching = np.loadtxt('threshold_evaluation/error_threshold_scratching.csv', delimiter=\";\", skiprows=1)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Daten laden\n",
|
|
|
|
|
"x = error_threshold_breathing[:, 0]\n",
|
|
|
|
|
"error_gain_breathing = error_threshold_breathing[:, 2]\n",
|
|
|
|
|
"error_cycles_breathing = error_threshold_breathing[:, 6]\n",
|
|
|
|
|
"error_computing_breathing = error_threshold_breathing[:, 7]\n",
|
|
|
|
|
"error_gain_chewing = error_threshold_chewing[:, 2]\n",
|
|
|
|
|
"error_cycles_chewing = error_threshold_chewing[:, 6]\n",
|
|
|
|
|
"error_computing_chewing = error_threshold_chewing[:, 7]\n",
|
|
|
|
|
"error_gain_coughing = error_threshold_coughing[:, 2]\n",
|
|
|
|
|
"error_cycles_coughing = error_threshold_coughing[:, 6]\n",
|
|
|
|
|
"error_computing_coughing = error_threshold_coughing[:, 7]\n",
|
|
|
|
|
"error_gain_drinking = error_threshold_drinking[:, 2]\n",
|
|
|
|
|
"error_cycles_drinking = error_threshold_drinking[:, 6]\n",
|
|
|
|
|
"error_computing_drinking = error_threshold_drinking[:, 7]\n",
|
|
|
|
|
"error_gain_scratching = error_threshold_scratching[:, 2]\n",
|
|
|
|
|
"error_cycles_scratching = error_threshold_scratching[:, 6] \n",
|
|
|
|
|
"error_computing_scratching = error_threshold_scratching[:, 7] \n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Sortieren\n",
|
|
|
|
|
"idx = np.argsort(x)\n",
|
|
|
|
|
"x = x[idx]\n",
|
|
|
|
|
"error_gain_breathing = error_gain_breathing[idx]\n",
|
|
|
|
|
"error_cycles_breathing = error_cycles_breathing[idx]\n",
|
|
|
|
|
"error_computing_breathing = error_computing_breathing[idx]\n",
|
|
|
|
|
"error_gain_chewing = error_gain_chewing[idx]\n",
|
|
|
|
|
"error_cycles_chewing = error_cycles_chewing[idx]\n",
|
|
|
|
|
"error_computing_chewing = error_computing_chewing[idx]\n",
|
|
|
|
|
"error_gain_coughing = error_gain_coughing[idx]\n",
|
|
|
|
|
"error_cycles_coughing = error_cycles_coughing[idx]\n",
|
|
|
|
|
"error_computing_coughing = error_computing_coughing[idx]\n",
|
|
|
|
|
"error_gain_drinking = error_gain_drinking[idx]\n",
|
|
|
|
|
"error_cycles_drinking = error_cycles_drinking[idx]\n",
|
|
|
|
|
"error_computing_drinking = error_computing_drinking[idx]\n",
|
|
|
|
|
"error_gain_scratching = error_gain_scratching[idx]\n",
|
|
|
|
|
"error_cycles_scratching = error_cycles_scratching[idx]\n",
|
|
|
|
|
"error_computing_scratching = error_computing_scratching[idx]\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Smoothing\n",
|
|
|
|
|
"x_smooth = np.linspace(x.min(), x.max(), 300)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"gain_smooth_breathing = make_interp_spline(x, error_gain_breathing)(x_smooth)\n",
|
|
|
|
|
"cycles_smooth_breathing = make_interp_spline(x, error_cycles_breathing)(x_smooth)\n",
|
|
|
|
|
"computing_smooth_breathing = make_interp_spline(x, error_computing_breathing)(x_smooth)\n",
|
|
|
|
|
"gain_smooth_chewing = make_interp_spline(x, error_gain_chewing)(x_smooth)\n",
|
|
|
|
|
"cycles_smooth_chewing = make_interp_spline(x, error_cycles_chewing)(x_smooth)\n",
|
|
|
|
|
"computing_smooth_chewing = make_interp_spline(x, error_computing_chewing)(x_smooth)\n",
|
|
|
|
|
"gain_smooth_coughing = make_interp_spline(x, error_gain_coughing)(x_smooth)\n",
|
|
|
|
|
"cycles_smooth_coughing = make_interp_spline(x, error_cycles_coughing)(x_smooth)\n",
|
|
|
|
|
"computing_smooth_coughing = make_interp_spline(x, error_computing_coughing)(x_smooth)\n",
|
|
|
|
|
"gain_smooth_drinking = make_interp_spline(x, error_gain_drinking)(x_smooth)\n",
|
|
|
|
|
"cycles_smooth_drinking = make_interp_spline(x, error_cycles_drinking)(x_smooth)\n",
|
|
|
|
|
"computing_smooth_drinking = make_interp_spline(x, error_computing_drinking)(x_smooth)\n",
|
|
|
|
|
"gain_smooth_scratching = make_interp_spline(x, error_gain_scratching)(x_smooth)\n",
|
|
|
|
|
"cycles_smooth_scratching = make_interp_spline(x, error_cycles_scratching)(x_smooth)\n",
|
|
|
|
|
"computing_smooth_scratching = make_interp_spline(x, error_computing_scratching)(x_smooth)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"diff_smooth_breathing = gain_smooth_breathing - cycles_smooth_breathing\n",
|
|
|
|
|
"diff_smooth_chewing = gain_smooth_chewing - cycles_smooth_chewing\n",
|
|
|
|
|
"diff_smooth_coughing = gain_smooth_coughing - cycles_smooth_coughing\n",
|
|
|
|
|
"diff_smooth_drinking = gain_smooth_drinking - cycles_smooth_drinking\n",
|
|
|
|
|
"diff_smooth_scratching = gain_smooth_scratching - cycles_smooth_scratching\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Alle Kurven in ein Array stapeln\n",
|
|
|
|
|
"stack_difference = np.vstack([\n",
|
|
|
|
|
" diff_smooth_breathing,\n",
|
|
|
|
|
" diff_smooth_chewing,\n",
|
|
|
|
|
" diff_smooth_coughing,\n",
|
|
|
|
|
" diff_smooth_drinking,\n",
|
|
|
|
|
" diff_smooth_scratching\n",
|
|
|
|
|
"])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Alle Kurven in ein Array stapeln\n",
|
|
|
|
|
"stack_computing = np.vstack([\n",
|
|
|
|
|
" computing_smooth_breathing,\n",
|
|
|
|
|
" computing_smooth_chewing,\n",
|
|
|
|
|
" computing_smooth_coughing,\n",
|
|
|
|
|
" computing_smooth_drinking,\n",
|
|
|
|
|
" computing_smooth_scratching\n",
|
|
|
|
|
"])\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Punktweiser Mittelwert\n",
|
|
|
|
|
"mean_gain = np.mean(stack_difference, axis=0)\n",
|
|
|
|
|
"mean_computing = np.mean(stack_computing, axis=0) \n",
|
|
|
|
|
"\n",
|
|
|
|
|
"idx_max_gain = np.argmax(mean_gain)\n",
|
|
|
|
|
"x_max_gain = x_smooth[idx_max_gain]\n",
|
|
|
|
|
"y_max_gain = mean_gain[idx_max_gain]\n",
|
|
|
|
|
"x_max_computing = x_smooth[idx_max_gain]\n",
|
|
|
|
|
"y_max_computing = mean_computing[idx_max_gain]\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"# Plot\n",
|
|
|
|
|
"figure1, ax1 = plt.subplots(figsize=(15, 7))\n",
|
|
|
|
|
"ax1.plot(x_smooth, diff_smooth_breathing, linestyle='--', color='indianred', linewidth=1.5, alpha=0.7, label='Breathing Noise')\n",
|
|
|
|
|
"ax1.plot(x_smooth, diff_smooth_chewing, linestyle='-.', color='skyblue', linewidth=1.5, alpha=0.7, label='Chewing Noise')\n",
|
|
|
|
|
"ax1.plot(x_smooth, diff_smooth_coughing, linestyle=':', color='forestgreen', linewidth=1.5, alpha=0.7, label='Coughing Noise')\n",
|
|
|
|
|
"ax1.plot(x_smooth, diff_smooth_drinking, linestyle='--', color='darkorange', linewidth=1.5, alpha=0.7, label='Drinking Noise')\n",
|
|
|
|
|
"ax1.plot(x_smooth, diff_smooth_scratching, linestyle='-.', color='darkorchid', linewidth=1.5, alpha=0.7, label='Scratching Noise')\n",
|
|
|
|
|
"ax1.plot(x_smooth, mean_gain, linestyle='--', color='red', linewidth=2.5, alpha=1, label='Mean Performance Gain')\n",
|
|
|
|
|
"ax1.plot([x_max_gain, x_max_gain], [y_max_gain, 0], color='black', linestyle=':', linewidth=2)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"ax1.text(x_max_gain, y_max_gain+0.01,\n",
|
|
|
|
|
" f'{y_max_gain*100:.1f} \\% mean performance gain at error threshold {x_max_gain:.2f}',\n",
|
|
|
|
|
" fontsize=20,\n",
|
|
|
|
|
" ha='left')\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"figure2, ax2 = plt.subplots(figsize=(15, 7))\n",
|
|
|
|
|
"ax2.plot(x_smooth, computing_smooth_breathing, linestyle='--', color='indianred', linewidth=1.5, alpha=0.7, label='Breathing Noise')\n",
|
|
|
|
|
"ax2.plot(x_smooth, computing_smooth_chewing, linestyle='-.', color='skyblue', linewidth=1.5, alpha=0.7, label='Chewing Noise')\n",
|
|
|
|
|
"ax2.plot(x_smooth, computing_smooth_coughing, linestyle=':', color='forestgreen', linewidth=1.5, alpha=0.7, label='Coughing Noise')\n",
|
|
|
|
|
"ax2.plot(x_smooth, computing_smooth_drinking, linestyle='--', color='darkorange', linewidth=1.5, alpha=0.7, label='Drinking Noise')\n",
|
|
|
|
|
"ax2.plot(x_smooth, computing_smooth_scratching, linestyle='-.', color='darkorchid', linewidth=1.5, alpha=0.7, label='Scratching Noise')\n",
|
|
|
|
|
"ax2.plot(x_smooth, mean_computing, linestyle='--', color='blue', linewidth=2.5, alpha=1, label='Mean DSP Load')\n",
|
|
|
|
|
"ax2.plot([x_max_computing, x_max_computing], [y_max_computing, 0], color='black', linestyle=':', linewidth=2)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"ax2.text(x_max_computing, y_max_computing+0.01,\n",
|
|
|
|
|
" f'{y_max_computing*100:.1f} \\% mean DSP load at error threshold {x_max_computing:.2f}',\n",
|
|
|
|
|
" fontsize=20,\n",
|
|
|
|
|
" ha='left')\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"plt.rcParams.update({\n",
|
|
|
|
|
" \"text.usetex\": True,\n",
|
|
|
|
|
" \"font.family\": \"serif\",\n",
|
|
|
|
|
" 'font.size': 16, # Standardtext\n",
|
|
|
|
|
" 'axes.labelsize': 30, # Achsenbeschriftungen\n",
|
|
|
|
|
" 'xtick.labelsize': 25, # Tick-Beschriftungen\n",
|
|
|
|
|
" 'ytick.labelsize': 25,\n",
|
|
|
|
|
" 'legend.fontsize': 25 # Legende\n",
|
|
|
|
|
"})\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"ax1.set_xlabel(\"Error Threshold\")\n",
|
|
|
|
|
"ax2.set_xlabel(\"Error Threshold\")\n",
|
|
|
|
|
"ax1.set_ylabel(\"Performance Gain\")\n",
|
|
|
|
|
"ax2.set_ylabel(\"DSP Load\")\n",
|
|
|
|
|
"ax1.grid(True, linestyle='-.', alpha=0.4)\n",
|
|
|
|
|
"ax2.grid(True, linestyle='-.', alpha=0.4)\n",
|
|
|
|
|
"ax1.set_ylim(0, 1)\n",
|
|
|
|
|
"ax2.set_ylim(0, 0.5)\n",
|
|
|
|
|
"#Spines auf ganzen Plot anwenden\n",
|
|
|
|
|
"ax1.yaxis.set_major_formatter(mtick.PercentFormatter(1.0))\n",
|
|
|
|
|
"ax2.yaxis.set_major_formatter(mtick.PercentFormatter(1.0))\n",
|
|
|
|
|
"ax1.spines['top'].set_visible(False)\n",
|
|
|
|
|
"ax2.spines['top'].set_visible(False)\n",
|
|
|
|
|
"ax1.spines['right'].set_visible(False)\n",
|
|
|
|
|
"ax2.spines['right'].set_visible(False)\n",
|
|
|
|
|
"ax1.legend(frameon=False, loc='upper right')\n",
|
|
|
|
|
"ax2.legend(frameon=False, loc='upper right')\n",
|
|
|
|
|
"figure1.tight_layout()\n",
|
|
|
|
|
"figure2.tight_layout()\n",
|
|
|
|
|
"if PLOT == True:\n",
|
|
|
|
|
" figure1.savefig(f'plots/fig_snr_error_threshold', dpi=600)\n",
|
|
|
|
|
" figure2.savefig(f'plots/fig_snr_error_threshold_computing', dpi=600)\n",
|
|
|
|
|
"figure1.show()\n",
|
|
|
|
|
"figure2.show()\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"metadata": {
|
|
|
|
|