From fec6b68aaba464f12c587cbc98d805ed09e3d57b Mon Sep 17 00:00:00 2001 From: Ayman Lafaz Date: Thu, 7 Oct 2021 16:34:20 +0100 Subject: [PATCH] fixing linking issues in convolution chapter --- contents/convolutions/1d/1d.md | 28 +++++++++---------- .../{ => 1d}/code/csharp/1DConvolution.cs | 0 2 files changed, 14 insertions(+), 14 deletions(-) rename contents/convolutions/{ => 1d}/code/csharp/1DConvolution.cs (100%) diff --git a/contents/convolutions/1d/1d.md b/contents/convolutions/1d/1d.md index b061941c1..d5d77652b 100644 --- a/contents/convolutions/1d/1d.md +++ b/contents/convolutions/1d/1d.md @@ -53,9 +53,9 @@ With this in mind, we can almost directly transcribe the discrete equation into {% method %} {% sample lang="jl" %} -[import:27-46, lang:"julia"](../code/julia/1d_convolution.jl) +[import:27-46, lang:"julia"](code/julia/1d_convolution.jl) {% sample lang="cs" %} -[import:63-84, lang:"csharp"](../code/csharp/1DConvolution.cs) +[import:63-84, lang:"csharp"](code/csharp/1DConvolution.cs) {% endmethod %} The easiest way to reason about this code is to read it as you might read a textbook. @@ -186,9 +186,9 @@ Here it is again for clarity: {% method %} {% sample lang="jl" %} -[import:27-46, lang:"julia"](../code/julia/1d_convolution.jl) +[import:27-46, lang:"julia"](code/julia/1d_convolution.jl) {% sample lang="cs" %} -[import:63-84, lang:"csharp"](../code/csharp/1DConvolution.cs) +[import:63-84, lang:"csharp"](code/csharp/1DConvolution.cs) {% endmethod %} Here, the main difference between the bounded and unbounded versions is that the output array size is smaller in the bounded case. @@ -196,18 +196,18 @@ For an unbounded convolution, the function would be called with a the output arr {% method %} {% sample lang="jl" %} -[import:58-59, lang:"julia"](../code/julia/1d_convolution.jl) +[import:58-59, lang:"julia"](code/julia/1d_convolution.jl) {% sample lang="cs" %} -[import:96-97, lang:"csharp"](../code/csharp/1DConvolution.cs) +[import:96-97, lang:"csharp"](code/csharp/1DConvolution.cs) {% 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:61-62, lang:"julia"](../code/julia/1d_convolution.jl) +[import:61-62, lang:"julia"](code/julia/1d_convolution.jl) {% sample lang="cs" %} -[import:98-99, lang:"csharp"](../code/csharp/1DConvolution.cs) +[import:98-99, lang:"csharp"](code/csharp/1DConvolution.cs) {% 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. @@ -215,9 +215,9 @@ This can be done by modifying the following line: {% method %} {% sample lang="jl" %} -[import:35-35, lang:"julia"](../code/julia/1d_convolution.jl) +[import:35-35, lang:"julia"](code/julia/1d_convolution.jl) {% sample lang="cs" %} -[import:71-71, lang:"csharp"](../code/csharp/1DConvolution.cs) +[import:71-71, lang:"csharp"](code/csharp/1DConvolution.cs) {% endmethod %} Here, `j` counts from `i-length(filter)` to `i`. @@ -249,9 +249,9 @@ In code, this typically amounts to using some form of modulus operation, as show {% method %} {% sample lang="jl" %} -[import:4-25, lang:"julia"](../code/julia/1d_convolution.jl) +[import:4-25, lang:"julia"](code/julia/1d_convolution.jl) {% sample lang="cs" %} -[import:38-61, lang:"csharp"](../code/csharp/1DConvolution.cs) +[import:38-61, lang:"csharp"](code/csharp/1DConvolution.cs) {% endmethod %} This is essentially the same as before, except for the modulus operations, which allow us to work on a periodic domain. @@ -266,9 +266,9 @@ For the code associated with this chapter, we have used the convolution to gener {% method %} {% sample lang="jl" %} -[import, lang:"julia"](../code/julia/1d_convolution.jl) +[import, lang:"julia"](code/julia/1d_convolution.jl) {% sample lang="cs" %} -[import, lang:"csharp"](../code/csharp/1DConvolution.cs) +[import, lang:"csharp"](code/csharp/1DConvolution.cs) {% endmethod %} At a test case, we have chosen to use two sawtooth functions, which should produce the following images: diff --git a/contents/convolutions/code/csharp/1DConvolution.cs b/contents/convolutions/1d/code/csharp/1DConvolution.cs similarity index 100% rename from contents/convolutions/code/csharp/1DConvolution.cs rename to contents/convolutions/1d/code/csharp/1DConvolution.cs