From e9defdb9b342d964cc11de267eb615e211aa517d Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Tue, 11 Jun 2024 14:22:36 -0400 Subject: [PATCH 1/4] Dev version bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cd893be..651c001 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "python-adc-eval" -version = "0.2.1" +version = "0.3.0b0" license = {text = "MIT"} description = "ADC Evaluation Library" readme = "README.rst" From ecaa7a58b0d3410771c204a0123df9a945d26676 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Tue, 11 Jun 2024 16:28:39 -0400 Subject: [PATCH 2/4] Fix wrong power being used for harmonic calculation. --- adc_eval/spectrum.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/adc_eval/spectrum.py b/adc_eval/spectrum.py index 66662ae..d219b85 100644 --- a/adc_eval/spectrum.py +++ b/adc_eval/spectrum.py @@ -94,21 +94,22 @@ def find_harmonics(spectrum, freq, nfft, bin_sig, psig, harms=5, leak=20): if bin_harm == nfft / 2: bin_harm = 0 pwr_max = spectrum[bin_harm] + bin_harm_max = bin_harm for i in range(bin_harm - leak, bin_harm + leak + 1): try: pwr = spectrum[i] if pwr > pwr_max: - bin_harm = i + bin_harm_max = i pwr_max = pwr except IndexError: # bin + leakage out of bounds, so stop looking break harm_stats["harm"][harm_index]["bin"] = bin_harm - harm_stats["harm"][harm_index]["power"] = pwr + harm_stats["harm"][harm_index]["power"] = pwr_max harm_stats["harm"][harm_index]["freq"] = round(freq[bin_harm] / 1e6, 1) - harm_stats["harm"][harm_index]["dBc"] = dBW(pwr / psig) - harm_stats["harm"][harm_index]["dB"] = dBW(pwr) + harm_stats["harm"][harm_index]["dBc"] = dBW(pwr_max / psig) + harm_stats["harm"][harm_index]["dB"] = dBW(pwr_max) harm_index = harm_index + 1 From ec021beeb4a26ed487b4c9a76168b9db174e7bfa Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Tue, 11 Jun 2024 16:35:04 -0400 Subject: [PATCH 3/4] Version bump --- .gitignore | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cfec992..93b30a0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ python_adc_eval.egg-info dist .ruff_cache .coverage +build diff --git a/pyproject.toml b/pyproject.toml index 651c001..d2d70a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "python-adc-eval" -version = "0.3.0b0" +version = "0.2.2" license = {text = "MIT"} description = "ADC Evaluation Library" readme = "README.rst" From c5a739869f4131da1b9bf9348781395caba4f372 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Tue, 11 Jun 2024 16:37:35 -0400 Subject: [PATCH 4/4] Lint fix --- adc_eval/spectrum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adc_eval/spectrum.py b/adc_eval/spectrum.py index d219b85..a104faa 100644 --- a/adc_eval/spectrum.py +++ b/adc_eval/spectrum.py @@ -105,7 +105,7 @@ def find_harmonics(spectrum, freq, nfft, bin_sig, psig, harms=5, leak=20): # bin + leakage out of bounds, so stop looking break - harm_stats["harm"][harm_index]["bin"] = bin_harm + harm_stats["harm"][harm_index]["bin"] = bin_harm_max harm_stats["harm"][harm_index]["power"] = pwr_max harm_stats["harm"][harm_index]["freq"] = round(freq[bin_harm] / 1e6, 1) harm_stats["harm"][harm_index]["dBc"] = dBW(pwr_max / psig)