Skip to content

Commit

Permalink
Convolution is explained prior to the section of 'Filter Implementati…
Browse files Browse the repository at this point in the history
…on'. So the setence in parentheses '(Don't worry, a later section explains convolution.)' is removed. Also, two typos of 'IFFshift' are correctedl. (#40)

Co-authored-by: Marc Lichtman <[email protected]>
  • Loading branch information
nihilist97 and 777arc authored Aug 22, 2024
1 parent 061a769 commit a053b3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ In this above expression, :math:`g(t)` is the signal or input that is flipped an
Filter Implementation
*************************

We aren't going to dive too deeply into the implementation of filters. Rather, I focus on filter design (you can find ready-to-use implementations in any programming language anyway). For now, here is one take-away: to filter a signal with an FIR filter, you simply convolve the impulse response (the array of taps) with the input signal. (Don't worry, a later section explains convolution.) In the discrete world we use a discrete convolution (example below). The triangles labeled as b's are the taps. In the flowchart, the squares labeled :math:`z^{-1}` above the triangles signify to delay by one time step.
We aren't going to dive too deeply into the implementation of filters. Rather, I focus on filter design (you can find ready-to-use implementations in any programming language anyway). For now, here is one take-away: to filter a signal with an FIR filter, you simply convolve the impulse response (the array of taps) with the input signal. In the discrete world we use a discrete convolution (example below). The triangles labeled as b's are the taps. In the flowchart, the squares labeled :math:`z^{-1}` above the triangles signify to delay by one time step.

.. image:: ../_images/discrete_convolution.png
:scale: 80 %
Expand Down Expand Up @@ -635,7 +635,7 @@ It's not symmetrical around 0 Hz.

</details>

Our end goal is to find the taps of this filter so we can actually use it. How do we get the taps, given the frequency response? Well, how do we convert from the frequency domain back to the time domain? Inverse FFT (IFFT)! Recall that the IFFT function is almost exactly the same as the FFT function. We also need to IFFTshift our desired frequency response before the IFFT, and then we need yet another IFFshift after the IFFT (no, they don't cancel themselves out, you can try). This process might seem confusing. Just remember that you always should FFTshift after an FFT and IFFshift after an IFFT.
Our end goal is to find the taps of this filter so we can actually use it. How do we get the taps, given the frequency response? Well, how do we convert from the frequency domain back to the time domain? Inverse FFT (IFFT)! Recall that the IFFT function is almost exactly the same as the FFT function. We also need to IFFTshift our desired frequency response before the IFFT, and then we need yet another IFFTshift after the IFFT (no, they don't cancel themselves out, you can try). This process might seem confusing. Just remember that you always should FFTshift after an FFT and IFFTshift after an IFFT.

.. code-block:: python
Expand Down

0 comments on commit a053b3e

Please sign in to comment.