Skip to content

fixing 1d convolution markdown file #879

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 12, 2021
Merged
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
12 changes: 6 additions & 6 deletions contents/convolutions/1d/1d.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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`.
Expand Down Expand Up @@ -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.
Expand Down