Can anyone show me an algorithm of removing white noise from a byte[]
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).
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<buffer.length/2; i++)
{ // 16bit sample size
short curSample = getShort(buffer[i*2], buffer[i*2+1]);
if (curSample > cAmplitude)
{ // Check amplitude
cAmplitude = curSample;
}
}
}
else
{ // 8bit sample size
for (int i=0; i<buffer.length; i++)
{
if (buffer[i] > 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)
{}
};
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.
Thanks.