{"id":1150057,"date":"2025-01-13T16:57:09","date_gmt":"2025-01-13T08:57:09","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1150057.html"},"modified":"2025-01-13T16:57:12","modified_gmt":"2025-01-13T08:57:12","slug":"python%e5%a6%82%e4%bd%95%e7%94%bb%e6%96%b9%e6%b3%a2%e4%bf%a1%e5%8f%b7","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1150057.html","title":{"rendered":"python\u5982\u4f55\u753b\u65b9\u6ce2\u4fe1\u53f7"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25180636\/4d7ed029-557c-4087-8b5d-bba2b0e5376d.webp\" alt=\"python\u5982\u4f55\u753b\u65b9\u6ce2\u4fe1\u53f7\" \/><\/p>\n<p><p> \u8981\u5728Python\u4e2d\u753b\u51fa\u65b9\u6ce2\u4fe1\u53f7\uff0c\u53ef\u4ee5\u4f7f\u7528\u51e0\u4e2a\u5e38\u89c1\u7684\u5e93\uff0c\u6bd4\u5982NumPy\u548cMatplotlib\u3002<strong>\u9996\u5148\uff0c\u751f\u6210\u65b9\u6ce2\u4fe1\u53f7\u6570\u636e\u3001\u7136\u540e\u4f7f\u7528Matplotlib\u7ed8\u5236\u56fe\u5f62\u3001\u8c03\u6574\u56fe\u5f62\u7684\u5916\u89c2\u548c\u6837\u5f0f<\/strong>\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u5c06\u8be6\u7ec6\u63cf\u8ff0\u8fd9\u4e9b\u6b65\u9aa4\u4e2d\u7684\u4e00\u90e8\u5206\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u751f\u6210\u65b9\u6ce2\u4fe1\u53f7\u6570\u636e<\/h3>\n<\/p>\n<p><p>\u5728\u751f\u6210\u65b9\u6ce2\u4fe1\u53f7\u6570\u636e\u65f6\uff0cNumPy\u5e93\u63d0\u4f9b\u4e86\u975e\u5e38\u6709\u7528\u7684\u5de5\u5177\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528NumPy\u7684<code>signal.square<\/code>\u51fd\u6570\u6765\u751f\u6210\u65b9\u6ce2\u4fe1\u53f7\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>from scipy import signal<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u751f\u6210\u65f6\u95f4\u5e8f\u5217<\/strong><\/h2>\n<p>t = np.linspace(0, 1, 500)<\/p>\n<h2><strong>\u751f\u6210\u65b9\u6ce2\u4fe1\u53f7<\/strong><\/h2>\n<p>square_wave = signal.square(2 * np.pi * 5 * t)<\/p>\n<h2><strong>\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7<\/strong><\/h2>\n<p>plt.plot(t, square_wave)<\/p>\n<p>plt.title(&#39;Square Wave Signal&#39;)<\/p>\n<p>plt.xlabel(&#39;Time [s]&#39;)<\/p>\n<p>plt.ylabel(&#39;Amplitude&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u751f\u6210\u4e86\u4e00\u4e2a\u9891\u7387\u4e3a5 Hz\u7684\u65b9\u6ce2\u4fe1\u53f7\uff0c\u5e76\u5728\u65f6\u95f4\u533a\u95f40\u52301\u79d2\u5185\u8fdb\u884c\u4e86\u7ed8\u5236\u3002\u6211\u4eec\u4f7f\u7528Matplotlib\u5e93\u6765\u7ed8\u5236\u56fe\u5f62\uff0c\u5e76\u8bbe\u7f6e\u4e86\u56fe\u5f62\u7684\u6807\u9898\u3001X\u8f74\u548cY\u8f74\u6807\u7b7e\u4ee5\u53ca\u7f51\u683c\u7ebf\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u8c03\u6574\u56fe\u5f62\u7684\u5916\u89c2\u548c\u6837\u5f0f<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u4f7f\u56fe\u5f62\u66f4\u52a0\u7f8e\u89c2\u548c\u4e13\u4e1a\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c\u4e00\u4e9b\u8c03\u6574\uff0c\u4f8b\u5982\u8bbe\u7f6e\u7ebf\u6761\u989c\u8272\u3001\u6837\u5f0f\u3001\u56fe\u4f8b\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u8c03\u6574\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8c03\u6574\u7ebf\u6761\u6837\u5f0f\u548c\u989c\u8272<\/p>\n<p>plt.plot(t, square_wave, color=&#39;red&#39;, linestyle=&#39;--&#39;, linewidth=2)<\/p>\n<h2><strong>\u6dfb\u52a0\u56fe\u4f8b<\/strong><\/h2>\n<p>plt.legend([&#39;Square Wave&#39;])<\/p>\n<h2><strong>\u8c03\u6574\u5750\u6807\u8f74\u8303\u56f4<\/strong><\/h2>\n<p>plt.xlim(0, 1)<\/p>\n<p>plt.ylim(-1.5, 1.5)<\/p>\n<h2><strong>\u8c03\u6574\u7f51\u683c\u6837\u5f0f<\/strong><\/h2>\n<p>plt.grid(which=&#39;both&#39;, linestyle=&#39;--&#39;, linewidth=0.5)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u5c06\u7ebf\u6761\u989c\u8272\u8bbe\u7f6e\u4e3a\u7ea2\u8272\uff0c\u7ebf\u6761\u6837\u5f0f\u8bbe\u7f6e\u4e3a\u865a\u7ebf\uff0c\u5e76\u4e14\u589e\u52a0\u4e86\u56fe\u4f8b\u3002\u6211\u4eec\u8fd8\u8c03\u6574\u4e86\u5750\u6807\u8f74\u7684\u8303\u56f4\u548c\u7f51\u683c\u6837\u5f0f\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u5176\u4ed6\u5e93\u548c\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u4f7f\u7528NumPy\u548cMatplotlib\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6\u5e93\u548c\u65b9\u6cd5\u6765\u751f\u6210\u548c\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7\u3002\u4f8b\u5982\uff0cSciPy\u5e93\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u4fe1\u53f7\u751f\u6210\u548c\u5904\u7406\u51fd\u6570\uff0cPandas\u5e93\u53ef\u4ee5\u7528\u4e8e\u5904\u7406\u548c\u53ef\u89c6\u5316\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528SciPy\u5e93\u751f\u6210\u548c\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>from scipy import signal<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u751f\u6210\u65f6\u95f4\u5e8f\u5217<\/strong><\/h2>\n<p>t = np.linspace(0, 1, 500)<\/p>\n<h2><strong>\u751f\u6210\u65b9\u6ce2\u4fe1\u53f7<\/strong><\/h2>\n<p>square_wave = signal.square(2 * np.pi * 5 * t)<\/p>\n<h2><strong>\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7<\/strong><\/h2>\n<p>plt.plot(t, square_wave)<\/p>\n<p>plt.title(&#39;Square Wave Signal&#39;)<\/p>\n<p>plt.xlabel(&#39;Time [s]&#39;)<\/p>\n<p>plt.ylabel(&#39;Amplitude&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528SciPy\u5e93\u7684<code>signal.square<\/code>\u51fd\u6570\u751f\u6210\u65b9\u6ce2\u4fe1\u53f7\uff0c\u5e76\u4f7f\u7528Matplotlib\u5e93\u7ed8\u5236\u56fe\u5f62\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u7ed3\u5408\u4fe1\u53f7\u5904\u7406\u548c\u5206\u6790<\/h3>\n<\/p>\n<p><p>\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7\u53ea\u662f\u4fe1\u53f7\u5904\u7406\u548c\u5206\u6790\u7684\u4e00\u90e8\u5206\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5bf9\u4fe1\u53f7\u8fdb\u884c\u66f4\u591a\u7684\u5904\u7406\u548c\u5206\u6790\uff0c\u4f8b\u5982\u6ee4\u6ce2\u3001\u5085\u91cc\u53f6\u53d8\u6362\u3001\u9891\u8c31\u5206\u6790\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u6f14\u793a\u5982\u4f55\u5bf9\u65b9\u6ce2\u4fe1\u53f7\u8fdb\u884c\u5085\u91cc\u53f6\u53d8\u6362\u5e76\u7ed8\u5236\u9891\u8c31\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>from scipy import signal, fftpack<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u751f\u6210\u65f6\u95f4\u5e8f\u5217<\/strong><\/h2>\n<p>t = np.linspace(0, 1, 500)<\/p>\n<h2><strong>\u751f\u6210\u65b9\u6ce2\u4fe1\u53f7<\/strong><\/h2>\n<p>square_wave = signal.square(2 * np.pi * 5 * t)<\/p>\n<h2><strong>\u8fdb\u884c\u5085\u91cc\u53f6\u53d8\u6362<\/strong><\/h2>\n<p>fft_result = fftpack.fft(square_wave)<\/p>\n<p>frequencies = fftpack.fftfreq(len(t), t[1] - t[0])<\/p>\n<h2><strong>\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7<\/strong><\/h2>\n<p>plt.subplot(2, 1, 1)<\/p>\n<p>plt.plot(t, square_wave)<\/p>\n<p>plt.title(&#39;Square Wave Signal&#39;)<\/p>\n<p>plt.xlabel(&#39;Time [s]&#39;)<\/p>\n<p>plt.ylabel(&#39;Amplitude&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<h2><strong>\u7ed8\u5236\u9891\u8c31\u56fe<\/strong><\/h2>\n<p>plt.subplot(2, 1, 2)<\/p>\n<p>plt.plot(frequencies, np.abs(fft_result))<\/p>\n<p>plt.title(&#39;Frequency Spectrum&#39;)<\/p>\n<p>plt.xlabel(&#39;Frequency [Hz]&#39;)<\/p>\n<p>plt.ylabel(&#39;Amplitude&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.tight_layout()<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u751f\u6210\u4e86\u65b9\u6ce2\u4fe1\u53f7\uff0c\u7136\u540e\u4f7f\u7528SciPy\u5e93\u7684<code>fftpack.fft<\/code>\u51fd\u6570\u5bf9\u4fe1\u53f7\u8fdb\u884c\u5085\u91cc\u53f6\u53d8\u6362\uff0c\u5e76\u7ed8\u5236\u4e86\u9891\u8c31\u56fe\u3002\u6211\u4eec\u4f7f\u7528Matplotlib\u5e93\u7684<code>subplot<\/code>\u51fd\u6570\u5c06\u65b9\u6ce2\u4fe1\u53f7\u548c\u9891\u8c31\u56fe\u7ed8\u5236\u5728\u540c\u4e00\u4e2a\u56fe\u4e2d\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u65b9\u6ce2\u4fe1\u53f7<\/h3>\n<\/p>\n<p><p>\u65b9\u6ce2\u4fe1\u53f7\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u6709\u5f88\u591a\u7528\u9014\uff0c\u4f8b\u5982\u5728\u901a\u4fe1\u7cfb\u7edf\u4e2d\u4f5c\u4e3a\u8f7d\u6ce2\u4fe1\u53f7\u3001\u5728\u63a7\u5236\u7cfb\u7edf\u4e2d\u4f5c\u4e3a\u6fc0\u52b1\u4fe1\u53f7\u3001\u5728\u97f3\u9891\u5904\u7406\u548c\u5408\u6210\u4e2d\u4f5c\u4e3a\u57fa\u7840\u6ce2\u5f62\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5b9e\u9645\u5e94\u7528\u7684\u4f8b\u5b50\uff0c\u6f14\u793a\u5982\u4f55\u751f\u6210\u548c\u7ed8\u5236\u8c03\u5236\u540e\u7684\u65b9\u6ce2\u4fe1\u53f7\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>from scipy import signal<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u751f\u6210\u65f6\u95f4\u5e8f\u5217<\/strong><\/h2>\n<p>t = np.linspace(0, 1, 500)<\/p>\n<h2><strong>\u751f\u6210\u8f7d\u6ce2\u4fe1\u53f7<\/strong><\/h2>\n<p>carrier = np.sin(2 * np.pi * 10 * t)<\/p>\n<h2><strong>\u751f\u6210\u65b9\u6ce2\u8c03\u5236\u4fe1\u53f7<\/strong><\/h2>\n<p>modulation = signal.square(2 * np.pi * 2 * t)<\/p>\n<h2><strong>\u8c03\u5236\u8f7d\u6ce2\u4fe1\u53f7<\/strong><\/h2>\n<p>modulated_signal = carrier * modulation<\/p>\n<h2><strong>\u7ed8\u5236\u539f\u59cb\u8f7d\u6ce2\u4fe1\u53f7\u3001\u65b9\u6ce2\u8c03\u5236\u4fe1\u53f7\u548c\u8c03\u5236\u540e\u7684\u4fe1\u53f7<\/strong><\/h2>\n<p>plt.subplot(3, 1, 1)<\/p>\n<p>plt.plot(t, carrier)<\/p>\n<p>plt.title(&#39;Carrier Signal&#39;)<\/p>\n<p>plt.xlabel(&#39;Time [s]&#39;)<\/p>\n<p>plt.ylabel(&#39;Amplitude&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.subplot(3, 1, 2)<\/p>\n<p>plt.plot(t, modulation)<\/p>\n<p>plt.title(&#39;Square Wave Modulation Signal&#39;)<\/p>\n<p>plt.xlabel(&#39;Time [s]&#39;)<\/p>\n<p>plt.ylabel(&#39;Amplitude&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.subplot(3, 1, 3)<\/p>\n<p>plt.plot(t, modulated_signal)<\/p>\n<p>plt.title(&#39;Modulated Signal&#39;)<\/p>\n<p>plt.xlabel(&#39;Time [s]&#39;)<\/p>\n<p>plt.ylabel(&#39;Amplitude&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.tight_layout()<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u751f\u6210\u4e86\u4e00\u4e2a\u9891\u7387\u4e3a10 Hz\u7684\u8f7d\u6ce2\u4fe1\u53f7\u548c\u4e00\u4e2a\u9891\u7387\u4e3a2 Hz\u7684\u65b9\u6ce2\u8c03\u5236\u4fe1\u53f7\uff0c\u7136\u540e\u5c06\u8f7d\u6ce2\u4fe1\u53f7\u548c\u8c03\u5236\u4fe1\u53f7\u76f8\u4e58\uff0c\u5f97\u5230\u8c03\u5236\u540e\u7684\u4fe1\u53f7\u3002\u6700\u540e\uff0c\u6211\u4eec\u4f7f\u7528Matplotlib\u5e93\u5c06\u539f\u59cb\u8f7d\u6ce2\u4fe1\u53f7\u3001\u65b9\u6ce2\u8c03\u5236\u4fe1\u53f7\u548c\u8c03\u5236\u540e\u7684\u4fe1\u53f7\u7ed8\u5236\u5728\u540c\u4e00\u4e2a\u56fe\u4e2d\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u5728Python\u4e2d\u751f\u6210\u548c\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7\u3002\u6211\u4eec\u9996\u5148\u4f7f\u7528NumPy\u548cMatplotlib\u5e93\u751f\u6210\u548c\u7ed8\u5236\u4e86\u65b9\u6ce2\u4fe1\u53f7\uff0c\u7136\u540e\u4ecb\u7ecd\u4e86\u5982\u4f55\u8c03\u6574\u56fe\u5f62\u7684\u5916\u89c2\u548c\u6837\u5f0f\u3002\u63a5\u7740\uff0c\u6211\u4eec\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528\u5176\u4ed6\u5e93\u548c\u65b9\u6cd5\u751f\u6210\u548c\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7\uff0c\u4f8b\u5982SciPy\u5e93\u3002\u968f\u540e\uff0c\u6211\u4eec\u7ed3\u5408\u4fe1\u53f7\u5904\u7406\u548c\u5206\u6790\uff0c\u6f14\u793a\u4e86\u5982\u4f55\u5bf9\u65b9\u6ce2\u4fe1\u53f7\u8fdb\u884c\u5085\u91cc\u53f6\u53d8\u6362\u5e76\u7ed8\u5236\u9891\u8c31\u56fe\u3002\u6700\u540e\uff0c\u6211\u4eec\u901a\u8fc7\u4e00\u4e2a\u5b9e\u9645\u5e94\u7528\u7684\u4f8b\u5b50\uff0c\u5c55\u793a\u4e86\u65b9\u6ce2\u4fe1\u53f7\u5728\u901a\u4fe1\u7cfb\u7edf\u4e2d\u7684\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u793a\u4f8b\u548c\u65b9\u6cd5\uff0c\u76f8\u4fe1\u4f60\u5df2\u7ecf\u638c\u63e1\u4e86\u5728Python\u4e2d\u751f\u6210\u548c\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7\u7684\u57fa\u672c\u6280\u5de7\uff0c\u5e76\u80fd\u591f\u5c06\u8fd9\u4e9b\u6280\u5de7\u5e94\u7528\u5230\u5b9e\u9645\u7684\u4fe1\u53f7\u5904\u7406\u548c\u5206\u6790\u4e2d\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7\u7684\u57fa\u672c\u6b65\u9aa4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u8981\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Python\u4e2d\u7684<code>numpy<\/code>\u548c<code>matplotlib<\/code>\u5e93\u3002\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b9a\u4e49\u65f6\u95f4\u6570\u7ec4\u548c\u4fe1\u53f7\u7684\u9891\u7387\uff0c\u7136\u540e\u4f7f\u7528<code>numpy<\/code>\u7684<code>sin<\/code>\u51fd\u6570\u751f\u6210\u5bf9\u5e94\u7684\u6b63\u5f26\u6ce2\uff0c\u63a5\u7740\u901a\u8fc7\u903b\u8f91\u64cd\u4f5c\u5c06\u5176\u8f6c\u6362\u4e3a\u65b9\u6ce2\u3002\u6700\u540e\uff0c\u4f7f\u7528<code>matplotlib<\/code>\u7684<code>plot<\/code>\u51fd\u6570\u7ed8\u5236\u4fe1\u53f7\u3002<\/p>\n<p><strong>\u53ef\u4ee5\u4f7f\u7528\u54ea\u4e9b\u5e93\u6765\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7\uff1f<\/strong><br \/>\u4e3b\u8981\u4f7f\u7528\u7684\u5e93\u5305\u62ec<code>numpy<\/code>\u548c<code>matplotlib<\/code>\u3002<code>numpy<\/code>\u7528\u4e8e\u5904\u7406\u6570\u503c\u8ba1\u7b97\uff0c\u751f\u6210\u65f6\u95f4\u5e8f\u5217\u548c\u8ba1\u7b97\u65b9\u6ce2\u7684\u503c\uff0c\u800c<code>matplotlib<\/code>\u5219\u7528\u4e8e\u7ed8\u5236\u56fe\u5f62\u3002\u60a8\u4e5f\u53ef\u4ee5\u8003\u8651\u4f7f\u7528<code>scipy<\/code>\u5e93\u4e2d\u7684<code>signal<\/code>\u6a21\u5757\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e13\u95e8\u7528\u4e8e\u751f\u6210\u65b9\u6ce2\u7684\u51fd\u6570\u3002<\/p>\n<p><strong>\u7ed8\u5236\u7684\u65b9\u6ce2\u4fe1\u53f7\u7684\u9891\u7387\u548c\u5e45\u5ea6\u5982\u4f55\u8bbe\u7f6e\uff1f<\/strong><br \/>\u5728\u7ed8\u5236\u65b9\u6ce2\u4fe1\u53f7\u65f6\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u65f6\u95f4\u6570\u7ec4\u7684\u6b65\u957f\u548c\u6ce2\u5f62\u7684\u9891\u7387\u6765\u8bbe\u7f6e\u4fe1\u53f7\u7684\u9891\u7387\u3002\u5e45\u5ea6\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u6570\u503c\u4e58\u6cd5\u6765\u8bbe\u5b9a\uff0c\u4f8b\u5982\u5c06\u751f\u6210\u7684\u65b9\u6ce2\u6570\u636e\u4e58\u4ee5\u6240\u9700\u7684\u5e45\u5ea6\u503c\u3002\u8fd9\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u7075\u6d3b\u5730\u8c03\u6574\u4fe1\u53f7\u7279\u6027\u4ee5\u6ee1\u8db3\u4e0d\u540c\u7684\u9700\u6c42\u3002<\/p>\n<p><strong>\u7ed8\u5236\u7684\u65b9\u6ce2\u4fe1\u53f7\u53ef\u4ee5\u7528\u4e8e\u54ea\u4e9b\u5b9e\u9645\u5e94\u7528\uff1f<\/strong><br \/>\u65b9\u6ce2\u4fe1\u53f7\u5e7f\u6cdb\u5e94\u7528\u4e8e\u7535\u5b50\u5de5\u7a0b\u3001\u4fe1\u53f7\u5904\u7406\u548c\u901a\u4fe1\u7cfb\u7edf\u4e2d\u3002\u5b83\u4eec\u5e38\u7528\u4e8e\u65f6\u949f\u4fe1\u53f7\u3001\u6570\u5b57\u7535\u8def\u4e2d\u7684\u5f00\u5173\u4fe1\u53f7\u4ee5\u53ca\u6d4b\u8bd5\u548c\u6a21\u62df\u73af\u5883\u4e2d\u7684\u4fe1\u53f7\u751f\u6210\u3002\u901a\u8fc7\u5728Python\u4e2d\u7ed8\u5236\u65b9\u6ce2\uff0c\u7528\u6237\u53ef\u4ee5\u66f4\u597d\u5730\u7406\u89e3\u4fe1\u53f7\u7279\u6027\u4ee5\u53ca\u5176\u5728\u7cfb\u7edf\u4e2d\u7684\u884c\u4e3a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u753b\u51fa\u65b9\u6ce2\u4fe1\u53f7\uff0c\u53ef\u4ee5\u4f7f\u7528\u51e0\u4e2a\u5e38\u89c1\u7684\u5e93\uff0c\u6bd4\u5982NumPy\u548cMatplotlib\u3002\u9996\u5148\uff0c\u751f\u6210\u65b9\u6ce2\u4fe1\u53f7 [&hellip;]","protected":false},"author":3,"featured_media":1150069,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1150057"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1150057"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1150057\/revisions"}],"predecessor-version":[{"id":1150070,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1150057\/revisions\/1150070"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1150069"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1150057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1150057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1150057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}