I noticed sometimes I get large values in lpc2lsp output (e.g. 600, though I usually get 0 ~ 5 for lpc or lsp coefficients). While I was trying to figure out why I got these large values I realized I get different results when I intialized the memory buffer for lpc and lsp (I'll leave code location below) with explicit zeros, so I guess there might be unexpected memory access in the core lpc2lsp function defined in _lpc2lsp.c. I haven't had a closer look into the core funciton yet, but I'll report this possible issue here first. I would be grateful if any of you could also get a chance to look into it. Versions, patch, some more details about what I tried are as follows:
SPTK: version 3.11
Platform: Mac OS X 10.13.6
Patch I tried (in lpc2lsp.c):
*** lpc2lsp.c.org 2018-09-22 22:58:05.482429781 +0900
--- lpc2lsp.c 2018-09-22 22:58:07.321380659 +0900
***************
*** 248,256 ****
--- 248,257 ----
if (loggain)
*a = log(*a);
fwritef(a, sizeof(*a), 1, stdout);
}
fwritef(lsp, sizeof(*lsp), m, stdout);
+ fillz(lsp, sizeof(lsp), m+m+1);
}
return (0);
}
I'll attach 1) raw input (test16k.float) 2) lsp (extracted with SPTK 3.11) 3) lsp (extracted with the above fix). You can see some large values in the second file as shown below:
dmp +f test16k.lsp > a.txt
dmp +f test16k_with_zero_initialized_memory.lsp > b.txt
diff a.txt b.txt | tail
18587,18590c18587,18590
< 18586 643.132
< 18587 666.389
< 18588 707.687
< 18589 744.37
---
> 18586 0
> 18587 0
> 18588 0
> 18589 0
lsp files were created with the command:
frame -l 512 -p 80 < test16k.float | window -l 512 | lpc -m 25 -l 512 | lpc2lsp -m 25 > test16k.lsp
Thank you very much for your report!
It was fixed.
https://sourceforge.net/p/sp-tk/SPTK/ci/b7d3b2a5f27496fe4a88ba9c09f74df98fdc0ec3/