Skip to content

Commit

Permalink
+ 'precision' arg for fundamental freq
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancoe committed Oct 6, 2023
1 parent 6c9b852 commit 919367d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wecopttool/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,7 @@ def frequency(
f1: float,
nfreq: int,
zero_freq: Optional[bool] = True,
precision: Optional[int] = 10,
) -> ndarray:
"""Construct equally spaced frequency array.
Expand All @@ -1329,7 +1330,10 @@ def frequency(
Number of frequencies.
zero_freq
Whether to include the zero-frequency.
precision
Controls rounding of fundamental frequency.
"""
f1 = np.floor(f1*10**precision) / 10**precision
freq = np.arange(0, nfreq+1)*f1
freq = freq[1:] if not zero_freq else freq
return freq
Expand Down

0 comments on commit 919367d

Please sign in to comment.