Menu

#95 Possible bug: lpc2lsp

dev
closed
nobody
None
5
2018-10-01
2018-09-22
No

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
1 Attachments

Discussion

  • Keiichiro Oura

    Keiichiro Oura - 2018-10-01
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB