title: java - Remove noise from byte array wav file
body: <p>Can anyone show me an algorithm of removing white noise from a <code>byte[]</code> sound? I work for a personal audio recording app for android and I use android API for recording. Below is the method used to write the recording to file (in wav format).</p>
  
  <pre><code> private AudioRecord.OnRecordPositionUpdateListener updateListener = new AudioRecord.OnRecordPositionUpdateListener()
   {
      public void onPeriodicNotification(AudioRecord recorder)
      {
          aRecorder.read(buffer, 0, buffer.length);
          try
          { 
              fWriter.write(buffer); // Write buffer to file
              payloadSize += buffer.length;
              if (bSamples == 16)
              {
                  for (int i=0; i&lt;buffer.length/2; i++)
                  { // 16bit sample size
                      short curSample = getShort(buffer[i*2], buffer[i*2+1]);
                      if (curSample &gt; cAmplitude)
                      { // Check amplitude
                          cAmplitude = curSample;
                      }
                  }
              }
              else
              { // 8bit sample size
                  for (int i=0; i&lt;buffer.length; i++)
                  {
                      if (buffer[i] &gt; cAmplitude)
                      { // Check amplitude
                          cAmplitude = buffer[i];
                      }
                  }
              }
          }
          catch (IOException e)
          {
              Log.e(AudioRecorder2.class.getName(), "Error occured in updateListener, recording is aborted");
          }
      }
  
      public void onMarkerReached(AudioRecord recorder)
      {}
  };
  </code></pre>
  
  <p>I want to apply some transformations to buffer to remove the white noise which can be heard during playback of the recording.
  If anybody know some algorithm/link to some low-pass filter (or anything else that might be helpful), please help.</p>
  
  <p>Thanks.</p>