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

about pitch coherence #33

Open
zoulingqi opened this issue Jan 14, 2022 · 2 comments
Open

about pitch coherence #33

zoulingqi opened this issue Jan 14, 2022 · 2 comments

Comments

@zoulingqi
Copy link

hello,
In your code:
Exp[i] = Exp[i]/sqrt(1e-15+Ex[i]*Ep[i]).
while bandE[i]=sqrt(sum[i]) in the function compute_band_corr.

I think the code should be
if(Ex[i]*Ep[i]==0)
Exp[i] = 0;(or 1?)
else
Exp[i] = Exp[i]/(1e-15+Ex[i]*Ep[i]).
And this can only make pitch coherence{Exp[i]} be 1,when signal{X} and it's periodic component {P} are exactly the same。

@jzi040941
Copy link
Owner

jzi040941 commented Jan 15, 2022

I've checked the code in the function compute_band_corr didn't apply sqrt
if I change it to bandE[i]=sqrt(sum[i]) than I think
the equation Exp[i] = Exp[i]/sqrt(1e-15+Ex[i]*Ep[i]). should remain sqrt
otherwise your answer Exp[i] = Exp[i]/(1e-15+Ex[i]*Ep[i]) (without sqrt) is right

I'm not sure about which Exp[i] value should I take 0 or 1 in case of exception that Ex[i] or Ep[i] is 0.
how about changing 1e-15 to very small epsilon 1e-37 would be nice solution
I think it won't ruin Exp value that much but also prevent zero division error.

wait for your suggestion thanks.

@zoulingqi
Copy link
Author

sorry,I confused the two functions.
"bandE[i]=sqrt(sum[i])"is in the fuction compute_band_energy.
Ex[i] and Ep[i] is already the ||x|| and ||p||,so Exp[i] should equal to Exp[i]/(1e-37+Ex[i]*Ep[i]) instead of Exp[i]/sqrt(1e-37+Ex[i]*Ep[i]).

void compute_band_energy(float *bandE, const kiss_fft_cpx *X) {
......
......
for (i=0;i<NB_BANDS;i++)
{
bandE[i] = sqrt(sum[i]);
}
}

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

No branches or pull requests

2 participants