/* lspsync.c David Rowe 24 May 2012 Attempt at using LSP information to provide frame sync. If we have correct frame alignment, LSPs will not need sorting. However this method as tested appears unreliable, often several sync positions per frame are found, even with a F=10 memory. For F=6, about 87% relaible. This might be useful if combined with a another sync method, for example a single alternating sync bit per frame. */ #include #include #include #include "codec2.h" #include "defines.h" #include "quantise.h" #define F 6 /* look at LSP ordering in F-1 frames */ #define CORRECT_OFFSET 10 /* LSPs start 10 bits int frame qt 2400 bit/s */ static int check_candidate(char bits[], int offset) { int i; int lsp_indexes[LPC_ORD]; float lsps[LPC_ORD]; unsigned int nbit = offset; int swaps; for(i=0; i