Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.dsp > #28076 > unrolled thread

Waveform interpolation

Started bybitrex <bitrex@de.lete.earthlink.net>
First post2015-08-09 15:02 -0400
Last post2015-08-12 10:18 +0100
Articles 20 on this page of 27 — 16 participants

Back to article view | Back to comp.dsp


Contents

  Waveform interpolation bitrex <bitrex@de.lete.earthlink.net> - 2015-08-09 15:02 -0400
    Re: Waveform interpolation Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-08-09 20:36 +0100
      Re: Waveform interpolation Robert Baer <robertbaer@localnet.com> - 2015-08-11 13:33 -0700
        Re: Waveform interpolation Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-08-11 22:29 +0100
        Re: Waveform interpolation spope33@speedymail.org (Steve Pope) - 2015-08-12 05:14 +0000
    Re: Waveform interpolation rickman <gnuarm@gmail.com> - 2015-08-09 15:40 -0400
    Re: Waveform interpolation Les Cargill <lcargill99@comcast.com> - 2015-08-09 16:12 -0500
    Re: Waveform interpolation John Larkin <jlarkin@highlandtechnology.com> - 2015-08-09 14:36 -0700
      Re: Waveform interpolation John Larkin <jlarkin@highlandtechnology.com> - 2015-08-09 14:41 -0700
        Re: Waveform interpolation Les Cargill <lcargill99@comcast.com> - 2015-08-09 17:36 -0500
          Re: Waveform interpolation robert bristow-johnson <rbj@audioimagination.com> - 2015-08-09 21:25 -0400
            Re: Waveform interpolation bitrex <bitrex@de.lete.earthlink.net> - 2015-08-09 22:09 -0400
        Re: Waveform interpolation David Brown <david.brown@hesbynett.no> - 2015-08-10 09:26 +0200
          Re: Waveform interpolation bitrex <bitrex@de.lete.earthlink.net> - 2015-08-10 06:58 -0400
            Re: Waveform interpolation David Brown <david.brown@hesbynett.no> - 2015-08-10 14:31 +0200
              Re: Waveform interpolation bitrex <bitrex@de.lete.earthlink.net> - 2015-08-10 09:45 -0400
                Re: Waveform interpolation krw <krw@nowhere.com> - 2015-08-10 12:53 -0400
            Re: Waveform interpolation spope33@speedymail.org (Steve Pope) - 2015-08-10 20:20 +0000
              Re: Waveform interpolation DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2015-08-10 16:35 -0400
              Re: Waveform interpolation Rev. 11D Meow! <rev.11d.meow@gmail.com> - 2015-08-11 23:03 -0700
    Re: Waveform interpolation glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-10 06:45 +0000
      Re: Waveform interpolation bitrex <bitrex@de.lete.earthlink.net> - 2015-08-10 07:10 -0400
    Re: Waveform interpolation Jasen Betts <jasen@xnet.co.nz> - 2015-08-10 08:16 +0000
    Re: Waveform interpolation "David Eather" <eather@tpg.com.au> - 2015-08-11 14:15 +1000
      Re: Waveform interpolation Randy Yates <yates@digitalsignallabs.com> - 2015-08-11 09:30 -0400
    Re: Waveform interpolation Robert Baer <robertbaer@localnet.com> - 2015-08-11 13:30 -0700
      Re: Waveform interpolation Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-08-12 10:18 +0100

Page 1 of 2  [1] 2  Next page →


#28076 — Waveform interpolation

Frombitrex <bitrex@de.lete.earthlink.net>
Date2015-08-09 15:02 -0400
SubjectWaveform interpolation
Message-ID<55c7a3de$0$29180$4c5ecfc7@frugalusenet.com>
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?

[toc] | [next] | [standalone]


#28078

FromMartin Brown <|||newspam|||@nezumi.demon.co.uk>
Date2015-08-09 20:36 +0100
Message-ID<mq8a4k$k08$1@speranza.aioe.org>
In reply to#28076
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.

-- 
Regards,
Martin Brown

[toc] | [prev] | [next] | [standalone]


#28102

FromRobert Baer <robertbaer@localnet.com>
Date2015-08-11 13:33 -0700
Message-ID<1_syx.30009$2J4.22714@fx02.iad>
In reply to#28078
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?

[toc] | [prev] | [next] | [standalone]


#28107

