Skip to content

fixing linking issues in convolution chapter #868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions contents/convolutions/1d/1d.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -186,38 +186,38 @@ 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.
For an unbounded convolution, the function would be called with a the output array size specified to be the size of both signals put together:

{% 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.
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`.
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down