{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 序列时域混叠\n", "\n", "同时域采样一样,定义采样序列$p_N(\\\\omega) = \\\\sum_{k=-\\\\infty}^{\\\\infty} \\\\delta (\\\\omega - 2k\\\\pi /N)$。那么,将频域采样前后的关系写为\n", "\n", "\n", "$$\n", "\\begin{split}\n", " X_p(e^{j\\omega}) &= X(e^{j\\omega})\\cdot p_N(\\omega) = \\sum_{k=-\\infty}^\\infty \\delta\\left(\\omega - \\frac{2k\\pi}{N}\\right) \\cdot X(e^{j\\omega}) \\\\\n", " & = \\sum_{k=-\\infty}^\\infty \\delta\\left(\\omega - \\frac{2k\\pi}{N}\\right) \\cdot X(e^{j2k\\pi/N}) \n", "\\end{split}\n", "$$\n", "\n", "\n", "其中$X_p(e^{j\\\\omega})$为$X[k]$的连续形式,表达的信号是等价的。那么对上式进行 IDTFT 变换,就可以得到频域采样后时域的信号,这里记作$\\\\tilde{x}[n]$\n", "\n", "\n", "$$\n", " \\tilde{x}[n] &= \\text{IDTFT}\\{X_p(e^{j\\omega})\\} \\\\\n", " & =\\frac{1}{2 \\pi} \\int_{-\\pi}^{\\pi}\\left(\\sum_{k=-\\infty}^{\\infty} X\\left(e^{j 2 \\pi k / N}\\right) \\delta(\\omega-2 \\pi k / N)\\right) e^{j \\omega n} d \\omega \\\\\n", " & = \\frac{1}{2 \\pi} \\sum_{k=-\\infty}^{\\infty} \\underbrace{X\\left(e^{j 2 \\pi k / N}\\right)}_{=\\sum_{l=-\\infty}^{+\\infty} x[l] e^{-j 2 \\pi k l / N}} \\cdot \\underbrace{\\int_{-\\pi}^{\\pi} \\delta(\\omega-2 \\pi k / N) e^{j \\omega n} d \\omega}_{=e^{j 2 \\pi k n / N, \\ \\text{ for } k\\in [0,N-1]}} \\\\\n", " &= \\frac{1}{2 \\pi} \\sum_{l=-\\infty}^{\\infty} x[l] \\underbrace{\\sum_{k=0}^{N-1} e^{j 2 \\pi k / N(n-l)}}_{=N\\sum_{m=-\\infty}^{\\infty}\\delta[l-n-Nm]} \\\\\n", " &= \\frac{N}{2 \\pi} \\sum_{m=-\\infty}^{\\infty} x[n+mN]\n", "$$\n", "\n", "\n", "上式最后一个等式的求和符号的含义就是,将原信号$x[n]$以$N$为长度,周期延拓。也就是说,如果对 DTFT 变换的频率进行离散化,会导致时域上信号的周期延拓,幅度也会变为原来的$N/2\\\\pi$倍。这个结论与对信号在时域进行采样,频域周期延拓是类似的。" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/mac/anaconda3/envs/Sphinx/lib/python3.6/site-packages/ipykernel_launcher.py:11: UserWarning: In Matplotlib 3.3 individual lines on a stem plot will be added as a LineCollection instead of individual lines. This significantly improves the performance of a stem plot. To remove this warning and switch to the new behaviour, set the \"use_line_collection\" keyword argument to True.\n", " # This is added back by InteractiveShellApp.init_path()\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAABdCAYAAABXa4ZgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAIN0lEQVR4nO3c64tcdx3H8fcnyTbZpua+khibrCIGrbaIq3iJl0TS+CD1Uh9Ya2ipDyJS9UFoCgX1D7B9UqwUgyBS4gWa1kugpGkSkErauIskSiRo1GK0lY0liWDaxuTrgz3bbsczMzu7czi/85vPCxbOzvzms98Z9vfhMLtzFBGYmVmzLah7ADMzmz+XuZlZBlzmZmYZcJmbmWXAZW5mlgGXuZlZBhbNZpGkIeCxiLilzf1LgEeB64GTwB3R4X8e16xZE6Ojoz0Nev4/l3nh4ktcvnKVoYULWLtsCSuuHeopo+rM1POaMGPqeU2Y0c85vbx+ZU5MTJyLiJGy+7qWuaRh4Fng7R2W7QTORsQOSQeAbcCT7RaPjo4yPj7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7GDqzPcnwHslfbXmecpcBE4Xx38G1tc4Szv3AQ9HxCiwStKHap6nHe+Z+WvCngGaVebJX51R0lpgD7AjIv5d9zytIuL2iNgM3AZMRMRDdc9UYgKYvhbG25gq9NS8AXipOH4ZuK7GWTrxnpmnhuwZoFllvg9YL+kk8CJTv6ipuRNYBxyU9LSkL9U9UNNExDHgX5J+A5yOiON1z1Tiu8BXJB1j6j3zFH8XwXtmoPgToGZmGWjSmbmZmbXhMjczy4DL3MwsAy5zM7MMuMzNzDLgMjczy8D/AIWMBhxHpsuxAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "/Users/mac/anaconda3/envs/Sphinx/lib/python3.6/site-packages/ipykernel_launcher.py:28: UserWarning: In Matplotlib 3.3 individual lines on a stem plot will be added as a LineCollection instead of individual lines. This significantly improves the performance of a stem plot. To remove this warning and switch to the new behaviour, set the \"use_line_collection\" keyword argument to True.\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAABdCAYAAABXa4ZgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAIxElEQVR4nO3cb2hV9x3H8ffXJNXrhvmjKWqoTWEsMDqLcC0bCNWA5omuXfug3ZCWbuAelO2BmDFh3eOBfTIolMpgjOJgoFY2n1in7kHHZrkhGIsga4ddE7sRkZiNpa3G7x7kROP13HvOvd6cc+7PzwsCJ+f87vd8+ebw4eQm95i7IyIi7W1F3g2IiMiDU5iLiARAYS4iEgCFuYhIABTmIiIBUJiLiASgM80iM+sCjrv7nhrHVwFHgceACeBlr/M/j+vWrfPBwcGGGp35303+Nfs5N+dv09WxgvVrVtGzuks1VCOoGkXoIbQaIRkbG7vm7v1xxxLD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a70s4s89nG9JrmWoWM5xvTZ9rzZzrTmD6BxGsVMppnUcO8+kmMfU2uWXbu/nd3/8DMvgvcBt6LWfYR8Lq7Pw1sAJ7JsscGeijETCM7WXjuT5wizHNR2pnlPtuU1yrkP9+05899ppF61ypkNM+kpybmpWVPa8yCmX0H+Amwx91vxSy5Any4ZPvRbDpruIfCzBTYAxyvcewK+c9zUdqZFWK2Ka5VyH++ac9fiJlS/1qFjOZZ1Dvztnlao5mtB0aB3e7+nxrL9gMvmdkK4Enu/mCzlKaHoszUgO0s/OocpwjzXJR2ZrnPNuW1CvnPN+35izDTpGsVMppnUcP8CDBgZhPAdeBjM6t+mHn1mnq/5iynV1j41elU9JfqH8b0+ibwKnAeeNfdL2XdZHUPwFyBZ7oVuOTun5vZEwWd56L7Zlaj5yLMtvpa/UFB53vf+Qs80zvXKkCe89QnQEVEAlDUO3MREWmAwlxEJAAKcxGRACjMRUQCoDAXEQmAwlxEJAD/B2A+o2LvXRNSAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "/Users/mac/anaconda3/envs/Sphinx/lib/python3.6/site-packages/ipykernel_launcher.py:43: UserWarning: In Matplotlib 3.3 individual lines on a stem plot will be added as a LineCollection instead of individual lines. This significantly improves the performance of a stem plot. To remove this warning and switch to the new behaviour, set the \"use_line_collection\" keyword argument to True.\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWkAAABdCAYAAABn55dBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAG9ElEQVR4nO3c/2tddx3H8ed7adqlnV1XG+gazYIMgwyV4v1h1SpYcdkP7ej2y2SKFX9oEWQ/KCkU/QvsTwVF7A+DIVMHW60ijs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rQ72QHgbmAkIl6MiK9WHUhlyMxTwL8j4k/AeGaerjpTxb4HfC0iTjE7J92W3eETh5JUsBKupCVJy7CkJalglrQkFcySlqSCWdKSVDBLWpIK9n+DDzlgtwe3cwAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "%matplotlib inline\n", "from numpy import *\n", "from matplotlib.pyplot import *\n", "\n", "# 产生长度为L信号\n", "L = 16\n", "n = arange(0,L)\n", "x = ones([L,]) #sin(2*pi*0.5*n/L)\n", "\n", "subplot(311)\n", "stem(n,x)\n", "show()\n", "\n", "\n", "\n", "# 如果L<=N,不会产生混叠\n", "N = 19\n", "xn = zeros([N,])\n", "xn[:L] = x\n", "xt = zeros([N,])\n", "for i in range(0,N):\n", " xt[i] = xn[i]\n", " if i-N >= 0:\n", " xt[i] = xn[i-N] + xt[i]\n", " if i+N N,会产生混叠\n", "N = 10\n", "xn = x\n", "\n", "xt = zeros([N,])\n", "for i in range(0,N):\n", " xt[i] = xn[i]\n", " if i-N >= 0:\n", " xt[i] = xn[i-N] + xt[i]\n", " if i+N < L:\n", " xt[i]=xt[i] + xn[i+N]\n", "subplot(313)\n", "stem(xt)\n", "show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## DFT变换与DTFT变换的关系" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/mac/anaconda3/envs/Sphinx/lib/python3.6/site-packages/ipykernel_launcher.py:12: UserWarning: In Matplotlib 3.3 individual lines on a stem plot will be added as a LineCollection instead of individual lines. This significantly improves the performance of a stem plot. To remove this warning and switch to the new behaviour, set the \"use_line_collection\" keyword argument to True.\n", " if sys.path[0] == '':\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAACACAYAAAD5y4mRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29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bunZfu4g1kqT/owW/zdLYk0bMAU8t8+Eb6fO5fEGcceVKnw/Kn7H0+aD8GUub75zMnOx1RytlvhIRMdPvqzmlcMaVK30+KH/G0ueD8mcsfb5j+XN+SaqAZS5JFRjFMt/Z9gCL4IwrV/p8UP6Mpc8H5c9Y+nyvGrnPzCVJ/2sUz8wlSV1GpsxH5VK7EfHjiHg0In4ZEYMul9CKiLgmIh5oe45+IuK6znt4b0Qc3/Y83SLipIj4RUT8JiK+0/Y8x4qINRHxq852kcfMsTN2bhd1zHTP19lX9DEDI1TmjMCldiNiC7A6M98PnMJrlzkoRkScA1zV9hz9RMRbgHM77+G9wJtaHqmXzwOPZuaHgHMj4u1tDwQQERPALK8dG8UdM90zlnbM9HgPiz9m5o1SmW8F7u9sPwhc0OIs/fwDuKmzXep7exOw4CWKW/ZxYH1E/Br4MPCXlufp5Xng5IhYBUwAL7Y8DwCZeSQzzwMOdHYVd8z0mLGoY6bHfFD+MQMU8OYtQfeldje0OEtPmfnHzHw8Ij4NvALc1/ZMx4qIK4A9wJNtz7KASWAuMz/C0bPyLS3P08tdwCXAfuAPmbm/5Xn68ZhZoRE5ZoDRKvNFXWq3bRHxCeCbwKWZ+Z+25+myjaNnvj8D3hMRX295nl4OA/s6238GNrU4Sz/XA7dk5hSwISI+2PI8/XjMrNwoHDPAaJV58ZfajYjTgR3Atsz8V9vzdMvMKzJzC3A5MJuZN7c9Uw+zwPzPp9/K0UIvzRuAf3e2XwBObnGWhXjMrNCIHDPAaJX5KFxq9yrgDGBXRDwcEV9se6BRk5mPAP+MiN8C+zLz8bZn6uH7wFcj4hGOfmZe4v9F8JgZK/5oSJIqMEpn5pKkPixzSaqAZS5JFbDMJakClrkkVcAyl6QKWOaSVIH/At9NKm0dsLngAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "/Users/mac/anaconda3/envs/Sphinx/lib/python3.6/site-packages/ipykernel_launcher.py:20: UserWarning: In Matplotlib 3.3 individual lines on a stem plot will be added as a LineCollection instead of individual lines. This significantly improves the performance of a stem plot. To remove this warning and switch to the new behaviour, set the \"use_line_collection\" keyword argument to True.\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAACACAYAAAD5y4mRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAJWklEQVR4nO3cXYhc9RnH8e9jkpq1YDYxK5rFGKE0UHwhsEoLghrQ3Gi1eqEtotiWtFDaCzGlufDaQrxpEcRQKEUsFEwMrTfRJvbC0iobglECoVq0ZiNlgyTpxdZqfHqRWU0mZ2fObGZnzvzz/cDC2Tn/ec7Dk8MvZ+flRGYiSRptlwy7AUnShTPMJakAhrkkFcAwl6QCGOaSVADDXJIKsHwYB127dm1u2LBhGIeWpJF14MCB45k5UbWvVphHxApgd2bes8D+lcCLwDXAIeCR7PAB9g0bNjA9PV3n0F/Yc3CGHXuPcOzEHOvGx9i2ZSP3bZq0hjWKqtGEHkqrUZKI+GDBfd2+NBQRY8AbwNczc+UCa34ITGXmjyPiZeDXmfnKQjWnpqaylzDfc3CG7bvfZu7T0188NrZiGU/df0Ptf1hrWKPpNZrQQ2k1ShMRBzJzqmpf19fMM3MuM28EjnZYthl4tbW9H7ij5y472LH3yDn/oABzn55mx94j1rBGMTWa0ENpNS4m/XoD9ArgZGv7FLCmfUFEbI2I6YiYnp2d7an4sRNzPT1uDWuMYo0m9FBajYtJv8L8OLCqtb2q9fs5MnNnZk5l5tTEROXr9wtaNz7W0+PWsMYo1mhCD6XVuJj0K8z3AXe1tjcDr/WpLgDbtmxkbMWycx4bW7GMbVs2WsMaxdRoQg+l1biY9PzRxIi4DvhJZj5x1sMvAPdHxCHgLc6Ee9/Mv9nx8xcP8b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57z6s6sEbOtca7C8Odb9/iNmCmdz1UY0DybemU+MrfejYirgG3A3Zn5nwWWPQ48FBGXANfz5T/sINXpoSkzDeB2zvzpXKUJ85xXd2ZDn23NcxWGP9+6x2/CTLudqzCgeTY1zEfp1ruPcuZPp72td6p/UNHrM8BjwBvAS5l5eNBNtvcAzDV4pjcDhzPzvxFxXUPnOe+8mS3QcxNm236ufr+h8z3v+A2e6RfnKsAw5+mXhiSpAE29Mpck9cAwl6QCGOaSVADDXJIKYJhLUgEMc0kqgGEuSQX4P49xsLwFPJw2AAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "%matplotlib inline\n", "from numpy import *\n", "from matplotlib.pyplot import *\n", "from scipy import *\n", "\n", "# 产生长度为L信号\n", "L = 16\n", "n = arange(0,L)\n", "x = ones([L,]) #sin(2*pi*0.5*n/L)\n", "\n", "subplot(211)\n", "stem(n,x)\n", "show()\n", "\n", "\n", "# 如果L<=N,不会产生混叠\n", "N = 19\n", "xt = real(ifft(fft(x,N),N))\n", "subplot(212)\n", "stem(xt)\n", "show()\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "hide_input": false, "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.6.8" } }, "nbformat": 4, "nbformat_minor": 2 }