FromMartin Brown <|||newspam|||@nezumi.demon.co.uk>
Date2015-08-11 22:29 +0100
Message-ID<mqdpf6$i2r$1@speranza.aioe.org>
In reply to#28102
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

[toc] | [prev] | [next] | [standalone]


#28113

Fromspope33@speedymail.org (Steve Pope)
Date2015-08-12 05:14 +0000
Message-ID<mqeknk$6m4$1@blue-new.rahul.net>
In reply to#28102
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

[toc] | [prev] | [next] | [standalone]


#28079

Fromrickman <gnuarm@gmail.com>
Date2015-08-09 15:40 -0400
Message-ID<mq8a87$3pp$2@dont-email.me>
In reply to#28076
On 8/9/2015 3:02 PM, 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?

What Martin said, or you can use a fade-in, fade-out perhaps, or a 
cross-fade where the two fades work at the same time.

I think the answer to this question depends greatly on the waveform and 
its use.

-- 

Rick

[toc] | [prev] | [next] | [standalone]


#28080

FromLes Cargill <lcargill99@comcast.com>
Date2015-08-09 16:12 -0500
Message-ID<mq8fjl$o9k$1@dont-email.me>
In reply to#28076
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?

DAW programs use a "crossfade" - you ramp the first signal down at X 
db/sec while ramping the second signal up at the same X db/sec.

The amount of time for the crossfade would then be determined by the
fade-slope - X. If X is 6 db/sec, then 96 dB is 16 seconds.

You probably want more slope than that.

This to address discontinuities caused by a square "butt splice",
just as in tape splicing when you'd use an angled cut.

Adding dither may be required, depending.

-- 
Les Cargill

[toc] | [prev] | [next] | [standalone]


#28081

FromJohn Larkin <jlarkin@highlandtechnology.com>
Date2015-08-09 14:36 -0700
Message-ID<28hfsadm0apdgtqa1caqoe2ti11ajilk14@4ax.com>
In reply to#28076
On Sun, 9 Aug 2015 15:02:56 -0400, 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?

Assuming that your "position" (ie, time) variable has finer resolution
than your lookup table, you can use simple linear interpolation.

Linear interpolation between two points can never result in an output
bigger than either point, whereas an ideal filter can. So for better
approximation of a good sample reconstruction filter, you need to
account for more than two table points, and use something like a cubic
or higher order spline interpolation. That may not matter in your
situation.

https://dl.dropboxusercontent.com/u/53724080/Circuits/Filters/Wayback_Machine/Interpolation_Error.JPG


-- 

John Larkin         Highland Technology, Inc
lunatic fringe electronics

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

[toc] | [prev] | [next] | [standalone]


#28082

FromJohn Larkin <jlarkin@highlandtechnology.com>
Date2015-08-09 14:41 -0700
Message-ID<93ifsapvtvu6qn2cl17qj20hmeus2v0oaq@4ax.com>
In reply to#28081
On Sun, 09 Aug 2015 14:36:42 -0700, John Larkin
<jlarkin@highlandtechnology.com> wrote:

>On Sun, 9 Aug 2015 15:02:56 -0400, 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?
>
>Assuming that your "position" (ie, time) variable has finer resolution
>than your lookup table, you can use simple linear interpolation.
>
>Linear interpolation between two points can never result in an output
>bigger than either point, whereas an ideal filter can. So for better
>approximation of a good sample reconstruction filter, you need to
>account for more than two table points, and use something like a cubic
>or higher order spline interpolation. That may not matter in your
>situation.
>
>https://dl.dropboxusercontent.com/u/53724080/Circuits/Filters/Wayback_Machine/Interpolation_Error.JPG


Or maybe I misunderstood the problem. If you want to smooth the jump
between the two waveform segments (and not between points within a
waveform) a lowpass filter might work. Or a fader type algorithm,
depending on your requirements. The point interpolator would still
help, to better map the table output to the time variable.


-- 

John Larkin         Highland Technology, Inc
lunatic fringe electronics

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

[toc] | [prev] | [next] | [standalone]


#28083

