Skip to content

Commit

Permalink
More tonal PBS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dingraha committed Apr 22, 2024
1 parent b7c8c5c commit 7f988d1
Show file tree
Hide file tree
Showing 2 changed files with 320 additions and 5 deletions.
11 changes: 10 additions & 1 deletion src/proportional_bands.jl
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,16 @@ Return the proportional band spectrum amplitude for the `i`th non-zero band in `
# This is where the fun begins.
# So, first I want the lower and upper bands of this band.
fl = lower_bands(pbs)[i]
fu = upper_bands(pbs)[i]
# Arg, numerical problems: lower_bands[i+1] should be the same as upper_bands[i].
# But because of floating point inaccuracies, they can be a tiny bit different.
# And that can lead to a "gap" between, say, upper_bands[i] and lower_bands[i+1].
# And then if a tone is right in that gap, we'll miss part of the spectrum.
# So, to fix this, always use the lower band values except for the last proportional band (where it won't matter, since that frequency value is only used once, and hence there can't be any gap).
if i < length(pbs)
fu = lower_bands(pbs)[i+1]
else
fu = upper_bands(pbs)[i]
end
# Now I need to find the starting and ending indices that are included in this frequency band.

# Need the narrowband frequencies.
Expand Down
Loading

0 comments on commit 7f988d1

Please sign in to comment.