I am having problems finding a working solution to compare two speach mic inputs using the ac97 on the virtex ii pro. I am able to record input from the mic, and play it back at a push of a button but what I want to do is be able to compare two inputs and see if the same word was said. I have the following for read and write commands:
//------------To Record ---------------------//
if (~pressed & BTN_UP){
XAC97_EnableInput(XPAR_AUDIO_CODEC_BASEADDR, AC97_MIC_INPUT);
XAC97_WriteReg(XPAR_AUDIO_CODEC_BASEADDR, AC97_MicVol, AC97_VOL_MAX);
print("-- recording --\r\n");
while(sampleCnt < SAMPLE_SIZE)
{
SAMPLE1[sampleCnt] = XAC97_ReadFifo(XPAR_AUDIO_CODEC_BASEADDR);
sampleCnt++;
}
//---------------------------------------------//
//--------To Playback --------------------//
if (~pressed & BTN_DOWN){
print("--Playing sample -\r\n");
for(i=0; i< SAMPLE_SIZE; i++){
recorded1 = SAMPLE1;
XAC97_WriteFifo(XPAR_AUDIO_CODEC_BASEADDR, recorded1);
}
print("--done--\r\n");
}
//-------------------------------------------//
Like I said, I can record multiple inputs, and I am able to play them back with no problems, the problem lies when I want to compare them to see if the same word was said by the same person. I am setting ReadFifo equal to an array, and my assumtion was that if the a word was said twice into the mic for two separate inputs and these inputs were stored in different arrays than the arrays should be the same. I found out that this assumption was wrong when I monitored what data was being stored (I was getting values like -10089 198678 67811) it just seems random. I then I took the sum of each array and compared them to see if they were the same. Even if I repeatedly said the same thing in the same tone and volume I was getting extremly different results (1173899756 vs -67324328582) even though when I play back each input they sound identical. I am going to try a few more things, but I just wanted to see if anyone had any suggestions of what might work.
//------------To Record ---------------------//
if (~pressed & BTN_UP){
XAC97_EnableInput(XPAR_AUDIO_CODEC_BASEADDR, AC97_MIC_INPUT);
XAC97_WriteReg(XPAR_AUDIO_CODEC_BASEADDR, AC97_MicVol, AC97_VOL_MAX);
print("-- recording --\r\n");
while(sampleCnt < SAMPLE_SIZE)
{
SAMPLE1[sampleCnt] = XAC97_ReadFifo(XPAR_AUDIO_CODEC_BASEADDR);
sampleCnt++;
}
//---------------------------------------------//
//--------To Playback --------------------//
if (~pressed & BTN_DOWN){
print("--Playing sample -\r\n");
for(i=0; i< SAMPLE_SIZE; i++){
recorded1 = SAMPLE1;
XAC97_WriteFifo(XPAR_AUDIO_CODEC_BASEADDR, recorded1);
}
print("--done--\r\n");
}
//-------------------------------------------//
Like I said, I can record multiple inputs, and I am able to play them back with no problems, the problem lies when I want to compare them to see if the same word was said by the same person. I am setting ReadFifo equal to an array, and my assumtion was that if the a word was said twice into the mic for two separate inputs and these inputs were stored in different arrays than the arrays should be the same. I found out that this assumption was wrong when I monitored what data was being stored (I was getting values like -10089 198678 67811) it just seems random. I then I took the sum of each array and compared them to see if they were the same. Even if I repeatedly said the same thing in the same tone and volume I was getting extremly different results (1173899756 vs -67324328582) even though when I play back each input they sound identical. I am going to try a few more things, but I just wanted to see if anyone had any suggestions of what might work.