On 2 Mar, 09:23, minfitl...@yahoo.co.uk wrote:> I am modelling acoustic delays for source estimation.Why do you need the fractional delays? Don't they pop out of your models?> I have x,y,z co- > ordinates in a room and I use spherical interseption to get the > estimates of x,y,z given 4 signals which are delayed by appropriate > amounts. However, the delays up to now have to be rounded to int. Also > the estimates of the delays are found by generalized cross-correlation > which means they are integers too.Use the slope of the phase of the cross spectrum. No problems whatsoever with two signals. But of course, you don't deal with two signals, you deal with lots of interfering reflections. Rune
Fractional Time-Delays
Started by ●March 1, 2007
Reply by ●March 2, 20072007-03-02
Reply by ●March 2, 20072007-03-02
minfitlike@yahoo.co.uk wrote:> On Mar 2, 2:53 pm, "robert bristow-johnson" > <r...@audioimagination.com> wrote: >> On Mar 1, 8:07 pm, Steve Underwood <ste...@dis.org> wrote: >> >> >> >>> robert bristow-johnson wrote: >>>> On Mar 1, 3:15 pm, sampson...@gmail.com wrote: >>>>> On Mar 1, 1:24 pm, minfitl...@yahoo.co.uk wrote: >>>>>> How do I simulate fractional delays - etc z^(alpha) where alpha is non- >>>>>> integer eg -5.67 or whatever. >>>>> Look up Farrow structures. There is plenty of info online. >>>> "Farrow structures" is a pretty obscure method. i googled it and got >>>> Julius's Bandlimited Interpolation page right away (which is a very >>>> good general resource on the topic). >>>> to the OP, i would suggest imaging what the continuous-time >>>> reconstructed output would be given the discrete samples and then >>>> resample that reconstructed output at n-5.67 (or whatever) where "n" >>>> is the current sample. conceptually, it's pretty straight forward. >>> Obscure? Farrow is a name you meet all the time in comms, for arbitrary >>> phase shifting. >> i guess i'm not a comms guy. when i think of setting up the problem >> of either fractional delay (here assuming a relatively constant delay >> parameter) or resampling (SRC), i think pretty fundamentally of >> hypothetically reconstructing the continuous time waveform from the >> samples x[n] = x(n*T) >> >> +inf >> x(t) = SUM{ x[m] * sinc((t-m*T)/T) } >> m=-inf >> >> of course it's clear that x(n*T) = x[n] for integer n. >> >> then >> >> +inf >> y[n] = x(n*T + d) = SUM{ x[n+m] * sinc((d-m*T)/T) } >> m=-inf >> >> and here is when you start approximating (the Farrow structure *must* >> have some approximation, too), you restrict the summation to terms >> around sample x[n] (i'm assuming 0 <= d < T) >> >> +N/2 >> y[n] = SUM{ x[n+m] * sinc((d-m*T)/T) } >> m=-N/2+1 >> >> for some even N. that is, of course, applying a rectangular window to >> the ideal impulse response, thesinc() function, so we may as well >> generalize it a little: >> >> +N/2 >> y[n] = SUM{ x[n+m] * sinc(d/T - m) * w((d/T-m)/(N/2)) } >> m=-N/2+1 >> >> where the window function w(u) is 1 for u=0 and tapers to zero at u= >> +/- 1. >> >> i'm pretty sure that no matter how you do the interpolation (Lagrange >> or Hermite polynomials, etc.) that in any case where the N samples >> surrounding the fractional sample are used and if the fractional delay >> goes to 0 or T, you get the same output as you would for an integer >> sample delay (y[n] = x[n] or x[n-1]), in that case, i done care how >> you did it, the solution fits the form above and the solution may very >> well determine the nature of the window. now B-splines do NOT have >> the property that as "d" goes to 0 or T you get x[n] or x[n-1] (they >> give you better image rejection but they do so at the cost of LPFing >> your data), so i am not sure that Farrow structures have this property >> either and fit the form above. >> >> but in any case, you have a set of FIR coefficients for every >> fractional delay "d" of interest. above, those coefs would look like >> >> sinc(d/T-m) * w((d/T-m)/(N/2)) for -N/2 < m <= +N/2 >> >> for each set of FIR coefs, you can come up with a frequency response >> that you hope is flat unity gain over the frequency range of interest >> and reasonably constant group or phase delay (that equals "d") over >> the frequency range of interest. >> >> so, i do not see any design specing for this Farrow structure, except >> for how many values of fractional delay you solve the set of equations >> for and your FIR length. is there any design spec that you can >> manipulate and tradeoff? i'm just curious. >> >> r b-j > > I am modelling acoustic delays for source estimation. I have x,y,z co- > ordinates in a room and I use spherical interseption to get the > estimates of x,y,z given 4 signals which are delayed by appropriate > amounts. However, the delays up to now have to be rounded to int. Also > the estimates of the delays are found by generalized cross-correlation > which means they are integers too. A small error in rounding can make > a big difference in position estimate as the equations are non-linear. > I am trying the real thing soon in any case.If you double the sample rate, then a delay of half an original sample time is had by averaging two adjacent samples. In general, oversampling or interpolating n:1 provides delays of 1/n original periods simply. How much resolution do you need? Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply by ●March 2, 20072007-03-02
On Mar 2, 3:23 am, minfitl...@yahoo.co.uk wrote:> > I am modelling acoustic delays for source estimation. I have x,y,z co- > ordinates in a room and I use spherical interseption to get the > estimates of x,y,z given 4 signals which are delayed by appropriate > amounts. However, the delays up to now have to be rounded to int. Also > the estimates of the delays are found by generalized cross-correlation > which means they are integers too. A small error in rounding can make > a big difference in position estimate as the equations are non-linear. > I am trying the real thing soon in any case.does either this (the windowed sinc thing) or the Farrow thing help you? are you able to make that do what you want it to do? r b-j
Reply by ●March 2, 20072007-03-02
On Mar 1, 9:34 pm, sampson...@gmail.com wrote:> The only parameter is the FIR length, N, which determines a polynomial > in D, the fractional delay. The nice thing about Farrow is that D can > smoothly vary from 0-1 but the equation stays the same. This sort of > structure is very useful in data demodulators, where the optimal > sampling instant in a bit period moves around over time because of > differences in the transmit and receieve clocks. I would not call it a > hi-fi solution in the audio sense, but it has been proven to be just > fine for data demodulation. The distortion can be reduced by > interpolating the samples by a fixed amount before the fractional > interpolation, so the curve is smoother.well, i'm just now starting to understand it from Julius's broad treatise on the whole subject of Bandlimited Interpolation. i am still not sure that if D (or Delta in JOS's online resource) is 0 or 1, if that means the output is exacly the input samples, delayed 0 or 1 sample. if it is, it can somehow be modeled as a windowed sinc() and one can derive what the implied "window" would be (and from that decide how good it is). i need to study this Farrow thing more (frankly, i never heard of it before this). i'm never to old to learn something new. r b-j
Reply by ●March 2, 20072007-03-02
On Mar 2, 8:10 am, Jerry Avins <j...@ieee.org> wrote:> > If you double the sample rate, then a delay of half an original sample > time is had by averaging two adjacent samples.Jerry, that would be linear interpolation. might not sound so good (some LPFing for them half samples). it needs to be a weighted average of more than just the two adjacent samples. r b-j
Reply by ●March 2, 20072007-03-02
robert bristow-johnson wrote:> On Mar 2, 8:10 am, Jerry Avins <j...@ieee.org> wrote: >> If you double the sample rate, then a delay of half an original sample >> time is had by averaging two adjacent samples. > > Jerry, that would be linear interpolation. might not sound so good > (some LPFing for them half samples). it needs to be a weighted > average of more than just the two adjacent samples.I know. But linear interpolation is pretty good if the steps are small enough. (With 1000x oversampling, picking the nearest interpolated sample would probably be good enough.) Keep in mind that minfitlike doesn't want to listen to the sound, but only to know where it's coming from. That's why I asked how much resolution he needed. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply by ●March 2, 20072007-03-02
On Mar 2, 1:18 pm, Jerry Avins <j...@ieee.org> wrote:> robert bristow-johnson wrote: > > On Mar 2, 8:10 am, Jerry Avins <j...@ieee.org> wrote: > >> If you double the sample rate, then a delay of half an original sample > >> time is had by averaging two adjacent samples. > > > Jerry, that would be linear interpolation. might not sound so good > > (some LPFing for them half samples). it needs to be a weighted > > average of more than just the two adjacent samples. > > I know. But linear interpolation is pretty good if the steps are small > enough. (With 1000x oversampling, picking the nearest interpolated > sample would probably be good enough.)oh! first oversample, *then* linearly interpolate? sure, that's okay. i just didn't figger that out from what you said. BTW, 1000x oversampling is more than you need for linear interpolation in between the oversampled samples. for super-good high quality audio SRC (i know this app ain't SRC but slowly changing or unchanging fractional delay) 512x oversampling is as good as you'll ever need (130 dB SNR from the foldback of images that the sinc^2 function didn't completely obliterate). r b-j
Reply by ●March 2, 20072007-03-02
On Mar 2, 11:45 pm, "Rune Allnor" <all...@tele.ntnu.no> wrote:> On 2 Mar, 09:23, minfitl...@yahoo.co.uk wrote: > > > I am modelling acoustic delays for source estimation. > > Why do you need the fractional delays? Don't they pop out of > your models? > > > I have x,y,z co- > > ordinates in a room and I use spherical interseption to get the > > estimates of x,y,z given 4 signals which are delayed by appropriate > > amounts. However, the delays up to now have to be rounded to int. Also > > the estimates of the delays are found by generalized cross-correlation > > which means they are integers too. > > Use the slope of the phase of the cross spectrum. No problems > whatsoever with two signals. But of course, you don't deal with > two signals, you deal with lots of interfering reflections. > > RuneFortunately theGeneralized Cross Correlation method I use can cope quiet well with reverberations.(Hannan-Thomson Method) I thought about the phase of cross-power spectrum but it's quite noisy even after averaging and you need to unwrap the phase don't you? I saw one paper on it somewhere. Thanks F.
Reply by ●March 2, 20072007-03-02
robert bristow-johnson wrote: ...> BTW, 1000x oversampling is more than you need for linear interpolation > in between the oversampled samples. ...Again, I know. I was just turning up the contrast and saying that with enough oversampling, one doesn't need to interpolate at all. At some point, integer delays in the new sample rate will be OK. If minfitlike would be happy with quarter-sample delays, it might be simplest for him to actually oversample at that rate rather than upsample. It would save computation if his A/D can do it. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply by ●March 2, 20072007-03-02
On Mar 1, 4:15 pm, "robert bristow-johnson" <r...@audioimagination.com> wrote:> On Mar 1, 3:15 pm, sampson...@gmail.com wrote: > > > On Mar 1, 1:24 pm, minfitl...@yahoo.co.uk wrote: > > > > How do I simulate fractional delays - etc z^(alpha) where alpha is non- > > > integer eg -5.67 or whatever. > > > Look up Farrow structures. There is plenty of info online. > > "Farrow structures" is a pretty obscure method.Maybe obscure in terms of software, but less so in terms of hardware implementation. It can be used to implement the common windowed sinc interpolation FIR process. So-called polyphase interpolation pre-caches a lot of precalculated phase results per tap, requiring a large memory array. A Farrow structure does a polynomial interpolation of short segments of the windowed sinc per tap, thus requiring no memory or memory lookups, but more MAC operations. Then the windowed sinc interpolation results are used for a new, per sample, bandlimited sample interpolation FIR filter. The whole thing can be pipelined and FIFO buffered so that every resulting sample can be for a differing phase delay. Most lobes of a windowed sinc look reasonably similar to parabolic or cubic curves, so low order interpolation of a windowed sinc might be reasonably close, compared to the QOR requirements, perhaps better than a table lookup without interpolation. IMHO. YMMV. -- rhn http://www.nicholson.com/rhn/dsp.html






