Skip to content
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
3 changes: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2024-05-20 - Single vs. Dual Convolution for Complex Signals
**Learning:** In `digital_downconverter.py`, the `_apply_lowpass_filter` function was performing two separate `fftconvolve` operations—one on the real part and one on the imaginary part of the complex signal. Combining these into a single `fftconvolve` on the complex signal itself resulted in a 28% reduction in the combined pipeline processing time. This is because `scipy.signal.fftconvolve` is optimized for complex inputs, and a single operation reduces Python overhead.
**Action:** When I encounter filtering or convolution operations on complex-valued data, I will ensure they are performed in a single operation rather than being split by real and imaginary components.
88 changes: 44 additions & 44 deletions fft_ddc_performance_report.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"timestamp": "2026-01-16 19:05:53",
"timestamp": "2026-01-17 13:01:30",
"system_info": {
"numpy_version": "2.4.1",
"python_version": "3.12.12 (main, Nov 7 2025, 00:07:10) [GCC 13.3.0]",
Expand All @@ -17,20 +17,20 @@
8192
],
"computation_times": [
0.5711707705001572,
0.3492901171999165,
0.2273913765999623,
0.19699875840001368,
0.19924213169992983,
0.20323929259993748
0.48517668689999593,
0.3279225473999986,
0.23730186390000085,
0.2073529940000128,
0.1923519671999941,
0.20967159909999963
],
"throughput_msps": [
17.507674615848096,
28.629129504619122,
43.974226945251964,
50.75329449385659,
50.18183611415116,
49.17474309297549
20.61078421532064,
30.494615509930753,
42.13772212178551,
48.21891310621434,
51.979380016448864,
47.66616004694752
],
"memory_usage": [
4096,
Expand All @@ -42,11 +42,11 @@
],
"accuracy_metrics": [
0.0,
1.7901010750429764e-16,
0.0,
0.0,
1.7276711454275117e-16,
1.702153742740428e-16,
1.7276043176259577e-16
0.0,
1.7400193226405283e-16
]
},
"ddc_performance": {
Expand Down Expand Up @@ -78,18 +78,18 @@
}
],
"throughput_msps": [
4.528349856544793,
4.647720783800708,
4.627052815350687,
5.174086925106924,
6.333568828084639
5.054311416696046,
4.641915102659372,
5.008147329197962,
5.8903278768785015,
7.657704821531766
],
"processing_times": [
0.11041549699993994,
0.21515922460002912,
0.21612029079988132,
0.09663540779993127,
0.03157777320002424
0.09892544379998754,
0.21542832599999429,
0.1996746369999755,
0.08488491819999808,
0.026117486199996164
],
"decimation_factors": [
125,
Expand All @@ -108,8 +108,8 @@
"filter_performance": [
{
"processed_samples": 2501024,
"total_processing_time": 0.5526746119999189,
"throughput_samples_per_sec": 4525310.093311048,
"total_processing_time": 0.4955767939999305,
"throughput_samples_per_sec": 5046693.126636496,
"output_sample_rate": 400000.0,
"decimation_factor": 125,
"filter_length": 257,
Expand All @@ -118,8 +118,8 @@
},
{
"processed_samples": 5001024,
"total_processing_time": 1.0735039300006974,
"throughput_samples_per_sec": 4658598.688126601,
"total_processing_time": 1.0776191990000257,
"throughput_samples_per_sec": 4640808.185897847,
"output_sample_rate": 400000.0,
"decimation_factor": 250,
"filter_length": 257,
Expand All @@ -128,8 +128,8 @@
},
{
"processed_samples": 5001024,
"total_processing_time": 1.0781263740000213,
"throughput_samples_per_sec": 4638625.044896547,
"total_processing_time": 0.9988457439999934,
"throughput_samples_per_sec": 5006803.132556605,
"output_sample_rate": 2000000.0,
"decimation_factor": 50,
"filter_length": 257,
Expand All @@ -138,8 +138,8 @@
},
{
"processed_samples": 2501024,
"total_processing_time": 0.4832504689993584,
"throughput_samples_per_sec": 5175419.7056005765,
"total_processing_time": 0.4236935970000104,
"throughput_samples_per_sec": 5902907.236995461,
"output_sample_rate": 10000000.0,
"decimation_factor": 5,
"filter_length": 101,
Expand All @@ -148,8 +148,8 @@
},
{
"processed_samples": 1001024,
"total_processing_time": 0.15870550399949934,
"throughput_samples_per_sec": 6307430.900463023,
"total_processing_time": 0.12981373699994947,
"throughput_samples_per_sec": 7711233.211015177,
"output_sample_rate": 200000.0,
"decimation_factor": 100,
"filter_length": 257,
Expand All @@ -166,18 +166,18 @@
"fft_size": 2048
},
"processing_times": [
20.35233013099969,
19.179927676999796,
18.127753287999894
12.526878776999979,
12.527599296999995,
12.556478982999977
],
"memory_efficiency": [],
"real_time_factor": [
20.35233013099969,
19.179927676999796,
18.127753287999894
12.526878776999979,
12.527599296999995,
12.556478982999977
],
"average_throughput_msps": 5.2029126303934214,
"std_processing_time": 0.9086217028141044
"average_throughput_msps": 7.976398993127074,
"std_processing_time": 0.013786981007740947
}
}
}
Binary file modified performance_plots/ddc_performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified performance_plots/fft_performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots-optimized/ddc_performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plots-optimized/fft_performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 44 additions & 44 deletions report-optimized.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"timestamp": "2026-01-16 17:38:22",
"timestamp": "2026-01-17 12:59:00",
"system_info": {
"numpy_version": "2.4.1",
"python_version": "3.12.12 (main, Nov 7 2025, 00:07:10) [GCC 13.3.0]",
Expand All @@ -17,20 +17,20 @@
8192
],
"computation_times": [
0.7124243274000037,
0.3317680948000543,
0.2414399119999871,
0.20838946269991537,
0.1968590276998384,
0.2212597407999965
0.47906586859999434,
0.3328900870000012,
0.24036425930000008,
0.20615471520000597,
0.1945809541999978,
0.21429415410000274
],
"throughput_msps": [
14.036398836202835,
30.14115026951761,
41.4155220533734,
47.97908622854787,
50.78931922413537,
45.169717563007104
20.873689100881435,
30.039560775505947,
41.6008604154403,
48.49918659536782,
51.38393961067395,
46.637949793703086
],
"memory_usage": [
4096,
Expand All @@ -41,11 +41,11 @@
131072
],
"accuracy_metrics": [
1.566451320743264e-16,
1.7361981035073338e-16,
0.0,
0.0,
1.6766424536480663e-16,
1.7250430296665018e-16,
0.0,
0.0,
0.0
]
},
Expand Down Expand Up @@ -78,18 +78,18 @@
}
],
"throughput_msps": [
4.38622178327377,
4.24470765074979,
4.279179647059457,
4.930475775249993,
6.120464837277627
4.391155743708177,
4.433880757041247,
4.725262524646914,
5.189828351616914,
6.963638068588195
],
"processing_times": [
0.1139933238001504,
0.23558748499990542,
0.2336896514001637,
0.10141009160006434,
0.03267725660016367
0.1138652393999962,
0.22553606079999894,
0.21162845339999875,
0.09634230000000343,
0.028720619599999962
],
"decimation_factors": [
125,
Expand All @@ -108,8 +108,8 @@
"filter_performance": [
{
"processed_samples": 2501024,
"total_processing_time": 0.5711138169995138,
"throughput_samples_per_sec": 4379204.154330815,
"total_processing_time": 0.5700944860000163,
"throughput_samples_per_sec": 4387034.187171438,
"output_sample_rate": 400000.0,
"decimation_factor": 125,
"filter_length": 257,
Expand All @@ -118,8 +118,8 @@
},
{
"processed_samples": 5001024,
"total_processing_time": 1.1764338540006065,
"throughput_samples_per_sec": 4251003.133744757,
"total_processing_time": 1.1281148290000544,
"throughput_samples_per_sec": 4433080.632787036,
"output_sample_rate": 400000.0,
"decimation_factor": 250,
"filter_length": 257,
Expand All @@ -128,8 +128,8 @@
},
{
"processed_samples": 5001024,
"total_processing_time": 1.166541264999978,
"throughput_samples_per_sec": 4287052.803057159,
"total_processing_time": 1.058566498999994,
"throughput_samples_per_sec": 4724336.170400597,
"output_sample_rate": 2000000.0,
"decimation_factor": 50,
"filter_length": 257,
Expand All @@ -138,8 +138,8 @@
},
{
"processed_samples": 2501024,
"total_processing_time": 0.50719297500018,
"throughput_samples_per_sec": 4931109.3080481095,
"total_processing_time": 0.48107896699997355,
"throughput_samples_per_sec": 5198780.598529342,
"output_sample_rate": 10000000.0,
"decimation_factor": 5,
"filter_length": 101,
Expand All @@ -148,8 +148,8 @@
},
{
"processed_samples": 1001024,
"total_processing_time": 0.16405683499942825,
"throughput_samples_per_sec": 6101690.307529636,
"total_processing_time": 0.14289898100000187,
"throughput_samples_per_sec": 7005116.432565652,
"output_sample_rate": 200000.0,
"decimation_factor": 100,
"filter_length": 257,
Expand All @@ -166,18 +166,18 @@
"fft_size": 2048
},
"processing_times": [
17.094090977000178,
16.94161697399977,
16.992344200999923
15.701508023999992,
12.807787587000007,
13.133863442000006
],
"memory_efficiency": [],
"real_time_factor": [
17.094090977000178,
16.94161697399977,
16.992344200999923
15.701508023999992,
12.807787587000007,
13.133863442000006
],
"average_throughput_msps": 5.879119177553057,
"std_processing_time": 0.0633981944858045
"average_throughput_msps": 7.204064408710794,
"std_processing_time": 1.2941209856801232
}
}
}
7 changes: 3 additions & 4 deletions wideband-sdr-software/digital_downconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,9 @@ def _apply_lowpass_filter(self, samples: np.ndarray) -> np.ndarray:
"""
# For better performance with long filters, use fftconvolve
# The 'auto' method selects the fastest convolution method
filtered_real = signal.fftconvolve(samples.real, self.filter_coeffs, mode='same')
filtered_imag = signal.fftconvolve(samples.imag, self.filter_coeffs, mode='same')

return filtered_real + 1j * filtered_imag
# A single convolution on the complex signal is more efficient
# than two separate convolutions on the real and imaginary parts.
return signal.fftconvolve(samples, self.filter_coeffs, mode='same')

def _apply_decimation(self, samples: np.ndarray) -> np.ndarray:
"""
Expand Down