diff --git a/contents/convolutions/1d/1d.md b/contents/convolutions/1d/1d.md index 3a3ca0cf6..3e663938e 100644 --- a/contents/convolutions/1d/1d.md +++ b/contents/convolutions/1d/1d.md @@ -53,7 +53,7 @@ With this in mind, we can almost directly transcribe the discrete equation into {% method %} {% sample lang="jl" %} -[import:29-48, lang:"julia"](../code/julia/1d_convolution.jl) +[import:27-46, lang:"julia"](../code/julia/1d_convolution.jl) {% endmethod %} The easiest way to reason about this code is to read it as you might read a textbook. @@ -184,7 +184,7 @@ Here it is again for clarity: {% method %} {% sample lang="jl" %} -[import:29-48, lang:"julia"](../code/julia/1d_convolution.jl) +[import:27-46, lang:"julia"](../code/julia/1d_convolution.jl) {% endmethod %} Here, the main difference between the bounded and unbounded versions is that the output array size is smaller in the bounded case. @@ -192,14 +192,14 @@ For an unbounded convolution, the function would be called with a the output arr {% method %} {% sample lang="jl" %} -[import:60-61, lang:"julia"](../code/julia/1d_convolution.jl) +[import:58-59, lang:"julia"](../code/julia/1d_convolution.jl) {% endmethod %} On the other hand, the bounded call would set the output array size to simply be the length of the signal {% method %} {% sample lang="jl" %} -[import:63-64, lang:"julia"](../code/julia/1d_convolution.jl) +[import:61-62, lang:"julia"](../code/julia/1d_convolution.jl) {% 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. @@ -207,7 +207,7 @@ This can be done by modifying the following line: {% method %} {% sample lang="jl" %} -[import:37-37, lang:"julia"](../code/julia/1d_convolution.jl) +[import:35-35, lang:"julia"](../code/julia/1d_convolution.jl) {% endmethod %} Here, `j` counts from `i-length(filter)` to `i`. @@ -239,7 +239,7 @@ In code, this typically amounts to using some form of modulus operation, as show {% method %} {% sample lang="jl" %} -[import:4-27, lang:"julia"](../code/julia/1d_convolution.jl) +[import:4-25, lang:"julia"](../code/julia/1d_convolution.jl) {% endmethod %} This is essentially the same as before, except for the modulus operations, which allow us to work on a periodic domain.