@@ -57,7 +57,7 @@ With this in mind, we can almost directly transcribe the discrete equation into
57
57
{% sample lang="cs" %}
58
58
[ import:63-84, lang:"csharp"] ( code/csharp/1DConvolution.cs )
59
59
{% 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 )
61
61
{% endmethod %}
62
62
63
63
The 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:
192
192
{% sample lang="cs" %}
193
193
[ import:63-84, lang:"csharp"] ( code/csharp/1DConvolution.cs )
194
194
{% 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 )
196
196
{% endmethod %}
197
197
198
198
Here, 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
204
204
{% sample lang="cs" %}
205
205
[ import:96-97, lang:"csharp"] ( code/csharp/1DConvolution.cs )
206
206
{% 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 )
208
208
{% endmethod %}
209
209
210
210
On 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
215
215
{% sample lang="cs" %}
216
216
[ import:98-99, lang:"csharp"] ( code/csharp/1DConvolution.cs )
217
217
{% 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 )
219
219
{% endmethod %}
220
220
221
221
Finally, 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:
227
227
{% sample lang="cs" %}
228
228
[ import:71-71, lang:"csharp"] ( code/csharp/1DConvolution.cs )
229
229
{% 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 )
231
231
{% endmethod %}
232
232
233
233
Here, ` 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
263
263
{% sample lang="cs" %}
264
264
[ import:38-61, lang:"csharp"] ( code/csharp/1DConvolution.cs )
265
265
{% 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 )
267
267
{% endmethod %}
268
268
269
269
This is essentially the same as before, except for the modulus operations, which allow us to work on a periodic domain.
0 commit comments