{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## 根据表4-4数据,画出无反馈和有反馈放大电路的幅频特性曲线(Y轴放大倍数Au,X轴频率f)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "# 设置matplotlib库的字体为SimHei,以支持中文显示\n", "plt.rcParams[\"font.sans-serif\"] = [\"SimHei\"]\n", "plt.rcParams[\"axes.unicode_minus\"] = False\n", "\n", "# 无反馈放大电路的数据\n", "no_feedback_data = {\n", " \"f\": [300, 545, 1000, 2000, 4000, 9170, 15000],\n", " \"Au\": [44.057, 84.719, 121.17, 121.172, 121.17, 84.239, 62.681],\n", "}\n", "\n", "# 有反馈放大电路的数据\n", "feedback_data = {\n", " \"f\": [200, 301, 500, 3200, 10000, 23600, 40000],\n", " \"Au\": [17.151, 32.831, 46.283, 46.283, 46.283, 32.698, 23.456],\n", "}\n", "\n", "# 创建数据框\n", "df_no_feedback = pd.DataFrame(no_feedback_data)\n", "df_feedback = pd.DataFrame(feedback_data)\n", "\n", "# 绘制幅频特性曲线\n", "plt.figure(figsize=(10, 6))\n", "plt.semilogx(df_no_feedback[\"f\"], df_no_feedback[\"Au\"], label=\"无反馈\")\n", "plt.semilogx(df_feedback[\"f\"], df_feedback[\"Au\"], label=\"有反馈\")\n", "plt.title(\"放大电路的幅频特性曲线\")\n", "plt.xlabel(\"频率 (f)\")\n", "plt.ylabel(\"放大倍数 (Au)\")\n", "plt.legend()\n", "plt.grid(True)\n", "plt.show()" ] } ], "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.12.3" } }, "nbformat": 4, "nbformat_minor": 2 }