diff --git a/contents/convolutions/1d/1d.md b/contents/convolutions/1d/1d.md index e3f9a3770..9a2e652d1 100644 --- a/contents/convolutions/1d/1d.md +++ b/contents/convolutions/1d/1d.md @@ -57,7 +57,7 @@ With this in mind, we can almost directly transcribe the discrete equation into {% sample lang="cs" %} [import:63-84, lang:"csharp"](code/csharp/1DConvolution.cs) {% sample lang="py" %} -[import:18-27, lang:"python"](code/python/1d_convolution.py) +[import:20-31, lang:"python"](code/python/1d_convolution.py) {% endmethod %} 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: {% sample lang="cs" %} [import:63-84, lang:"csharp"](code/csharp/1DConvolution.cs) {% sample lang="py" %} -[import:18-27, lang:"python"](code/python/1d_convolution.py) +[import:20-31, lang:"python"](code/python/1d_convolution.py) {% endmethod %} 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 {% sample lang="cs" %} [import:96-97, lang:"csharp"](code/csharp/1DConvolution.cs) {% sample lang="py" %} -[import:37-38, lang:"python"](code/python/1d_convolution.py) +[import:41-42, lang:"python"](code/python/1d_convolution.py) {% endmethod %} 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 {% sample lang="cs" %} [import:98-99, lang:"csharp"](code/csharp/1DConvolution.cs) {% sample lang="py" %} -[import:40-41, lang:"python"](code/python/1d_convolution.py) +[import:44-45, lang:"python"](code/python/1d_convolution.py) {% endmethod %} 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: {% sample lang="cs" %} [import:71-71, lang:"csharp"](code/csharp/1DConvolution.cs) {% sample lang="py" %} -[import:22-22, lang:"python"](code/python/1d_convolution.py) +[import:25-25, lang:"python"](code/python/1d_convolution.py) {% endmethod %} 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 {% sample lang="cs" %} [import:38-61, lang:"csharp"](code/csharp/1DConvolution.cs) {% sample lang="py" %} -[import:5-15, lang:"python"](code/python/1d_convolution.py) +[import:5-17, lang:"python"](code/python/1d_convolution.py) {% endmethod %} This is essentially the same as before, except for the modulus operations, which allow us to work on a periodic domain.