I have an audio file and read all data from the sound card buffer. Then, I convert byte[]
to float[]
to use them for hamming window. The waveform of the audio is:
after using hamming window:
is the waveform of audio with hamming window right? Where is my mistake?
by the way i use naudio library to process audio:
WaveChannel32 wave = new WaveChannel32(new WaveFileReader("sesDosyası.wav"));
byte []buffer = new byte[wave.length];
float []data = new float[wave.length / 4];
int read = wave.Read(buffer, 0, wave.length);
for (int i = 0; i < read / 4; i++)
{
data[i] = BitConverter.ToSingle(buffer, i * 4); //converting byte to float
chart1.Series["wave"].Points.Add(data[i]); //first waveform
}
for (int j = 0; j < read/4; j++)
{
data[j] = (float)(0.54 - 0.46 * Math.Cos((2 * Math.PI * data[j]) / (read / 4 - 1)));//hamming
chart2.Series["wave"].Points.Add(data[j]); //second waveform
}