We are building an Android application with pocketsphinx on cellphone. However we find there is a problem in feature extraction.
It seems there is mismatch in the values extracted in two places in the code:
1). we get the feature matrix from the following place:
In File pocketsphinx/src/libpocketsphinx/pocketsphinx.c,
function ps_process_raw(),
after running acmod_process_raw(),
get array from ps->acmod->mfc_buf
2). we get the .mfc file from the following place:
recognizer = SpeechRecognizerSetup.defaultSetup()
...
.setString("-mfclogdir", assetsDir.getPath())
...
.getRecognizer();
My understanding is that the two matrixes extraced from these two places should be same. However, we find there are totally different.
Could anyone tell me if they should be different or did we make some mistake?
Thank you.
Last edit: qiqi 2016-05-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
intps_process_raw(ps_decoder_t*ps,int16const*data,size_tn_samples,intno_search,intfull_utt){inti,j;intn_searchfr=0;if(ps->acmod->state==ACMOD_IDLE){E_ERROR("Failed to process data, utterance is not started. Use start_utt to start it\n");return0;}if(no_search)acmod_set_grow(ps->acmod,TRUE);while(n_samples){intnfr;/* Process some data into features. */if((nfr=acmod_process_raw(ps->acmod,&data,&n_samples,full_utt))<0)returnnfr;/* Score and search as much data as possible */if(no_search)continue;if((nfr=ps_search_forward(ps))<0)returnnfr;n_searchfr+=nfr;}//addedtogetfeaturefor(i=0;i<n_searchfr;i++)for(j=0;j<13;j++)E_INFO("%d %d: %f\n",i,j,ps->acmod->mfc_buf[i][j]);returnn_searchfr;}
Last edit: qiqi 2016-05-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, Dear all,
We are building an Android application with pocketsphinx on cellphone. However we find there is a problem in feature extraction.
It seems there is mismatch in the values extracted in two places in the code:
1). we get the feature matrix from the following place:
In File pocketsphinx/src/libpocketsphinx/pocketsphinx.c,
function ps_process_raw(),
after running acmod_process_raw(),
get array from ps->acmod->mfc_buf
2). we get the .mfc file from the following place:
recognizer = SpeechRecognizerSetup.defaultSetup()
...
.setString("-mfclogdir", assetsDir.getPath())
...
.getRecognizer();
My understanding is that the two matrixes extraced from these two places should be same. However, we find there are totally different.
Could anyone tell me if they should be different or did we make some mistake?
Thank you.
Last edit: qiqi 2016-05-10
Without samples of your code it is hard to help you, I suspect you implemented something in 1) incorrectly.
Here is the code:
Last edit: qiqi 2016-05-12
You should not start dump from 0, mfc_buf is a circular buffer, it must start from acmod->mfc_outidx