Re: [music-dsp] BW limited peak computation?

2016-07-26 Thread robert bristow-johnson







 Original Message 

Subject: Re: [music-dsp] BW limited peak computation?

From: "Ross Bencina" 

Date: Tue, July 26, 2016 6:21 pm

To: music-dsp@music.columbia.edu

--



> On 27/07/2016 7:09 AM, Sampo Syreeni wrote:

>> Now, what I wonder is, could you still somehow pinpoint the temporal

>> location of an extremum between sampling instants, by baseband logic?

>> Because I don't think there can be more than one between any two

>> adjacent sampling times.

>

> Presumably the certainty of such an estimate would depend on how many

> baseband time samples you considered. Sinc decays as 1/x so that gives

> you some idea of the potential influence of distant values -- not sure

> exactly how that maps into distant sample's influence on peak location

> though.

>
for normal bandlimited interpolation, i don't think you need to go more than 
+16 and -15 samples from the interpolated region (which is between 0 and 1) and 
i don't think you'll need to have more than 16 or 32 phases. �and i think you 
can decently apply quadratic interpolation
between those 1/16th or 1/32nd sample values and you'll have, for all 
quantitative purposes, a very good interpolation of the peak.
dunno what exactly is meant by "baseband logic".

--
�


r b-j � � � � � � � � � � �r...@audioimagination.com
�


"Imagination is more important than knowledge."
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] BW limited peak computation?

2016-07-26 Thread Ross Bencina

On 27/07/2016 7:09 AM, Sampo Syreeni wrote:

Now, what I wonder is, could you still somehow pinpoint the temporal
location of an extremum between sampling instants, by baseband logic?
Because I don't think there can be more than one between any two
adjacent sampling times.


Presumably the certainty of such an estimate would depend on how many 
baseband time samples you considered. Sinc decays as 1/x so that gives 
you some idea of the potential influence of distant values -- not sure 
exactly how that maps into distant sample's influence on peak location 
though.


Ross.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] BW limited peak computation?

2016-07-26 Thread Sampo Syreeni

On 2016-07-26, Stefan Stenzel wrote:

the acid test is when the pre-upsampled data is alternating signs on 
a large amplitude with *one* sample missing.  like:


 ... -A, +A, -A, +A, -A, +A, -A, +A, -A, +A, -A, +A, -A, +A, -A, +A, -A, +A, 
+A, -A, +A, -A, +A, -A, +A, -A, +A, -A, +A, -A, +A, -A, +A, -A, +A, ...

you might get an unnaturally large peak (many times bigger than |A|) 
with that.


Should be something like the sum of all 2A/(pi*(t+0.5)) for t an 
integer going from zero to infinity. Not sure if that converges.


It doesn't. Intuitively speaking, after some heady limit arguments, a 
pure ...,+1, -1, +1,-1,... train decodes as a sinusoid at the Nyquist 
frequency. It does so because of phase cancellation between the various, 
in-phase but at least double in period sinusoids which go into the 
Nyquist-Shannon reconstruction.


What this particular sequence does is, it sums two one-sided alternating 
sequences together, too. But it does it so that it leaves out a single 
sample at the origin, and by doing so, pushes those otherwise nicely 
cancelling, marginal cosines from the various sinc(x) functions into 
phase between two sampling times. Obviously what you get then is not 
convergence, but very fast divergence. All within the band-limited 
interpolation theorem, which in the limit only applies in general 
strictly below the Nyquist frequency. (This stuff for once doesn't 
converge even in the weak, distribution sense.)


Now, what I wonder is, could you still somehow pinpoint the temporal 
location of an extremum between sampling instants, by baseband logic? 
Because I don't think there can be more than one between any two 
adjacent sampling times. And if you can pinpoint its location, then I 
believe you could derive an iterative algorithm relying on higher and 
higher, recursively computed interpolation formulae which could drive 
the uncertainty in its location as low as necessary. On the fly. 
Irrespective of what the real *amplitude* of the thing really is.


If you could do that, I think you could then put upper bounds on both 
the L^1 and L^2 norms of the deviation above full range, between the 
sampling instants, in closed form. And once you'd done that, I think you 
could pretty much tame any sonically/musically relevant problem 
happening "between the samples", as well: just take note of where the 
peak seems to be for phase stuff, and then take note of how rapidly your 
interpolands grow, for an approximation of what you should do wrt

amplitude.
--
Sampo Syreeni, aka decoy - de...@iki.fi, http://decoy.iki.fi/front
+358-40-3255353, 025E D175 ABE5 027C 9494 EEB0 E090 8BA9 0509 85C2
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] BW limited peak computation?

2016-07-26 Thread Stefan Stenzel
Paul,

It all depends what you consider a peak. Imagine a single sample of one, 
surrounded by nothing but zeros left and right, upsampling this signal would 
bring up many peaks that you might not be interested in.

For practical purposes I suggest you start with the simple approach to search 
for a sample with neighbours smaller in magnitude, refine the fractional 
position of the peak and then evaluate the peak value at this position. A 
simple quadratic function and its derivative for this:

suppose a,b,c are successive samples and b having maximum magnitude:

fraction(a,b,c)  = (a-c)/(2a-4b+2c)
value(a,b,c,fraction) = ((a-2b+c)fraction^2 + (c-a)fraction + 2b)/2

This would work well with the data in your graphs.

Stefan

> On 25 Jul 2016, at 23:00 , Paul Stoffregen  wrote:
> 
> Does anyone have any suggestions or references for an efficient algorithm to 
> find the peak of a bandwidth limited signal?
> 
> If I just look only at the numerical values of the samples (yeah, that's what 
> I've been doing), when a signal is close to an integer division of Fs, even 
> collecting data over many cycles tends to miss the phases of the waveform 
> containing the peaks.  For example:
> 
> 
> Image also available here: 
> https://forum.pjrc.com/threads/35478-Problems-Plotting-Filter-Response?p=110442=1#post110442
> 
> The only solution I'm imagining would involve expensive upsampling and 
> filtering.  Even then, if I multiply the sample rate by 16 or more and the 
> filter is good enough, I still might not get a sample right at the peak.
> 
> Is there a better way?
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp