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

PitchYinFFT updates (new weighting parameter, do not throw exception on empty peak detection) #1400

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

xaviliz
Copy link
Contributor

@xaviliz xaviliz commented Feb 6, 2024

  1. Add weighting parameter to select different weighting funcitons in PITCHYINFFT algorithm. The available choices are:

    • the default weighting function
    • A-weighting
    • B-weighting
    • C-weighting
    • D-weighting
    • Z-weighting.

    Note that there is no experimental validation of better pitch estimation performance with new alternative weightings.

  2. Change behavior on empty spectrum peak detection: output zero pitch and confidence instead of throwing an exception.

@dbogdanov Edited for completeness.

@@ -189,8 +245,9 @@ void PitchYinFFT::compute() {
yinMin = -_amplitudes[0];
}
else {
// TODO this should never happen, but some people reported it happening in their real time applications.
throw EssentiaException("PitchYinFFT: it appears that no peaks were found by PeakDetection. If you read this message, PLEASE, report this issue to the developers with an example of audio on which it happened.");
tau = 0.0; // it will provide zero-pitch and zero-pitch confidence.
Copy link
Member

@dbogdanov dbogdanov Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is out of scope of weighting functions. At least would should add the description of this change to the PR, or move it to a separate PR if you have more updates to group it with.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes! this is something we need in the ODISEI project to avoid a crucial error. Indeed we would need to launch a negative pitch value. No problem I will redo what essentia does in this cases.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change had been already included in the merge.

@dbogdanov dbogdanov changed the title Add new parameter in pitchyinfft to modify the weighting function. PitchYinFFT updates (new weighting parameter, do not throw exception on empty peak detection) Feb 8, 2024
@dbogdanov dbogdanov merged commit 75939da into MTG:master Feb 8, 2024
3 of 5 checks passed
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.

2 participants