Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Troubleshooting

postman42 edited this page Oct 31, 2013 · 1 revision

One thing is that you microphone ADC speed should be more than 20kHz, 40kHz is ideal and ensure the microphone amplitude varies by at least 10 values; Faster does not hurt. The library may need a little modification on your part: Go to phoneme.cpp

In the function char signal::getPhoneme()

You will see the main core of the recognizer. After the line: coeff /= 7;

Add a Serial.println(coeff);

Below this you will see the code which actually classifies the sounds as a letter. My advice is start with "s". The code currently looks like this (the numbers in the latest version are different):



		if(coeff<30 && coeff>20){
			return 'u';
		}
		else {
			if(coeff<33){
				return 'e';
			}
			else{
				if(coeff<46){
					return 'o';
				}
				else{
					if(coeff<60){
						return 'v';
					}
					else{
						if(coeff<80){
							return 'h';
						}
						else{
							if(coeff>80){
								return 's';
							}
							else{
								return 'm';
							}
						}
					}
				}
			}
		}

So when you say "sssss" you will get a series of numbers for coeff. Choose the lowest number. And where it says 80 replace it with the number you get. Judging from you complaint it should be less than 46

if(coeff>80){
	return 's';
}

You might want to reduce the values for the others (otherwise it will not work).

if(coeff<33){
	return 'e';
}
else{
	if(coeff<46){
		return 'o';
	}
		…

Once you have perfected it comment out the code that you added for debug.

For "fffs": After the line: micPower = 0.05 * maxPower() + (1 - 0.05) * micPower; Add a Serial.println(micPower); And proceed to find the value which is most appropriate.

Couple of other things:

  • Ensure you have followed the installation instructions on the wiki
  • If the system is not working due to a fault of the library use the debug sketch, if you get consistently wrong values open phoneme.cpp and mess about with the numbers (i.e. increase/decrease them by 10).

Other issues and you can file a bug report I should get back to you within 2 working days.

Clone this wiki locally