diff --git a/README.md b/README.md index 56241c8..8e43add 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can give the repository a [Star](https://github.com/spatialaudio/digital-sig The Jupyter notebooks are available * Online as [static web pages](http://nbviewer.ipython.org/github/spatialaudio/digital-signal-processing-lecture/blob/master/index.ipynb) -* Online for [interactive use](https://hub.mybinder.org/user/spatialaudio-di-cessing-lecture-ozvc5wsr/notebooks/index.ipynb) using [binder](http://mybinder.org/) +* Online for [interactive use](https://mybinder.org/v2/gh/spatialaudio/digital-signal-processing-lecture/master?filepath=index.ipynb) using [binder](http://mybinder.org/) * Local (offline) use on your computer The local use on your computer requires a local Jupyter/IPython installation. The [Anaconda distribtution](https://www.continuum.io/downloads) provides a good starting point. You have to [download or clone the notebooks from Github](http://github.com/spatialaudio/digital-signal-processing-lecture). Use a [Git](http://git-scm.org/) client to clone the notebooks and then start your local Jupyter server. For manual installation of Jupyter under OS X/Linux please refer to your packet manager. diff --git a/filter_design/frequency_sampling_method.ipynb b/filter_design/frequency_sampling_method.ipynb index d66f042..3549a19 100644 --- a/filter_design/frequency_sampling_method.ipynb +++ b/filter_design/frequency_sampling_method.ipynb @@ -55,7 +55,9 @@ "\n", "where $\\text{psinc}_N(\\cdot)$ denotes the $N$-th order periodic sinc function.\n", "\n", - "Both the transfer function of the filter $H(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$ and the desired transfer function $H_\\text{d}[\\mu]$ are equal at the specified frequencies $\\Omega_\\mu = \\frac{2 \\pi}{N} \\mu$. Values in between adjacent $\\Omega_\\mu$ are interpolated by the periodic sinc function. This is illustrated in the following." + "Both the transfer function of the filter $H(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$ and the desired transfer function $H_\\text{d}[\\mu]$ are equal at the specified frequencies $\\Omega_\\mu = \\frac{2 \\pi}{N} \\mu$. Values in between adjacent $\\Omega_\\mu$ are interpolated by the periodic sinc function. \n", + "\n", + "The reconstruction of a sampled function by interpolation requires that the function is band-limited. Here the function to be interpolated is given by the desired transfer function $H_\\text{d}(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$. If the spectrum of this function is not-bandlimited, aliasing may be present. Since $DFT_N\\{ DFT_N \\{ x[k] \\} \\} = N \\cdot x[-k]$ aliasing becomes apparent as time-domain aliasing. This is illustrated in the following at the example of an ideal low-pass filter." ] }, { @@ -79,9 +81,7 @@ { "cell_type": "code", "execution_count": 1, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -168,7 +168,7 @@ "* Does the resulting filter approximate the desired magnitude and phase response well?\n", "* Increase the length `N` of the filter. Does the attenuation in the stop-band improve?\n", "\n", - "Solution: The desired magnitude and phase response is an ideal low-pass with zero-phase. The magnitude response of the designed filter approximates this only very coarsely and shows major ringing artifacts. The phase of the designed filter is also not zero for all frequencies. Increasing the length `N` of the filter does not improve the attenuation in the stop-band, it only changes the frequencies of the local minima of the ripples. The reason for the poor performance of the designed filter is the zero-phase of the desired transfer function which cannot be realized by a causal non-recursive system. This was [already discussed for the window method](../filter_design/window_method.ipynb#Zero-Phase-Filters). The frequency sampling method suffers additionally from time-domain aliasing due to the periodicity of the DFT. Again a linear-phase design is better in such situations." + "Solution: The desired magnitude and phase response is an ideal low-pass with zero-phase. The magnitude response of the designed filter approximates this only very coarsely and shows major ringing artifacts. The phase of the designed filter is also not zero for all frequencies. Increasing the length `N` of the filter does not improve the attenuation in the stop-band, it only changes the frequencies of the local minima of the ripples. The reason for the overall poor performance of above approximation of an ideal low-pass by the frequency sampling method is the missing band-limitation of the desired frequency response. The resulting time-domain aliasing can be observed in above plot of the impulse response. The large amplitudes at the end of the impulse response result from cyclic shifting and superposition." ] }, { @@ -177,7 +177,7 @@ "source": [ "### Design of Linear-Phase Filters\n", "\n", - "The design of non-recursive FIR filters with a linear phase is often desired due to their constant group delay. As for the [window method](../filter_design/window_method.ipynb), the design of a digital filter with a generalized linear phase is considered in the following. For $|\\Omega| < \\pi$ its transfer function is given as\n", + "As shown for the ideal low-pass, the frequency sampling method may suffer from time-domain aliasing. Typical desired impulse responses have large amplitudes close to $k=0$ which decay with increasing $k$. In such situations, the effect of time-domain aliasing can be limited by shifting the large amplitudes to the center of the impulse response. As a result, only low amplitude samples are wrapped around by time-domain aliasing. As for the [window method](../filter_design/window_method.ipynb#Zero-Phase-Filters), this shift can be achieved by replacing the zero-phase with a generalized linear phase. For $|\\Omega| < \\pi$ the desired transfer function is then given as\n", "\n", "\\begin{equation}\n", "H_\\text{d}(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega}) = A(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega}) \\cdot \\mathrm{e}^{\\,-\\mathrm{j} \\alpha \\Omega + \\mathrm{j} \\beta}\n", @@ -207,9 +207,7 @@ { "cell_type": "code", "execution_count": 2, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -316,7 +314,7 @@ "h[k] &= \\text{DFT}_N^{-1} \\{ H_\\text{d}[\\mu] \\}\n", "\\end{align}\n", "\n", - "For finite lengths $N$, the difference between both methods is related to the periodicity of the DFT. For a desired frequency response $H_\\text{d}(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$ which does not result in a FIR $h_\\text{d}[k]$ of length $N$, the inverse DFT in the frequency sampling method will suffer from time-domain aliasing. In the general case, filter coefficients computed by the window and frequency sampling method will hence differ.\n", + "For finite lengths $N$, the difference between both methods is related to time-domain aliasing. For a desired frequency response $H_\\text{d}(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$ which does not result in a FIR $h_\\text{d}[k]$ of length $N$, the inverse DFT in the frequency sampling method will suffer from time-domain aliasing. In the general case, filter coefficients computed by the window and frequency sampling method will hence differ.\n", "\n", "However, for a rectangular window $w[k]$ and $N \\to \\infty$ both methods will become equivalent. This reasoning motivates an oversampled frequency sampling method, where $H_\\text{d}(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$ is sampled at $M \\gg N$ points in order to derive an approximation of $h_\\text{d}[k]$ which is then windowed to the target length $N$. The method is beneficial in cases where a closed-form inverse DTFT of $H_\\text{d}(\\mathrm{e}^{\\,\\mathrm{j}\\,\\Omega})$, as required for the window method, cannot be found." ] @@ -349,9 +347,7 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -456,7 +452,7 @@ "metadata": { "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python [default]", + "display_name": "Python 3", "language": "python", "name": "python3" },
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: