Wavm – Utility for Merging Two wav Files
The goal of this project is to be able to merge two digitized analog recordings in order to increase the quality of the original signal. This is not straigh forward and there are some challenges to meet like:
finding the original synchronization. One of the two wav files likely starts before the other.
maintaining the synchronization. If the original signal source is a magnetic tape recorder or turntable, variations in playback speed make realignment of the waveforms a continuous process. Even crystal based systems such as a MP3 player and the A/D conversion board itself introduce small fluctuations.
confirming that the average signal is an improvement. While totally random noise can be averaged out, periodic noise (60Hz hum) could become worse. As well, the averaing alogrithm itself should be shown to not introduce more noise.
Besides merging (averaging) two similar wav files applications could include:
calibrate a system by comparing a wav file created from the D/A and A/D conversion loop to the original wav file. Signal noise and timing variations will show up in the error file. The error file can be analyzed to help determine the source of the errors.
comparing the quality of a high speed analog copy. If the palyback and recording speed are increased, the channel bandwidth may introduce some distortion. This tool would allow this distortion to be quanitfied.
This project (wavm), like related projects by this author:wava and wavb , is a simple stand alone utility which can be compiled for both Linux and win environments.
Waveform B is the original CD wav file, waveform A is digitized from a Sony CAR Discman. Note the initial dip in the CD output versus the original signal.
In the illustration below, one waveform is the original wav file extracted from a CD using EAC, and the other is the digitized output from a CD player and no attempt was made to adjust the amplitude. This could be done is software.
In the case below, one waveform is the original wav file extracted from a CD using EAC, and the other is the digitized output from a CD player. 30 seconds into the recording, there is a noticable time difference.
Below, two recordings made from the same CD player show a gradual drift in increasing error. (CD player or Abit A/D conversion : which is the cause?).
Work to be done at this stage includes:
improving the search for synchronization – faster – more reliable – fractional sample interval resolution?
algorithm for merging the data - quantify the quality of the merged files
create a set of test wav files for quality testing
restricted to 44.1ksample/second stereo wav files with just one DATA section.
Only the left channel is processed .
NOT designed for comparing MP3 files to wav files.
Filtering and mp3 to wav conversions can introduce phase shifts which may cause this application to not work correctly. This application works in the time domain while most audio functions are concerned mainly with the frequency domain. If a wav file created from an mp3 fails to match the original wav file, this does not mean that the mp3 is poor quality, just that the audio processing changed the waveshape, but the changes may not be perceptable to most people.