DSPRelated.com
Forums

Delay through sample/hold interpolator

Started by gretzteam May 7, 2012
Hi,
I'm having a hard time understanding how to calculate the delay through a
simple sample/hold interpolator. 

The impulse response is that of an FIR filter and is simply N 'ones'
followed by zeros. The group delay is then (N-1)/2 = 7.5 samples at the
OUTPUT rate. 

It just seems weird that a simple 'wire' adds delay to the signal. When a
new value comes in, it appears at the ouptut right away, only repeated N
times. How can this be adding 'delay'? Is there a good way to see this?

Thanks
>Hi, >I'm having a hard time understanding how to calculate the delay through a >simple sample/hold interpolator. > >The impulse response is that of an FIR filter and is simply N 'ones' >followed by zeros. The group delay is then (N-1)/2 = 7.5 samples at the >OUTPUT rate. > >It just seems weird that a simple 'wire' adds delay to the signal. When a >new value comes in, it appears at the ouptut right away, only repeated N >times. How can this be adding 'delay'? Is there a good way to see this? > >Thanks >
Thinking a bit more...drawing the points of a 'sampled' sine wave, and then adding the sample/hold horizontal lines between the samples kind of show that the 'new' sine wave is passing through the 'middle' of the horizontal lines. So yes it's delayed, but it's still weird!
On Mon, 07 May 2012 17:07:00 -0500, "gretzteam"
<gretzteam@n_o_s_p_a_m.yahoo.com> wrote:

>>Hi, >>I'm having a hard time understanding how to calculate the delay through a >>simple sample/hold interpolator. >> >>The impulse response is that of an FIR filter and is simply N 'ones' >>followed by zeros. The group delay is then (N-1)/2 = 7.5 samples at the >>OUTPUT rate. >> >>It just seems weird that a simple 'wire' adds delay to the signal. When a >>new value comes in, it appears at the ouptut right away, only repeated N >>times. How can this be adding 'delay'? Is there a good way to see this? >> >>Thanks >> > >Thinking a bit more...drawing the points of a 'sampled' sine wave, and then >adding the sample/hold horizontal lines between the samples kind of show >that the 'new' sine wave is passing through the 'middle' of the horizontal >lines. So yes it's delayed, but it's still weird!
Welcome to the real world. ;) Eric Jacobsen Anchor Hill Communications www.anchorhill.com
On 5/7/2012 2:26 PM, gretzteam wrote:
> Hi, > I'm having a hard time understanding how to calculate the delay through a > simple sample/hold interpolator. > > The impulse response is that of an FIR filter and is simply N 'ones' > followed by zeros. The group delay is then (N-1)/2 = 7.5 samples at the > OUTPUT rate. > > It just seems weird that a simple 'wire' adds delay to the signal. When a > new value comes in, it appears at the ouptut right away, only repeated N > times. How can this be adding 'delay'? Is there a good way to see this? > > Thanks
Maybe flip your perspective by saying this: "When a new value comes in, it is preceded by a series of samples that replicate the previous one." So, not only does the new value appear at the output "right away" but is also appears at the output "just before the next sample" .. and there is no differentiation between the first and last. Now you can play games with the data if you assume high temporal resolution. For example, you can remove the effect of the sample-hold. But you may not be able to do that in real time. I don't get your "simple wire". A FIR filter isn't one of those. Fred
> >Maybe flip your perspective by saying this: > >"When a new value comes in, it is preceded by a series of samples that >replicate the previous one." > >So, not only does the new value appear at the output "right away" but is >also appears at the output "just before the next sample" .. and there is >no differentiation between the first and last. > >Now you can play games with the data if you assume high temporal >resolution. For example, you can remove the effect of the sample-hold. > But you may not be able to do that in real time. > >I don't get your "simple wire". A FIR filter isn't one of those. > >Fred >
Yes when you look at 'past values' it all start to make a lot of sense. I only meant 'simple wire' coming from an implementation perspective in digital logic. Data comes in at rate A, and you grab it at rate N*A using a faster clock...no 'real' filters are there, and no obvious processing delays - you just grab it faster. But now I really see what is going on. Thanks!
On 5/8/12 5:37 PM, gretzteam wrote:
> > > I only meant 'simple wire' coming from an implementation perspective in > digital logic. Data comes in at rate A, and you grab it at rate N*A using a > faster clock...no 'real' filters are there, and no obvious processing > delays -
when your incoming sample is held for the following N-1 samples, that is not an "obvious processing delay"? those N-1 samples are dependent upon a *past* sample. it looks like an obvious delay to me. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
i thought the delay through a sample and hold is well known to be 1/2
the sampling interval?

Mark

Mark <makolber@yahoo.com> writes:

> i thought the delay through a sample and hold is well known to be 1/2 > the sampling interval?
Define "delay." Seems to me it could be viewed as time-dependent delay of 0 to T, where T is the sampling interval. T/2 is the average delay? -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
On Tue, 08 May 2012 11:55:49 -0700, Fred Marshall wrote:

> On 5/7/2012 2:26 PM, gretzteam wrote: >> Hi, >> I'm having a hard time understanding how to calculate the delay through >> a simple sample/hold interpolator. >> >> The impulse response is that of an FIR filter and is simply N 'ones' >> followed by zeros. The group delay is then (N-1)/2 = 7.5 samples at the >> OUTPUT rate. >> >> It just seems weird that a simple 'wire' adds delay to the signal. When >> a new value comes in, it appears at the ouptut right away, only >> repeated N times. How can this be adding 'delay'? Is there a good way >> to see this? >> >> Thanks > > Maybe flip your perspective by saying this: > > "When a new value comes in, it is preceded by a series of samples that > replicate the previous one." > > So, not only does the new value appear at the output "right away" but is > also appears at the output "just before the next sample" .. and there is > no differentiation between the first and last. > > Now you can play games with the data if you assume high temporal > resolution. For example, you can remove the effect of the sample-hold. > But you may not be able to do that in real time. > > I don't get your "simple wire". A FIR filter isn't one of those.
What is interesting is that if you use the theoretical model of sampling usually presented in sampling theory, i.e. the multiplication of the signal by a train of dirac delta functionals, the result, in the frequency domain, shows no symptoms of delay -- just aliasing. It does make a screwy kind of sense, because nothing is ever really delayed -- just held off more than most of the time. -- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com
>Hi, >I'm having a hard time understanding how to calculate the delay through a >simple sample/hold interpolator. > >The impulse response is that of an FIR filter and is simply N 'ones' >followed by zeros. The group delay is then (N-1)/2 = 7.5 samples at the >OUTPUT rate. > >It just seems weird that a simple 'wire' adds delay to the signal. When a >new value comes in, it appears at the ouptut right away, only repeated N >times. How can this be adding 'delay'? Is there a good way to see this? > >Thanks >
I think the answer to your question is simple. Delay(digital) can be thought of as two types, delay of sampling(I mean registers, not ADC sampling, this can be thought of as wire delay) and groupdelay of filters. Sample delay is obviously integer multiple of sampling clock period. Group delay applies to signal shape in dsp sense. For example the peak of a sine wave will be delayed by whatever registers are in the path as well as by the groupdelay in the path if there is a filter. In your case of a filter with N ones then groupdelay applies as (N-1)/2 though in this particular case groupdelay does not show if your input is impulse! as the impulse will appear straight away at the output and stay so for N stages. Kadhiem