Skip to content

Commit 0525ced

Browse files
committed
tikz fix and spelling
1 parent 922cbe7 commit 0525ced

2 files changed

Lines changed: 24 additions & 6 deletions

File tree

content/filters.rst

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ You may think we only care about digital filters; this textbook explores DSP, af
2727

2828
In DSP, where the input and output are signals, a filter has one input signal and one output signal:
2929

30+
.. raw:: html
31+
32+
<div style="max-width: 700px; margin: 0 auto;">
33+
3034
.. tikz:: [font=\sffamily\Large, scale=2]
3135
\definecolor{babyblueeyes}{rgb}{0.36, 0.61, 0.83}
3236
\node [draw,
@@ -36,9 +40,13 @@ In DSP, where the input and output are signals, a filter has one input signal an
3640
minimum height=2.4cm
3741
] (filter) {Filter};
3842
\draw[<-, very thick] (filter.west) -- ++(-2,0) node[left,align=center]{Input\\(time domain)} ;
39-
\draw[->, very thick] (filter.east) -- ++(2,0) node[right,align=center]{Output\\(time domain)};
43+
\draw[->, very thick] (filter.east) -- ++(2,0) node[right,align=center]{Output\\(time domain)};
4044
:libs: positioning
41-
:xscale: 80
45+
:xscale: 100
46+
47+
.. raw:: html
48+
49+
</div>
4250

4351
You cannot feed two different signals into a single filter without adding them together first or doing some other operation. Likewise, the output will always be one signal, i.e., a 1D array of numbers.
4452

@@ -53,7 +61,7 @@ There are four basic types of filters: low-pass, high-pass, band-pass, and band-
5361
.. START OF FILTER TYPES TIKZ
5462
.. raw:: html
5563

56-
<table><tbody><tr><td>
64+
<table style="max-width: 700px; margin: 0 auto;"><tbody><tr><td>
5765

5866
.. This draw the lowpass filter
5967
.. tikz:: [font=\sffamily\large]
@@ -255,8 +263,12 @@ Real vs. Complex Filters
255263
The filter I showed you had real taps, but taps can also be complex. Whether the taps are real or complex doesn't have to match the signal you put through it, i.e., you can put a complex signal through a filter with real taps and vice versa. When the taps are real, the filter's frequency response will be symmetrical around DC (0 Hz). Typically we use complex taps when we need asymmetry, which does not happen too often.
256264

257265
.. draw real vs complex filter
258-
.. tikz:: [font=\sffamily\Large,scale=2]
259-
\definecolor{babyblueeyes}{rgb}{0.36, 0.61, 0.83}
266+
.. raw:: html
267+
268+
<div style="max-width: 800px; margin: 0 auto;">
269+
270+
.. tikz:: [font=\sffamily\Large,scale=2]
271+
\definecolor{babyblueeyes}{rgb}{0.36, 0.61, 0.83}
260272
\draw[->, thick] (-5,0) node[below]{$-\frac{f_s}{2}$} -- (5,0) node[below]{$\frac{f_s}{2}$};
261273
\draw[->, thick] (0,-0.5) node[below]{0 Hz} -- (0,1);
262274
\draw[babyblueeyes, smooth, line width=3pt] plot[tension=0.1] coordinates{(-5,0) (-1,0) (-0.5,2) (0.5,2) (1,0) (5,0)};
@@ -265,6 +277,11 @@ The filter I showed you had real taps, but taps can also be complex. Whether th
265277
\draw[babyblueeyes, smooth, line width=3pt] plot[tension=0] coordinates{(6,0) (11,0) (11,2) (11.5,2) (12,0) (16,0)};
266278
\draw[font=\huge\bfseries] (0,2.5) node[above,align=center]{Example Low-Pass Filter\\with Real Taps};
267279
\draw[font=\huge\bfseries] (11,2.5) node[above,align=center]{Example Low-Pass Filter\\with Complex Taps};
280+
:xscale: 100
281+
282+
.. raw:: html
283+
284+
</div>
268285

269286
As an example of complex taps, let's go back to the filtering use-case, except this time we want to receive the other interfering signal (without having to re-tune the radio). That means we want a band-pass filter, but not a symmetrical one. We only want to keep (a.k.a "pass") frequencies between around 7 kHz to 13 kHz (we don't want to also pass -13 kHz to -7 kHz):
270287

@@ -756,7 +773,7 @@ You will learn a lot more about pulse shaping, including some special properties
756773
Filtering in Chunks
757774
*******************
758775

759-
So far we have filtered signals that fit comfortably in memory: we hand the whole array to :code:`np.convolve` and get the whole result back. But what happens when the signal is enormous, say a recording that is tens of gigabytes, or when the signal needs to be processed in realtime? We need a way to filter the signal a piece at a time, while producing the exact same output we would have gotten if we had filtered it all at once.
776+
So far we have filtered signals that fit comfortably in memory: we hand the whole array to :code:`np.convolve` and get the whole result back. But what happens when the signal is enormous, say a recording that is tens of gigabytes, or when the signal needs to be processed in real-time? We need a way to filter the signal a piece at a time, while producing the exact same output we would have gotten if we had filtered it all at once.
760777

761778
At first this sounds trivial, just filter each chunk and stitch the outputs together. But try it and you will see glitches at every chunk boundary. The reason comes straight from how an FIR filter works: to compute one output sample, the filter reaches back across the previous :math:`M-1` input samples, where :math:`M` is the number of taps. Right at the start of a new chunk, those previous samples live in the *previous* chunk, which we already threw away. So the first :math:`M-1` outputs of every chunk are wrong, because the filter had nothing but zeros to reach back into. Put simply, an FIR filter has *memory*, and if we filter chunk by chunk we have to carry that memory across the seams.
762779

spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,4 @@ hyperboloid
364364
underdetermined
365365
unitless
366366
linearizing
367+
prepending

0 commit comments

Comments
 (0)