DSPRelated.com
Forums

Waveform interpolation

Started by bitrex August 9, 2015
"David Eather" <eather@tpg.com.au> writes:

> On Mon, 10 Aug 2015 05:02:56 +1000, bitrex > <bitrex@de.lete.earthlink.net> wrote: > >> Suppose I have some sampled signal data in a ROM on a >> microcontroller or something, and I'm reading it out to a DAC. >> Let's say that for some reason, I'd like to begin reading this data >> at some random position, go for a while, and then stop at a random >> stopping point and jump to another random position in the ROM and >> continue reading, and so on, to obtain pseudorandom variations on >> the waveform data. >> >> What sort of interpolation algorithm might be appropriate to use in >> a situation like this to smooth the discontinuity between the two >> jump points? > > If it is random data with an equal distribution then no interpolation > is needed and will in fact be a bad thing
David, Excellent observation. Without more information, it's impossible to suggest "good" ways to do this. To the OP: What are you REALLY trying to do?!? -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
bitrex wrote:
> Suppose I have some sampled signal data in a ROM on a microcontroller or > something, and I'm reading it out to a DAC. Let's say that for some > reason, I'd like to begin reading this data at some random position, go > for a while, and then stop at a random stopping point and jump to > another random position in the ROM and continue reading, and so on, to > obtain pseudorandom variations on the waveform data. > > What sort of interpolation algorithm might be appropriate to use in a > situation like this to smooth the discontinuity between the two jump > points?
With arbitrary point values, there is no "easy" solution,other than the crude use of average of the 2 values (last of past points, first of "jump" points). If one had the time between "normal" samples, one could take the previous (say) 5 points,and the "next" (to be used) points and calculate previous slope, and calculate "next" after-"jump" slope. Then use slopes and values to fake intermediate values; might be hokey-sounding transition, but a lot better than the one-point fake mentioned.
Martin Brown wrote:
> On 09/08/2015 20:02, bitrex wrote: > >> Suppose I have some sampled signal data in a ROM on a microcontroller or >> something, and I'm reading it out to a DAC. Let's say that for some >> reason, I'd like to begin reading this data at some random position, go >> for a while, and then stop at a random stopping point and jump to >> another random position in the ROM and continue reading, and so on, to >> obtain pseudorandom variations on the waveform data. > > Does it have to be random to random position? Zero crossing and in the > same direction will get you something that the ear can barely hear. > >> What sort of interpolation algorithm might be appropriate to use in a >> situation like this to smooth the discontinuity between the two jump >> points? > > Force the wavefrom jump to be at a zero crossing and pick up from a zero > crossing with the same sign gradient. >
Slope calculation needed, then; how many points before,and after? How much time (eg: compute power) available between nominal look-up rate?
On 11/08/2015 21:33, Robert Baer wrote:
> Martin Brown wrote: >> On 09/08/2015 20:02, bitrex wrote: >> >>> Suppose I have some sampled signal data in a ROM on a microcontroller or >>> something, and I'm reading it out to a DAC. Let's say that for some >>> reason, I'd like to begin reading this data at some random position, go >>> for a while, and then stop at a random stopping point and jump to >>> another random position in the ROM and continue reading, and so on, to >>> obtain pseudorandom variations on the waveform data. >> >> Does it have to be random to random position? Zero crossing and in the >> same direction will get you something that the ear can barely hear. >> >>> What sort of interpolation algorithm might be appropriate to use in a >>> situation like this to smooth the discontinuity between the two jump >>> points? >> >> Force the wavefrom jump to be at a zero crossing and pick up from a zero >> crossing with the same sign gradient. >> > Slope calculation needed, then; how many points before,and after? > How much time (eg: compute power) available between nominal look-up > rate?
Nearest neighbour forward difference will be good enough. Avoiding any severe discontinuities will make the transition inaudible. (apart from the differing signal content) -- Regards, Martin Brown
Robert Baer  <robertbaer@localnet.com> wrote:

> Slope calculation needed, then; how many points before,and after? > How much time (eg: compute power) available between nominal look-up rate?
Let's see, a 7.5 ips, 2 track, 1/4", tape slice would perform a decent, yet rapid, cross- fade at about 45 degree angle. You don't want to make it shallower than that, as the left-to-right swish starts being audible. The tracks are about 1/10" wide, so I'm going to say ... 75 Hz per inch, 750 Hz per 1/10", or about 0.05 * Nyquist. This may fall under that category of useless trivia, but hey. Steve
On Mon, 10 Aug 2015 20:20:06 +0000 (UTC), spope33@speedymail.org
(Steve Pope) wrote:
>I do not think it's correct to use a constand dB/second slope >on the two signals. Instead, choose a dual-slope that keeps the RMS >power constant.
inverse-square law for most panners
On 11/08/2015 21:30, Robert Baer wrote:
> bitrex wrote: >> Suppose I have some sampled signal data in a ROM on a microcontroller or >> something, and I'm reading it out to a DAC. Let's say that for some >> reason, I'd like to begin reading this data at some random position, go >> for a while, and then stop at a random stopping point and jump to >> another random position in the ROM and continue reading, and so on, to >> obtain pseudorandom variations on the waveform data. >> >> What sort of interpolation algorithm might be appropriate to use in a >> situation like this to smooth the discontinuity between the two jump >> points?
You might be able to get away with nothing. Early CD players used mute if the CRC error was uncorrectable then smarter ones used last sample. You could easily see it on an oscilloscope but for a short glitch event it was all but inaudible. Without knowing the nature of the waveforms being manipulated it is impossible to choose the best way to do it. By comparison the burst of loud almost ultrasonic clicks or boiling mud when DAB/DTV sound goes haywire is really irritating.
> With arbitrary point values, there is no "easy" solution,other than > the crude use of average of the 2 values (last of past points, first of > "jump" points). > If one had the time between "normal" samples, one could take the > previous (say) 5 points,and the "next" (to be used) points and calculate > previous slope, and calculate "next" after-"jump" slope. Then use slopes > and values to fake intermediate values; might be hokey-sounding > transition, but a lot better than the one-point fake mentioned.
Nearest neighbour will be more than good enough on a potentially noisy signal. Derivatives of numeric data are pretty ropey to begin with. -- Regards, Martin Brown