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

Commit

Permalink
Couple of optimization tricks
Browse files Browse the repository at this point in the history
  • Loading branch information
arjo129 committed Aug 13, 2013
1 parent 32df684 commit fbd6da9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions phoneme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
*/
char signal::getPhoneme(){
sample();
if(power()>SILENCE){
unsigned int pp =power();
if(pp>SILENCE){

//Low pass filter for noise removal
int k = complexity(power());
int k = complexity(pp);

overview[6] = overview[5];
overview[5] = overview[4];
overview[4] = overview[3];
Expand All @@ -26,13 +29,12 @@ char signal::getPhoneme(){
#if F_DETECTION > 0
micPower = 0.05 * maxPower() + (1 - 0.05) * micPower;
//Serial.println(micPower)//If you are having trouble with fs

if (micPower > F_CONSTANT/*Use the header file to change this*/) {
return 'f';
}
#endif
zeroCrossingSearch();
//Twiddle with the numbers here if your getting false triggers
//Twiddle with the numbers here if your getting false triggers
//This is the main recognizer part
//Todo: use move values to header file
if(coeff<30 && coeff>20){
Expand Down

0 comments on commit fbd6da9

Please sign in to comment.