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

NaN sometimes introduced in coarse aperiodicity estimation #92

Closed
wants to merge 1 commit into from

Conversation

3628800
Copy link

@3628800 3628800 commented Feb 27, 2020

This can occur when the input signal contains a strong single frequency in a band(s) of interest (for example, a pure 440Hz sine wave in part of the recording).

Example file: 440.zip

…1 - kMySafeGuardMinimum` is returned.

NaN is sometimes introduced in the coarse aperiodicity estimation and then
propagated during interpolation; this tends to occur when the input signal
contains a strong single frequency in a band(s) of interest (for example,
a pure 440Hz sine wave in part of the recording).
@mmorise
Copy link
Owner

mmorise commented Feb 28, 2020

Thank you for your request.
Please give me a few days because I'm too busy to check it.

I think that your idea is reasonable, on the other hand, I'd like to check whether we can avoid the NaN value in the power_spectrum by a more simple approach.

@mmorise
Copy link
Owner

mmorise commented Mar 2, 2020

I attempted to replicate your error by using the attached audio file, but no NaN was observed.
Since the audio file is stereo, I used the 1 ch of the file that includes the 440-Hz pure tone.

If possible, please give me more information such as your OS. I checked the program by using a Windows laptop PC.

@3628800
Copy link
Author

3628800 commented Mar 3, 2020

Thanks for your investigation. I was testing on both Windows and Mac. I cannot reproduce the NaN either with the file I attached-- I discovered that exporting the file sneakily re-encoded the data values to signed integer 16... I observe NaN in the new attached file (containing the mean of the two channels, properly encoded). Using a window size of 2048 and offset 512 samples, it appears in the 10th array of the result (enumerating from 1).
440-mean-double.wav.zip

@mmorise
Copy link
Owner

mmorise commented Mar 4, 2020

Sorry, I could not reproduce the error.
Could you give me a test code? I set the parameters for analysis according to your comments, but they may be different from the parameter you used.

@mmorise mmorise closed this May 13, 2020
@JeremyCCHsu
Copy link

Hi @mmorise , not sure if this is related, but a user reported a similar issue (nan in AP) on the Python side.
JeremyCCHsu/Python-Wrapper-for-World-Vocoder#50

It seems to be a problem in Python's type casting mechanism (float to double), but I did not really know what the root cause was. I reposted it here just for your information. Please let me know if anything crosses your mind. Thanks.

@mmorise
Copy link
Owner

mmorise commented Jun 29, 2020

I tested the audio file (bed (537).wav) but could not obtain the NaN value in the aperiodicity. It would be possible to solve this problem if I confirmed the error by using an audio file and a test code.

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.

3 participants