Skip to content

Commit 39e936c

Browse files
committed
removed overlap-add explanation. Created PR#36 instead
1 parent f45f541 commit 39e936c

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

sdp/challenger_sdp.py

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -54,58 +54,6 @@ def _pocketfft_oaconvolve_block(Q, T, conv_block_size):
5454

5555

5656
def _pocketfft_oaconvolve(Q, T, conv_block_size):
57-
# Circular convolution between two 1D arrays X and Y
58-
# (of same length N) is an array with length N,
59-
# and its n-th element is defined as:
60-
# out[n] = sum_{i=0}^{N-1} X[i] * Y[(n - i) mod N]
61-
62-
# To compute this circular convolution:
63-
# Approach I: Regular Method
64-
# X: 1 2 3 4 5 6 --conv-- Y: b a 0 0 0 0
65-
66-
# X_conv_Y:
67-
# [
68-
# 1b + 6a,
69-
# 1a + 2b,
70-
# 2a + 3b,
71-
# 3a + 4b,
72-
# 4a + 5b,
73-
# 5a + 6b
74-
# ]
75-
76-
# Approach II: Overlap-Add Method
77-
# Step1: Chunk T and compute convolution block-wise
78-
# Choose a block size --> 3
79-
# Find chunk size --> block_size - (M - 1) = 2
80-
# Chunk T according to chunk size, and Pad
81-
# each chunk with M-1 zeros at the end
82-
83-
# X1: 1 2 0 --conv-- Y: b a 0
84-
# X2: 3 4 0 --conv-- Y: b a 0
85-
# X3: 5 6 0 --conv-- Y: b a 0
86-
87-
# X1_conv_Y: [1b, 1a + 2b, 2a]
88-
# X2_conv_Y: [3b, 3a + 4b, 4a]
89-
# X3_conv_Y: [5b, 5a + 6b, 6a]
90-
91-
# Step 2: Add the overlapping parts
92-
# Slice the blocks based on `chunk_size`, so:
93-
# [1b, 1a + 2b]
94-
# [3b, 3a + 4b]
95-
# [5b, 5a + 6b]
96-
97-
# The last `M-1` element(s) of k-th block
98-
# will be added to first `M-1` element(s) of (k+1)-th block.
99-
# Final output:
100-
# [
101-
# 1b # ??
102-
# 1a + 2b,
103-
# 3b (+ 2a),
104-
# 3a + 4b,
105-
# 5b (+ 4a),
106-
# 5a + 6b
107-
# ]
108-
# Now this is equivalent to X_conv_Y, for [M-1: N]
10957
QT_conv_blocks = _pocketfft_oaconvolve_block(Q, T, conv_block_size)
11058
overlap = len(Q) - 1
11159
out = QT_conv_blocks[:, :-overlap]

0 commit comments

Comments
 (0)