@@ -57,7 +57,7 @@ With this in mind, we can almost directly transcribe the discrete equation into
5757{% sample lang="cs" %}
5858[ import:63-84, lang:"csharp"] ( code/csharp/1DConvolution.cs )
5959{% sample lang="py" %}
60- [ import:18-27 , lang:"python"] ( code/python/1d_convolution.py )
60+ [ import:20-31 , lang:"python"] ( code/python/1d_convolution.py )
6161{% endmethod %}
6262
6363The easiest way to reason about this code is to read it as you might read a textbook.
@@ -192,7 +192,7 @@ Here it is again for clarity:
192192{% sample lang="cs" %}
193193[ import:63-84, lang:"csharp"] ( code/csharp/1DConvolution.cs )
194194{% sample lang="py" %}
195- [ import:18-27 , lang:"python"] ( code/python/1d_convolution.py )
195+ [ import:20-31 , lang:"python"] ( code/python/1d_convolution.py )
196196{% endmethod %}
197197
198198Here, the main difference between the bounded and unbounded versions is that the output array size is smaller in the bounded case.
@@ -204,7 +204,7 @@ For an unbounded convolution, the function would be called with a the output arr
204204{% sample lang="cs" %}
205205[ import:96-97, lang:"csharp"] ( code/csharp/1DConvolution.cs )
206206{% sample lang="py" %}
207- [ import:37-38 , lang:"python"] ( code/python/1d_convolution.py )
207+ [ import:41-42 , lang:"python"] ( code/python/1d_convolution.py )
208208{% endmethod %}
209209
210210On the other hand, the bounded call would set the output array size to simply be the length of the signal
@@ -215,7 +215,7 @@ On the other hand, the bounded call would set the output array size to simply be
215215{% sample lang="cs" %}
216216[ import:98-99, lang:"csharp"] ( code/csharp/1DConvolution.cs )
217217{% sample lang="py" %}
218- [ import:40-41 , lang:"python"] ( code/python/1d_convolution.py )
218+ [ import:44-45 , lang:"python"] ( code/python/1d_convolution.py )
219219{% endmethod %}
220220
221221Finally, as we mentioned before, it is possible to center bounded convolutions by changing the location where we calculate the each point along the filter.
@@ -227,7 +227,7 @@ This can be done by modifying the following line:
227227{% sample lang="cs" %}
228228[ import:71-71, lang:"csharp"] ( code/csharp/1DConvolution.cs )
229229{% sample lang="py" %}
230- [ import:22-22 , lang:"python"] ( code/python/1d_convolution.py )
230+ [ import:25-25 , lang:"python"] ( code/python/1d_convolution.py )
231231{% endmethod %}
232232
233233Here, ` j ` counts from ` i-length(filter) ` to ` i ` .
@@ -263,7 +263,7 @@ In code, this typically amounts to using some form of modulus operation, as show
263263{% sample lang="cs" %}
264264[ import:38-61, lang:"csharp"] ( code/csharp/1DConvolution.cs )
265265{% sample lang="py" %}
266- [ import:5-15 , lang:"python"] ( code/python/1d_convolution.py )
266+ [ import:5-17 , lang:"python"] ( code/python/1d_convolution.py )
267267{% endmethod %}
268268
269269This is essentially the same as before, except for the modulus operations, which allow us to work on a periodic domain.
0 commit comments