Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make spectral rolloff return bound values #318

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Polochon-street
Copy link
Contributor

@Polochon-street Polochon-street commented Nov 16, 2020

Hi,

The current code returns an out of bound bin (length + 1) if everything is contained in the last bin. This returns instead the last bin.

Not really sure where to test that, but here's a small excerpt that shows it working:

X = [0., 0., 0., 0., 1.]
cumsum = 0.

for x in X:
    cumsum += x

cumsum *= 0.95
j = 0
rollsum += X[j]

while rollsum < cumsum:
    j += 1
    rollsum += X[j]
print(j)

It returns 4 (the right value), and if you instead use

j = 0

while rollsum < cumsum:
    rollsum += X[j]    
    j += 1
print(j)

you can see it returns 5, one too much.

We could also do it the other way, where you go through the norm array and then break whenever you reach 95% of the energy, but I didn't want to change stuff too much :)

@Polochon-street
Copy link
Contributor Author

Build seems to fail because of missing public keys?

@rec
Copy link

rec commented Nov 17, 2020

Ah, I appear to see that too: #312

See also: #317

@Polochon-street
Copy link
Contributor Author

@rec yep, tried to rebuild it today - failed. I guess we just need to wait til the key is updated 😄

@autoantwort autoantwort mentioned this pull request Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants