Skip to content

Commit

Permalink
Merge pull request #5 from fronzbot/dev
Browse files Browse the repository at this point in the history
release-0.1.2
  • Loading branch information
fronzbot authored Jul 14, 2023
2 parents 2752e35 + f8dbafb commit 3e943e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions adc_eval/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def harmonics(psp, fft_n, ref_pow, sample_freq, leak=20, n=5, window="hanning"):
df = sample_freq / fft_n
# calculate fundamental frequency
fund_bin = np.argmax(psp)
fund_freq = np.sum(
[psp[i] * i * df for i in range(fund_bin - leak, fund_bin + leak + 1)]
) / np.sum(psp[fund_bin - leak : fund_bin + leak + 1])
if np.isinf:
fund_freq = fund_bin * df
fund_freq = fund_bin * df
num = np.sum([psp[i] * i * df for i in range(fund_bin - leak, fund_bin + leak + 1)])
den = np.sum(psp[fund_bin - leak : fund_bin + leak + 1])
if den > 0:
fund_freq = num / den

# calculate harmonics info
h = []
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "python-adc-eval"
version = "0.1.1"
version = "0.1.2"
license = {text = "MIT"}
description = "ADC Evaluation Library"
readme = "README.rst"
Expand Down

0 comments on commit 3e943e6

Please sign in to comment.