Skip to content

Commit 1550a1f

Browse files
committed
Fixed equations for zero-padding
1 parent 754d6f5 commit 1550a1f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

nonrecursive_filters/fast_convolution.ipynb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,15 @@
6868
"To compute the linear convolution by the periodic convolution one has to take care that the result of the linear convolution fits into one period of the periodic convolution. Hence, the periodicity has to be chosen as $M \\geq N+L-1$. This can be achieved by zero-padding of $x_L[k]$ and $h_N[k]$ to a total length of $M$\n",
6969
"\n",
7070
"\\begin{align}\n",
71-
"x_M[k] &= \\left[ x_L[0], x_L[1], \\dots, x_L[L-1], 0, \\dots, 0 \\right]^\\text{T} \\\\\n",
72-
"h_M[k] &= \\left[ h[0], h[1], \\dots, h[N-1], 0, \\dots, 0 \\right]^\\text{T}\n",
71+
"x_M[k] &= \\begin{cases}\n",
72+
"x_L[k] & \\mathrm{for} \\; k=0, 1, \\dots, L-1 \\\\\n",
73+
"0 & \\mathrm{for} \\; k=L, L+1, \\dots, M-1\n",
74+
"\\end{cases}\n",
75+
"\\\\\n",
76+
"h_M[k] &= \\begin{cases}\n",
77+
"h_N[k] & \\mathrm{for} \\; k=0, 1, \\dots, N-1 \\\\\n",
78+
"0 & \\mathrm{for} \\; k=N, N+1, \\dots, M-1\n",
79+
"\\end{cases}\n",
7380
"\\end{align}\n",
7481
"\n",
7582
"This results in the desired equality of linear and periodic convolution\n",
@@ -87,7 +94,7 @@
8794
"source": [
8895
"#### Example\n",
8996
"\n",
90-
"The following example computes the linear, periodic and linear by periodic convolution of a rectangular signal $x[k] = \\text{rect}_L[k]$ of length $N$ with a triangular signal $h[k] = \\Lambda_N[k]$ of length $N$."
97+
"The following example computes the linear, periodic and linear by periodic convolution of a rectangular signal $x[k] = \\text{rect}_L[k]$ of length $L$ with a triangular signal $h[k] = \\Lambda_N[k]$ of length $N$."
9198
]
9299
},
93100
{

spectral_analysis_deterministic_signals/zero_padding.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398
"name": "python",
399399
"nbconvert_exporter": "python",
400400
"pygments_lexer": "ipython3",
401-
"version": "3.5.1"
401+
"version": "3.5.2"
402402
}
403403
},
404404
"nbformat": 4,

0 commit comments

Comments
 (0)