FromLes Cargill <lcargill99@comcast.com>
Date2015-08-09 17:36 -0500
Message-ID<mq8kg3$cka$2@dont-email.me>
In reply to#28082
John Larkin wrote:
> On Sun, 09 Aug 2015 14:36:42 -0700, John Larkin
> <jlarkin@highlandtechnology.com> wrote:
>
>> On Sun, 9 Aug 2015 15:02:56 -0400, 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?
>>
>> Assuming that your "position" (ie, time) variable has finer resolution
>> than your lookup table, you can use simple linear interpolation.
>>
>> Linear interpolation between two points can never result in an output
>> bigger than either point, whereas an ideal filter can. So for better
>> approximation of a good sample reconstruction filter, you need to
>> account for more than two table points, and use something like a cubic
>> or higher order spline interpolation. That may not matter in your
>> situation.
>>
>> https://dl.dropboxusercontent.com/u/53724080/Circuits/Filters/Wayback_Machine/Interpolation_Error.JPG
>
>
> Or maybe I misunderstood the problem. If you want to smooth the jump
> between the two waveform segments (and not between points within a
> waveform) a lowpass filter might work. Or a fader type algorithm,
> depending on your requirements. The point interpolator would still
> help, to better map the table output to the time variable.
>
>

A "crossfade" is the general solution to the problem. It carries over
from tape editing. Simple.

http://stash.reaper.fm/14554/crossfade_shape_examples.png

-- 
Les Cargill

[toc] | [prev] | [next] | [standalone]


#28084

Fromrobert bristow-johnson <rbj@audioimagination.com>
Date2015-08-09 21:25 -0400
Message-ID<mq8uf4$7os$1@dont-email.me>
In reply to#28083
On 8/9/15 6:36 PM, Les Cargill wrote:
> John Larkin wrote:
>> On Sun, 09 Aug 2015 14:36:42 -0700, John Larkin
>> <jlarkin@highlandtechnology.com> wrote:
>>
>>> On Sun, 9 Aug 2015 15:02:56 -0400, 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?
>>>
>>> Assuming that your "position" (ie, time) variable has finer resolution
>>> than your lookup table, you can use simple linear interpolation.
>>>
>>> Linear interpolation between two points can never result in an output
>>> bigger than either point, whereas an ideal filter can. So for better
>>> approximation of a good sample reconstruction filter, you need to
>>> account for more than two table points, and use something like a cubic
>>> or higher order spline interpolation. That may not matter in your
>>> situation.
>>>
>>> https://dl.dropboxusercontent.com/u/53724080/Circuits/Filters/Wayback_Machine/Interpolation_Error.JPG
>>>
>>
>>
>> Or maybe I misunderstood the problem. If you want to smooth the jump
>> between the two waveform segments (and not between points within a
>> waveform) a lowpass filter might work. Or a fader type algorithm,
>> depending on your requirements. The point interpolator would still
>> help, to better map the table output to the time variable.
>>
>>
>
> A "crossfade" is the general solution to the problem. It carries over
> from tape editing. Simple.
>

i'll jump on board with the crossfading thing.  so rex, this is what you 
should do if you want the least "glitchy" waveform splices or jumps.  it 
requires having a buffer of ancillary metadata alongside of your sampled 
signal data.  this metadata buffer would not need to be as large as the 
waveform sample data, but what it would contain is pitch detection data 
for it's associated portion of the waveform data.  if this is stored in 
ROM like the sample data, it might be pre-calculated.  that might not be 
so good.

