     } while (ww < wend);
     yhat = yhat64 / 32768;
 
-    error[h] = x[gg+h]-yhat;
+    error[h] = Mic[gg+h]-yhat;
     xtdl = xtdl + psi;
     mu0 = (67108864*mu)/xtdl;
 

void getBuffer1();
void playData();
void displayData();
void NLMS_AEC(int16_t *x);

// GUItool: begin automatically generated code
AudioInputI2S            Mic;           //microphone

        //read one 128 block of samples and copy it into array
        memcpy((byte*)pablock+(256*(x-1)),Memory.readBuffer(),256);
        Memory.freeBuffer(); // free buffer memory
//        NLMS_AEC(pablock, pablock);
//        playData(Perror,0); // play 128 block from buffered array
        l = 1; // set n to 1 to get out of while loop
      }//end if 
    }//end while 
    NLMS_AEC(pablock, pablock);
    playData(Perror,0); // play 128 block from buffered array
    l = 0;
   Memory.clear(); // clear all audio memory 
