Hi I am looking at fixing corrupt audio files by interpolating the wave pattern that should be present in place of the corrupt segment. I have been looking at 'cubic interpolation' but it seems to me that this scheme is only useful in interpolating individual sample values, not in interpolating whole missing segments of data. Am I correct in this thinking or is it possible to use this scheme to interpolate the missing segment? If it is not suitable, are there any other algorithms/schemes that may be useful? Any help is much appreciated Thankyou very much David Saunders
Signal Interpolation
Started by ●November 2, 2004
Reply by ●November 2, 20042004-11-02
On 2004-11-02 16:17:22 +0100, Dave_Saunders9@hotmail.com (DavidSaunders9) said:> I am looking at fixing corrupt audio files by interpolating the wave > pattern that should be present in place of the corrupt segment.You're right that cubic interpolation usually refers to individual samples. You could replace the missing segment by adjacent blocks of data (that's how CD players usually do this), or devise a more elaborate copy & paste replacement procedure. I don't think there's a standard for this (at least not for pure PCM samples)... -- Stephan M. Bernsee http://www.dspdimension.com
Reply by ●November 2, 20042004-11-02
Dave_Saunders9@hotmail.com (DavidSaunders9) writes:> Hi > > I am looking at fixing corrupt audio files by interpolating the wave > pattern that should be present in place of the corrupt segment. I have > been looking at 'cubic interpolation' but it seems to me that this > scheme is only useful in interpolating individual sample values, not > in interpolating whole missing segments of data. Am I correct in this > thinking or is it possible to use this scheme to interpolate the > missing segment? If it is not suitable, are there any other > algorithms/schemes that may be useful? > > Any help is much appreciated > > Thankyou very much > > David SaundersDavid, You might want to check out Alex Souppa's thesis on the subject: http://www.music.miami.edu/mue/Research/asouppa/index.htm -- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124
Reply by ●November 2, 20042004-11-02
On 2004-11-02 17:23:57 +0100, Randy Yates <randy.yates@sonyericsson.com> said:> David, > > You might want to check out Alex Souppa's thesis on the > subject: > > http://www.music.miami.edu/mue/Research/asouppa/index.htmHey Randy, thanks for that pointer, sounds interesting. Dave, you could probably also use reverberation to create the missing data. Alex' thesis sound examples suggest that this might be a feasible approach, too. -- Stephan M. Bernsee http://www.dspdimension.com
Reply by ●November 3, 20042004-11-03
DavidSaunders9 wrote:> I am looking at fixing corrupt audio files by interpolating the wave > pattern that should be present in place of the corrupt segment.I'd start with this approach: take a neighbour region of desired length from before the corrupt segment. compare it with a neighbour region from after the corrupt segment. build FFTs from both, build a new FFT signal where at every frequency bin newFFT=min(FFT1,FFT2) restore the time sequence as iFFT(newFFT). I guess that this should provide an artificial segment which sounds pretty much like the original because it contains most frequency components. But since it doesn't repeat short peaks or bumps, it doesn't sound as much like an echo. I never tried this, however. If it works well, let me know... Bernhard -- please modify email address by replacing deadspam => foerstergroup com => de
Reply by ●November 3, 20042004-11-03
DavidSaunders9 wrote:> Hi > > I am looking at fixing corrupt audio files by interpolating the wave > pattern that should be present in place of the corrupt segment. I have > been looking at 'cubic interpolation' but it seems to me that this > scheme is only useful in interpolating individual sample values, not > in interpolating whole missing segments of data. Am I correct in this > thinking or is it possible to use this scheme to interpolate the > missing segment? If it is not suitable, are there any other > algorithms/schemes that may be useful? > > Any help is much appreciated > > Thankyou very much > > David SaundersWhat about this link: "Interpolation of long gaps in audio signals..." http://www.elec.qmul.ac.uk/dafx03/proceedings/pdfs/dafx10.pdf Bernhard
Reply by ●November 3, 20042004-11-03
Bernhard Holzmayer wrote: ...> build a new FFT signal where at every frequency bin newFFT=min(FFT1,FFT2)What's the min of two complex numbers?
Reply by ●November 3, 20042004-11-03
DavidSaunders9 wrote:> Hi > > I am looking at fixing corrupt audio files by interpolating the wave > pattern that should be present in place of the corrupt segment. I have > been looking at 'cubic interpolation' but it seems to me that this > scheme is only useful in interpolating individual sample values, not > in interpolating whole missing segments of data. Am I correct in this > thinking or is it possible to use this scheme to interpolate the > missing segment? If it is not suitable, are there any other > algorithms/schemes that may be useful?Immagine you had a pure sine wave of unknown frequency, phase and amplitude. You know that some stretches of this sine wave are zeroed out (for whatever reason), and you want to fix that. What do you do? A sensible idea would be to take the recursive equation for an oscillator, and find the coefficients with least-squares which result in something close to your sine wave (exact, if the sine wave samples contain no error). Then, after you have initialized the oscillator (with the coefficients and the last two samples of the sine wave before the zero stretch), just take the output of the oscillator to reconstruct the sine wave. For a complex signal (music or speech for example), you may assume that it is the sum of several exponentially (or otherwise) damped sine waves with constant frequency (at least for short stationary stretches, this is quite a sensible assumption). Now you can find (again with least-squares, but there are better algorithms) the coefficients for all oscillators by looking at a bunch of samples from the signal just before (and after) the corrupted stretch. The fancy name for this is extrapolation (or interpolation) with AR modelling. W. Etter,S. J. Godsill and I. Kauppinen are people who have done interesting work on this (try searching DAFx, AES and IEEE). Regards, Andor
Reply by ●November 3, 20042004-11-03
On 2004-11-03 15:45:39 +0100, Andor Bariska <an2or@nospam.net> said:> [snip] > For a complex signal (music or speech for example), you may assume that > it is the sum of several exponentially (or otherwise) damped sine waves > with constant frequency (at least for short stationary stretches, this > is quite a sensible assumption). Now you can find (again with > least-squares, but there are better algorithms) the coefficients for > all oscillators by looking at a bunch of samples from the signal just > before (and after) the corrupted stretch. > [snip]To do this right you need to do the same backwards in time from the end of the missing segment and blend the sinusoidal parameters between the two sets. Then you'll have to sort out ambiguity (what oscillator at the beginning of the gap corresponds to which one at the end)... this can be fairly complicated it you want to do it right. For this, you could estimate sweep and ramp rates of the sinusoids to get a good match, or use a HMM for tracking them across the gap. You can probably invest as much time as you wish into "solving" this problem. -- Stephan M. Bernsee http://www.dspdimension.com
Reply by ●November 3, 20042004-11-03
Stephan M. Bernsee wrote:> On 2004-11-03 15:45:39 +0100, Andor Bariska <an2or@nospam.net> said: > >> [snip] >> For a complex signal (music or speech for example), you may assume >> that it is the sum of several exponentially (or otherwise) damped sine >> waves with constant frequency (at least for short stationary >> stretches, this is quite a sensible assumption). Now you can find >> (again with least-squares, but there are better algorithms) the >> coefficients for all oscillators by looking at a bunch of samples from >> the signal just before (and after) the corrupted stretch. >> [snip] > > > To do this right you need to do the same backwards in time from the end > of the missing segment and blend the sinusoidal parameters between the > two sets. Then you'll have to sort out ambiguity (what oscillator at the > beginning of the gap corresponds to which one at the end)... this can be > fairly complicated it you want to do it right.There is no need to do that - one can just crossfade the (forwards and backwards) oscillator outputs. There are however many improvements possible on the crude process I sketched above. Check the references I gave. Regards, Andor