pitch or period estimators can reasonably easy to design using AMDF (or 
better yet ASDF - Average Squared Difference Function) or some kinda 
autocorrelation function.  (pitch detection algs are a whole 'nother topic.)

without the metadata, with some contemporaneous work, you can correlate 
the spot where you are expecting to splice from to various possible 
spots around the "random" place you intend to splice to.

using ancillary metadata, you are always aware of the period length (if 
it's not periodic, it's the splice displacement that is the "best 
splice" by some measure, like how good the correlation is).  then 
between the splice-from spot to the proposed splice-to spot, compute the 
mean period of all of the waveform data between the two spots, then 
adjust the splice-to spot a little earlier or later to make it an 
integer number of mean periods.


now, in all cases, whether the splice is good or bad, *crossfade* from 
the splice-from spot to the splice-to spot.  there are issues regarding 
that.  if the correlation between the two spots is very good, then you 
want a complementary-voltage splice.  but if the splice is very bad (but 
it's the best you can do with the data in the neighborhoods of the two 
spots) like if it was white noise, then the splice should be a 
complementary-power splice.  and you can go in between the two extremes. 
  i said something about this a couple years ago on the music-dsp list. 
  i can dig it up if you want.   Olli Niemato had some similar results.



-- 

r b-j                  rbj@audioimagination.com

"Imagination is more important than knowledge."

[toc] | [prev] | [next] | [standalone]


#28085

Frombitrex <bitrex@de.lete.earthlink.net>
Date2015-08-09 22:09 -0400
Message-ID<55c807d6$0$14350$4c5ecfc7@frugalusenet.com>
In reply to#28084
On 8/9/2015 9:25 PM, robert bristow-johnson wrote:
> On 8/9/15 6:36 PM, Les Cargill wrote:
>> John Larkin wrote:
>>> On Sun, 09 Aug 2015 14:36:42 -0700, John Larkin
>>> <jlarkin@highlandtechnology.com> wrote:
>>>
>>>> On Sun, 9 Aug 2015 15:02:56 -0400, 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?
>>>>
>>>> Assuming that your "position" (ie, time) variable has finer resolution
>>>> than your lookup table, you can use simple linear interpolation.
>>>>
>>>> Linear interpolation between two points can never result in an output
>>>> bigger than either point, whereas an ideal filter can. So for better
>>>> approximation of a good sample reconstruction filter, you need to
>>>> account for more than two table points, and use something like a cubic
>>>> or higher order spline interpolation. That may not matter in your
>>>> situation.
>>>>
>>>> https://dl.dropboxusercontent.com/u/53724080/Circuits/Filters/Wayback_Machine/Interpolation_Error.JPG
>>>>
>>>>
>>>
>>>
>>> Or maybe I misunderstood the problem. If you want to smooth the jump
>>> between the two waveform segments (and not between points within a
>>> waveform) a lowpass filter might work. Or a fader type algorithm,
>>> depending on your requirements. The point interpolator would still
>>> help, to better map the table output to the time variable.
>>>
>>>
>>
>> A "crossfade" is the general solution to the problem. It carries over
>> from tape editing. Simple.
>>
>
> i'll jump on board with the crossfading thing.  so rex, this is what you
> should do if you want the least "glitchy" waveform splices or jumps.  it
> requires having a buffer of ancillary metadata alongside of your sampled
> signal data.  this metadata buffer would not need to be as large as the
> waveform sample data, but what it would contain is pitch detection data
> for it's associated portion of the waveform data.  if this is stored in
> ROM like the sample data, it might be pre-calculated.  that might not be
> so good.
>
> pitch or period estimators can reasonably easy to design using AMDF (or
> better yet ASDF - Average Squared Difference Function) or some kinda
> autocorrelation function.  (pitch detection algs are a whole 'nother
> topic.)
>
> without the metadata, with some contemporaneous work, you can correlate
> the spot where you are expecting to splice from to various possible
> spots around the "random" place you intend to splice to.
>
> using ancillary metadata, you are always aware of the period length (if
> it's not periodic, it's the splice displacement that is the "best
> splice" by some measure, like how good the correlation is).  then
> between the splice-from spot to the proposed splice-to spot, compute the
> mean period of all of the waveform data between the two spots, then
> adjust the splice-to spot a little earlier or later to make it an
> integer number of mean periods.
>
>
> now, in all cases, whether the splice is good or bad, *crossfade* from
> the splice-from spot to the splice-to spot.  there are issues regarding
> that.  if the correlation between the two spots is very good, then you
> want a complementary-voltage splice.  but if the splice is very bad (but
> it's the best you can do with the data in the neighborhoods of the two
> spots) like if it was white noise, then the splice should be a
> complementary-power splice.  and you can go in between the two extremes.
>   i said something about this a couple years ago on the music-dsp list.
>   i can dig it up if you want.   Olli Niemato had some similar results.
>
>

Thank for the input - this will take some time to digest but it looks 
like I definitely have something to work with here.

[toc] | [prev] | [next] | [standalone]


#28087

FromDavid Brown <david.brown@hesbynett.no>
Date2015-08-10 09:26 +0200
Message-ID<mq9jks$2av$1@dont-email.me>
In reply to#28082
On 09/08/15 23:41, John Larkin wrote:
> On Sun, 09 Aug 2015 14:36:42 -0700, John Larkin
> <jlarkin@highlandtechnology.com> wrote:
> 
>> On Sun, 9 Aug 2015 15:02:56 -0400, 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?
>>
>> Assuming that your "position" (ie, time) variable has finer resolution
>> than your lookup table, you can use simple linear interpolation.
>>
>> Linear interpolation between two points can never result in an output
>> bigger than either point, whereas an ideal filter can. So for better
>> approximation of a good sample reconstruction filter, you need to
>> account for more than two table points, and use something like a cubic
>> or higher order spline interpolation. That may not matter in your
>> situation.
>>
>> https://dl.dropboxusercontent.com/u/53724080/Circuits/Filters/Wayback_Machine/Interpolation_Error.JPG
> 
> 
> Or maybe I misunderstood the problem. If you want to smooth the jump
> between the two waveform segments (and not between points within a
> waveform) a lowpass filter might work. Or a fader type algorithm,
> depending on your requirements. The point interpolator would still
> help, to better map the table output to the time variable.
> 
> 

A key point, I think, is whether you know about the jumps in advance.
If they are predictable, then you can use future jump points in your
interpolation for better results.  Another issue is whether or not you
can use the next point from the first section during the jumps - that
will make the crossfade smoother.

You (bitrex) say you want to use a small 8-bit micro - unless your
frequencies are very low, consider using a small 32-bit micro instead so
that you can use cubic interpolation rather than linear.  Cubics mean a
bit more maths to figure out, and quite a bit more calculation on the
processor (and with larger data sizes - hence the recommendation for a
32-bit cpu).  But they give smoother outputs and more freedom for
optimisation (such as minimising different derivatives) than linear
interpolation.

[toc] | [prev] | [next] | [standalone]


#28089

Frombitrex <bitrex@de.lete.earthlink.net>
Date2015-08-10 06:58 -0400
Message-ID<55c883d8$0$28413$4c5ecfc7@frugalusenet.com>
In reply to#28087
On 8/10/2015 3:26 AM, David Brown wrote:
> On 09/08/15 23:41, John Larkin wrote:
>> On Sun, 09 Aug 2015 14:36:42 -0700, John Larkin
>> <jlarkin@highlandtechnology.com> wrote:
>>
>>> On Sun, 9 Aug 2015 15:02:56 -0400, 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?
>>>
>>> Assuming that your "position" (ie, time) variable has finer resolution
>>> than your lookup table, you can use simple linear interpolation.
>>>
>>> Linear interpolation between two points can never result in an output
>>> bigger than either point, whereas an ideal filter can. So for better
>>> approximation of a good sample reconstruction filter, you need to
>>> account for more than two table points, and use something like a cubic
>>> or higher order spline interpolation. That may not matter in your
>>> situation.
>>>
>>> https://dl.dropboxusercontent.com/u/53724080/Circuits/Filters/Wayback_Machine/Interpolation_Error.JPG
>>
>>
>> Or maybe I misunderstood the problem. If you want to smooth the jump
>> between the two waveform segments (and not between points within a
>> waveform) a lowpass filter might work. Or a fader type algorithm,
>> depending on your requirements. The point interpolator would still
>> help, to better map the table output to the time variable.
>>
>>
>
> A key point, I think, is whether you know about the jumps in advance.
> If they are predictable, then you can use future jump points in your
> interpolation for better results.  Another issue is whether or not you
> can use the next point from the first section during the jumps - that
> will make the crossfade smoother.
>
> You (bitrex) say you want to use a small 8-bit micro - unless your
> frequencies are very low, consider using a small 32-bit micro instead so
> that you can use cubic interpolation rather than linear.  Cubics mean a
> bit more maths to figure out, and quite a bit more calculation on the
> processor (and with larger data sizes - hence the recommendation for a
> 32-bit cpu).  But they give smoother outputs and more freedom for
> optimisation (such as minimising different derivatives) than linear
> interpolation.
>

In the application that I'm thinking of, the output will eventually be 
driving a fairly large piezoelectric or magnetic transducer.  I think 
it's possible that the inertia of the transducer itself in this case may 
itself act sufficiently as a low-pass filter that the jump points will 
not be noticeable in the output even with just some kind of first-order 
interpolation.  We'll see.

[toc] | [prev] | [next] | [standalone]


#28091

FromDavid Brown <david.brown@hesbynett.no>
Date2015-08-10 14:31 +0200
Message-ID<mqa5gg$vcd$1@dont-email.me>
In reply to#28089
On 10/08/15 12:58, bitrex wrote:
> On 8/10/2015 3:26 AM, David Brown wrote:
>> On 09/08/15 23:41, John Larkin wrote:
>>> On Sun, 09 Aug 2015 14:36:42 -0700, John Larkin
>>> <jlarkin@highlandtechnology.com> wrote:
>>>
>>>> On Sun, 9 Aug 2015 15:02:56 -0400, 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?
>>>>
>>>> Assuming that your "position" (ie, time) variable has finer resolution
>>>> than your lookup table, you can use simple linear interpolation.
>>>>
>>>> Linear interpolation between two points can never result in an output
>>>> bigger than either point, whereas an ideal filter can. So for better
>>>> approximation of a good sample reconstruction filter, you need to
>>>> account for more than two table points, and use something like a cubic
>>>> or higher order spline interpolation. That may not matter in your
>>>> situation.
>>>>
>>>> https://dl.dropboxusercontent.com/u/53724080/Circuits/Filters/Wayback_Machine/Interpolation_Error.JPG
>>>>
>>>
>>>
>>> Or maybe I misunderstood the problem. If you want to smooth the jump
>>> between the two waveform segments (and not between points within a
>>> waveform) a lowpass filter might work. Or a fader type algorithm,
>>> depending on your requirements. The point interpolator would still
>>> help, to better map the table output to the time variable.
>>>
>>>
>>
>> A key point, I think, is whether you know about the jumps in advance.
>> If they are predictable, then you can use future jump points in your
>> interpolation for better results.  Another issue is whether or not you
>> can use the next point from the first section during the jumps - that
>> will make the crossfade smoother.
>>
>> You (bitrex) say you want to use a small 8-bit micro - unless your
>> frequencies are very low, consider using a small 32-bit micro instead so
>> that you can use cubic interpolation rather than linear.  Cubics mean a
>> bit more maths to figure out, and quite a bit more calculation on the
>> processor (and with larger data sizes - hence the recommendation for a
>> 32-bit cpu).  But they give smoother outputs and more freedom for
>> optimisation (such as minimising different derivatives) than linear
>> interpolation.
>>
> 
> In the application that I'm thinking of, the output will eventually be
> driving a fairly large piezoelectric or magnetic transducer.  I think
> it's possible that the inertia of the transducer itself in this case may
> itself act sufficiently as a low-pass filter that the jump points will
> not be noticeable in the output even with just some kind of first-order
> interpolation.  We'll see.

Mechanics often act as a low-pass filter (and of course you can use a
filter in the analogue electronics) - it could well be good enough for
the job.

But using a 32-bit micro could give you more flexibility - small Cortex
M devices are often cheaper than most 8-bit microcontrollers these days,
and certainly I find they are now usually a better choice.  Of course
there could be other concerns - package types, familiarity, existing
code bases, peripherals, voltage ranges, etc., that make your 8-bit
device a better choice.

[toc] | [prev] | [next] | [standalone]


#28092

Frombitrex <bitrex@de.lete.earthlink.net>
Date2015-08-10 09:45 -0400
Message-ID<55c8ab01$0$26292$4c5ecfc7@frugalusenet.com>
In reply to#28091
On 8/10/2015 8:31 AM, David Brown wrote:
> On 10/08/15 12:58, bitrex wrote:
>> On 8/10/2015 3:26 AM, David Brown wrote:
>>> On 09/08/15 23:41, John Larkin wrote:
>>>> On Sun, 09 Aug 2015 14:36:42 -0700, John Larkin
>>>> <jlarkin@highlandtechnology.com> wrote:
>>>>
>>>>> On Sun, 9 Aug 2015 15:02:56 -0400, 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?
>>>>>
>>>>> Assuming that your "position" (ie, time) variable has finer resolution
>>>>> than your lookup table, you can use simple linear interpolation.
>>>>>
>>>>> Linear interpolation between two points can never result in an output
>>>>> bigger than either point, whereas an ideal filter can. So for better
>>>>> approximation of a good sample reconstruction filter, you need to
>>>>> account for more than two table points, and use something like a cubic
>>>>> or higher order spline interpolation. That may not matter in your
>>>>> situation.
>>>>>
>>>>> https://dl.dropboxusercontent.com/u/53724080/Circuits/Filters/Wayback_Machine/Interpolation_Error.JPG
>>>>>
>>>>
>>>>
>>>> Or maybe I misunderstood the problem. If you want to smooth the jump
>>>> between the two waveform segments (and not between points within a
>>>> waveform) a lowpass filter might work. Or a fader type algorithm,
>>>> depending on your requirements. The point interpolator would still
>>>> help, to better map the table output to the time variable.
>>>>
>>>>
>>>
>>> A key point, I think, is whether you know about the jumps in advance.
>>> If they are predictable, then you can use future jump points in your
>>> interpolation for better results.  Another issue is whether or not you
>>> can use the next point from the first section during the jumps - that
>>> will make the crossfade smoother.
>>>
>>> You (bitrex) say you want to use a small 8-bit micro - unless your
>>> frequencies are very low, consider using a small 32-bit micro instead so
>>> that you can use cubic interpolation rather than linear.  Cubics mean a
>>> bit more maths to figure out, and quite a bit more calculation on the
>>> processor (and with larger data sizes - hence the recommendation for a
>>> 32-bit cpu).  But they give smoother outputs and more freedom for
>>> optimisation (such as minimising different derivatives) than linear
>>> interpolation.
>>>
>>
>> In the application that I'm thinking of, the output will eventually be
>> driving a fairly large piezoelectric or magnetic transducer.  I think
>> it's possible that the inertia of the transducer itself in this case may
>> itself act sufficiently as a low-pass filter that the jump points will
>> not be noticeable in the output even with just some kind of first-order
>> interpolation.  We'll see.
>
> Mechanics often act as a low-pass filter (and of course you can use a
> filter in the analogue electronics) - it could well be good enough for
> the job.
>
> But using a 32-bit micro could give you more flexibility - small Cortex
> M devices are often cheaper than most 8-bit microcontrollers these days,
> and certainly I find they are now usually a better choice.  Of course
> there could be other concerns - package types, familiarity, existing
> code bases, peripherals, voltage ranges, etc., that make your 8-bit
> device a better choice.
>

Definitely something to keep in mind.  In this case it's most likely a 
one-off job, and I'm familiar with the Atmel toolchain and have the 
required programming equipment on hand.  I've been meaning to get into 
ARM someday, though.

[toc] | [prev] | [next] | [standalone]


#28093

Fromkrw <krw@nowhere.com>
Date2015-08-10 12:53 -0400
Message-ID<onlhsa5kacjols17ngipfjrba968fipa6f@4ax.com>
In reply to#28092
On Mon, 10 Aug 2015 09:45:42 -0400, bitrex
<bitrex@de.lete.earthlink.net> wrote:

>On 8/10/2015 8:31 AM, David Brown wrote:
>> On 10/08/15 12:58, bitrex wrote:
>>> On 8/10/2015 3:26 AM, David Brown wrote:
>>>> On 09/08/15 23:41, John Larkin wrote:
>>>>> On Sun, 09 Aug 2015 14:36:42 -0700, John Larkin
>>>>> <jlarkin@highlandtechnology.com> wrote:
>>>>>
>>>>>> On Sun, 9 Aug 2015 15:02:56 -0400, 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?
>>>>>>
>>>>>> Assuming that your "position" (ie, time) variable has finer resolution
>>>>>> than your lookup table, you can use simple linear interpolation.
>>>>>>
>>>>>> Linear interpolation between two points can never result in an output
>>>>>> bigger than either point, whereas an ideal filter can. So for better
>>>>>> approximation of a good sample reconstruction filter, you need to
>>>>>> account for more than two table points, and use something like a cubic
>>>>>> or higher order spline interpolation. That may not matter in your
>>>>>> situation.
>>>>>>
>>>>>> https://dl.dropboxusercontent.com/u/53724080/Circuits/Filters/Wayback_Machine/Interpolation_Error.JPG
>>>>>>
>>>>>
>>>>>
>>>>> Or maybe I misunderstood the problem. If you want to smooth the jump
>>>>> between the two waveform segments (and not between points within a
>>>>> waveform) a lowpass filter might work. Or a fader type algorithm,
>>>>> depending on your requirements. The point interpolator would still
>>>>> help, to better map the table output to the time variable.
>>>>>
>>>>>
>>>>
>>>> A key point, I think, is whether you know about the jumps in advance.
>>>> If they are predictable, then you can use future jump points in your
>>>> interpolation for better results.  Another issue is whether or not you
>>>> can use the next point from the first section during the jumps - that
>>>> will make the crossfade smoother.
>>>>
>>>> You (bitrex) say you want to use a small 8-bit micro - unless your
>>>> frequencies are very low, consider using a small 32-bit micro instead so
>>>> that you can use cubic interpolation rather than linear.  Cubics mean a
>>>> bit more maths to figure out, and quite a bit more calculation on the
>>>> processor (and with larger data sizes - hence the recommendation for a
>>>> 32-bit cpu).  But they give smoother outputs and more freedom for
>>>> optimisation (such as minimising different derivatives) than linear
>>>> interpolation.
>>>>
>>>
>>> In the application that I'm thinking of, the output will eventually be
>>> driving a fairly large piezoelectric or magnetic transducer.  I think
>>> it's possible that the inertia of the transducer itself in this case may
>>> itself act sufficiently as a low-pass filter that the jump points will
>>> not be noticeable in the output even with just some kind of first-order
>>> interpolation.  We'll see.
>>
>> Mechanics often act as a low-pass filter (and of course you can use a
>> filter in the analogue electronics) - it could well be good enough for
>> the job.
>>
>> But using a 32-bit micro could give you more flexibility - small Cortex
>> M devices are often cheaper than most 8-bit microcontrollers these days,
>> and certainly I find they are now usually a better choice.  Of course
>> there could be other concerns - package types, familiarity, existing
>> code bases, peripherals, voltage ranges, etc., that make your 8-bit
>> device a better choice.
>>
>
>Definitely something to keep in mind.  In this case it's most likely a 
>one-off job, and I'm familiar with the Atmel toolchain and have the 
>required programming equipment on hand.  I've been meaning to get into 
>ARM someday, though.

So use an Atmel ARM! ;-)

[toc] | [prev] | [next] | [standalone]


#28094

Fromspope33@speedymail.org (Steve Pope)
Date2015-08-10 20:20 +0000
Message-ID<mqb11m$np1$1@blue-new.rahul.net>
In reply to#28089
bitrex  <bitrex@de.lete.earthlink.net> wrote:

>In the application that I'm thinking of, the output will eventually be 
>driving a fairly large piezoelectric or magnetic transducer.  I think 
>it's possible that the inertia of the transducer itself in this case may 
>itself act sufficiently as a low-pass filter that the jump points will 
>not be noticeable in the output even with just some kind of first-order 
>interpolation.  We'll see.

I'd proceed with infinite caution.  Blend signals when: (1) there
is a same-sense zero crossing and (2) by gradually reducing the
previous signal and amplifying the new signal.

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.

Steve

[toc] | [prev] | [next] | [standalone]


#28095

FromDecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org>
Date2015-08-10 16:35 -0400
Message-ID<di2isa5el41qbp5epn1rg0hgai6ceub0kh@4ax.com>
In reply to#28094
On Mon, 10 Aug 2015 20:20:06 +0000 (UTC), spope33@speedymail.org (Steve
Pope) Gave us:

>bitrex  <bitrex@de.lete.earthlink.net> wrote:
>
>>In the application that I'm thinking of, the output will eventually be 
>>driving a fairly large piezoelectric or magnetic transducer.  I think 
>>it's possible that the inertia of the transducer itself in this case may 
>>itself act sufficiently as a low-pass filter that the jump points will 
>>not be noticeable in the output even with just some kind of first-order 
>>interpolation.  We'll see.
>
>I'd proceed with infinite caution.  Blend signals when: (1) there
>is a same-sense zero crossing and (2) by gradually reducing the
>previous signal and amplifying the new signal.
>
>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.
>
>Steve

  Driving a piezo stack.....  it had better be a pure sine waveform if
high power levels are used.

  Note how speaker assemblies/speaker cones do not like too much
mechanical manipulation from distorted waveforms.

[toc] | [prev] | [next] | [standalone]


#28117

FromRev. 11D Meow! <rev.11d.meow@gmail.com>
Date2015-08-11 23:03 -0700
Message-ID<ddolsa9ih7n2srpsjuedvoq1psvkecj0mh@4ax.com>
In reply to#28094
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

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.dsp


csiph-web