I have two signals (out of wav files), both are mono wav files of 37500 Hz sample rate.

File 1 is output.wav: file 1 'output.wav'

File 2 is saved_mono.wav: file 2 'saved_mono.wav'

I apply superimposing ("+") operation for the two Discrete signals:

    // shiftedSignal is output.wav
    // outSignal is saved_mono.wav
    
    //This is how I read it:
    WaveFile shiftedWav;
    using (var stream = new FileStream("output.wav", FileMode.Open))
    {
        shiftedWav = new WaveFile(stream);
    }
    DiscreteSignal shiftedSignal = shiftedWav[Channels.Left];

    DiscreteSignal mergedSignal = shiftedSignal + outSignal;

    waveFileOut = new WaveFile(mergedSignal);
    using (var stream = new FileStream("merged.wav", FileMode.Create))
    {
        waveFileOut.SaveTo(stream);
    }

As the result, I have merged.wav file and it has a giant peak in the middle: superimposing result - merged.wav file with a giant peak

Both input wav files have the same sample rate of 37500 and the same bitrate of 600 kbps.

Where did it come from and how do I fix it?

Just to make sure, I tried to concatenate these signals:

DiscreteSignal mergedSignal = shiftedSignal.Concatenate(outSignal);

And it comes out OK: Concatenate operation

0

There are 0 best solutions below