DSPRelated.com
Forums

Decimation/interpolation filters issue when sample rate ratio is variable

Started by Bernhard Holzmayer September 16, 2004
Bernhard Holzmayer wrote:

> Trying to get your perspective (leaning back in my chair, feet on > the desk...), I come to this premature conclusion:
Ooh: 'preliminary conclusion' was, what I intended to say. But the other expression isn't that bad... Bernhard
"Bernhard Holzmayer" <holzmayer.bernhard@deadspam.com> wrote in message 
news:2622338.VIXaoWmUPI@holzmayer.ifr.rt...
> Fred Marshall wrote: > >> >> "Bernhard Holzmayer" <holzmayer.bernhard@deadspam.com> wrote in >> message news:1176462.lnuKDRrfKf@holzmayer.ifr.rt... >>> jim wrote: >>>
...................................
> > To show you, what concern bothers me, let's assume a signal with > frequency content from DC to 20kHz. > At a high positional clock rate (high speed), it will be sampled at > some 40kS/s or more, then the mentioned IIR cuts away everything > outside a band of 10...15kHz. > Now let's assume that positional clock rate (speed) is lower, which > might result in a momentary sampling rate of 20kS/s. The IIR filter > will scale accordingly, and filter the signal at 5...7,5kHz. > But Nyquist requires that the signal is bandlimited to 0...10kHz. > If sampling rate were at 1kS/s, legal band would range from > 0...500Hz. > That's what the decimation filter usually deals with. > And that's what I don't have and don't know how I should realize it. > Since there are certainly frequency components (noise) which do not > scale with speed, I cannot neglect this. > > If you remember that old trick, with machinery noise. How did they > overcome the influence of noise which didn't scale with rotational > speed? Just ignore the problem? > > Bernhard >
Bernhard, Understood - if the clock rate varies then the lowest sample rate sets a lower Nyquist frequency. One wouldn't ignore noise in this situation. There are a number of observations I might make: 1) If you clock on the tachometer and the speed is varying, then the normal single-temporal frequency, sinusoidal additive noise may be spectrally spread by synching the sampling clock to the tach. NOTE: this means time-based frequency components - which might look like "noise" in the rotational domain. 2) If you transform the thinking to the rotational position domain then the Nyquist criterion still applies - but now in radians per revolution instead of radians per second. You can have a sinusoid at 20k periods per revolution components that have to be sampled at higher than 40k samples per revolution. 3) If you sample noise that's at a rotational frequency higher than 20k periods per revolution then you'll alias it - just as if you were using a time base. Sometimes it's acceptable to alias white noise and sometimes not. The problem is the same. So, in order to "properly" sample the data that's clocked with the tach you need to have an idea of the spectral character of the result. I guess one way to measure that character is to increase the rotational sample rate and FFT reasonable length sequences and find where the high frequency energy in the result goes away. Then the sample rate is probably high enough. By "increase the rotational sample rate", I mean that you generate the sampling clock with something that looks like a frequency synthesizer. Inside the synthesizer is a phase-locked loop. Instead of the input being a "time stable", lower frequency, oscillator, the input is the tach and the synthesizer generates higher frequencies that are locked to the tach. By setting the synthesizer parameters you can change the output clock rate and generate higher rate clocks. Alternately or in combination, you might lowpass filter the (analog) sensor outputs to achieve the same results. We are stuck with fixed sample rates in 2-D (and 1-D) discrete array cameras all the time. The spatial sample rate is fixed and we simply accept the aliasing which shows up as Moire' patterns, etc. In 1-D signal processing we are often stuck with imperfect lowpapss filters or simply know that the signal bandwidth is "mostly" inside the Nyquist limit and accept the aliasing of lower energy components at higher frequencies. So, you're not alone in needing to sample a signal "blind". In the end it becomes a matter of judgement and a trade between what is theoretically necessary and what is practical to achieve. Fred
Fred Marshall wrote:

> > Understood - if the clock rate varies then the lowest sample rate > sets a > lower Nyquist frequency. One wouldn't ignore noise in this > situation. There are a number of observations I might make: > > 1) If you clock on the tachometer and the speed is varying, then > the normal single-temporal frequency, sinusoidal additive noise > may be spectrally spread by synching the sampling clock to the > tach. NOTE: this means time-based frequency components - which > might look like "noise" in the rotational domain.
Varying speed results in an effect similar to that of a switched/slided filter at constant sample rate. We're aware of it - but since we cannot remove the speed variation, we'll have to live with that...
> > 2) If you transform the thinking to the rotational position domain > then the Nyquist criterion still applies - but now in radians per > revolution instead > of radians per second. You can have a sinusoid at 20k periods per > revolution components that have to be sampled at higher than 40k > samples per revolution.
Desirable. We achieve that for the spectrum of interest, but not for the noise @ 3)
> > 3) If you sample noise that's at a rotational frequency higher > than 20k periods per revolution then you'll alias it - just as if > you were using a > time base. Sometimes it's acceptable to alias white noise and > sometimes > not. The problem is the same. > > So, in order to "properly" sample the data that's clocked with the > tach you > need to have an idea of the spectral character of the result. I > guess one way to measure that character is to increase the > rotational sample rate and FFT reasonable length sequences and > find where the high frequency energy in > the result goes away. Then the sample rate is probably high > enough. > > By "increase the rotational sample rate", I mean that you generate > the sampling clock with something that looks like a frequency > synthesizer. > Inside the synthesizer is a phase-locked loop. Instead of the > input being a "time stable", lower frequency, oscillator, the > input is the tach and the > synthesizer generates higher frequencies that are locked to the > tach. By setting the synthesizer parameters you can change the > output clock rate and generate higher rate clocks.
I agree. That would help. But at the stage before the sampling (or rate conversion), that stage must allow the whole spectrum of interest, even at full speed. Which means, that I have a static LPF at 20k periods per revolution. Now when speed decreases, the Nyquist rate sinks below that 20k, and a gap occurs, which is not covered by the LPF.
> > Alternately or in combination, you might lowpass filter the > (analog) sensor outputs to achieve the same results.
It's the same if we do this in analog or digital realm.
> > We are stuck with fixed sample rates in 2-D (and 1-D) discrete > array cameras all the time. > The spatial sample rate is fixed and we simply accept the aliasing > which > shows up as Moire' patterns, etc. In 1-D signal processing we are > often stuck with imperfect lowpapss filters or simply know that > the signal bandwidth is "mostly" inside the Nyquist limit and > accept the aliasing of > lower energy components at higher frequencies. So, you're not > alone in > needing to sample a signal "blind". In the end it becomes a > matter of judgement and a trade between what is theoretically > necessary and what is practical to achieve. > > Fred
Thanks Fred, for the comfort. Guess, I cannot help to sample the signal "blindly", and accept some aliasing. On that way, I'll nevertheless try the best to achieve at least a minimum of anti-alias-filtering. My best approach at time being is an averager with all 1s coefficients, because it's the only one I can imagine if I don't know the length of the filter (the sample ratio). Bernhard
Fred Marshall wrote:
(snip)

> Understood - if the clock rate varies then the lowest sample rate sets a > lower Nyquist frequency. One wouldn't ignore noise in this situation.
For non-uniform sampling, the theory tends toward the total number of samples over the total time. If you get too non-uniform there can be problems with noise, though. -- glen
glen herrmannsfeldt wrote:

> Fred Marshall wrote: > (snip) > >> Understood - if the clock rate varies then the lowest sample rate sets >> a lower Nyquist frequency. One wouldn't ignore noise in this situation. > > > > For non-uniform sampling, the theory tends toward the total number > of samples over the total time. If you get too non-uniform > there can be problems with noise, though. > > -- glen
The sampling is strictly uniform in distance. Time needn't be considered. Jerry -- ... they proceeded on the sound principle that the magnitude of a lie always contains a certain factor of credibility, ... and that therefor ... they more easily fall victim to a big lie than to a little one ... A. H. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Fred Marshall wrote:

   ...

> By "increase the rotational sample rate", I mean that you generate the > sampling clock with something that looks like a frequency synthesizer. > Inside the synthesizer is a phase-locked loop. Instead of the input being a > "time stable", lower frequency, oscillator, the input is the tach and the > synthesizer generates higher frequencies that are locked to the tach. By > setting the synthesizer parameters you can change the output clock rate and > generate higher rate clocks.
Beware of clocking a sampler with the output a PLL. Residual FM -- usually a sawtooth -- can inject artifacts. When the PLL follows a varying input, the effect is worse. A tach with more lines is wanted. If the tach signal is derived from a two-track bidirectional encoder, a simple circuit will give 4 pulses per line. If the analog signals (before the Schmitt triggers) is available, you can double that to 8. An 8X increase in sampling resolution may be enough. Jerry -- ... they proceeded on the sound principle that the magnitude of a lie always contains a certain factor of credibility, ... and that therefor ... they more easily fall victim to a big lie than to a little one ... A. H. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Jerry Avins" <jya@ieee.org> wrote in message 
news:4152d4da$0$4027$61fed72c@news.rcn.com...
> Fred Marshall wrote: > > ... > >> By "increase the rotational sample rate", I mean that you generate the >> sampling clock with something that looks like a frequency synthesizer. >> Inside the synthesizer is a phase-locked loop. Instead of the input >> being a "time stable", lower frequency, oscillator, the input is the tach >> and the synthesizer generates higher frequencies that are locked to the >> tach. By setting the synthesizer parameters you can change the output >> clock rate and generate higher rate clocks. > > Beware of clocking a sampler with the output a PLL. Residual FM -- > usually a sawtooth -- can inject artifacts. When the PLL follows a > varying input, the effect is worse. A tach with more lines is wanted. > > If the tach signal is derived from a two-track bidirectional encoder, a > simple circuit will give 4 pulses per line. If the analog signals > (before the Schmitt triggers) is available, you can double that to 8. > An 8X increase in sampling resolution may be enough. >
Jerry, Yeah, I thought about that - but not as much as you have. In a perfect (i.e. very high bandwidth) PLL implementation the frequency output might "jump" to a new value each time a new axis crossing of the input occurred. Thus the sawtooth error. That obviously doesn't follow a smooth ramp in rotational velocity. But, if the rotational acceleration is low enough it wouldn't be noticed. ("low enough" and "noticed" are subjective terms - have to be qualified for the specific situation)
> Beware of clocking a sampler with the output a PLL. Residual FM -- > usually a sawtooth -- can inject artifacts. When the PLL follows a > varying input, the effect is worse. A tach with more lines is wanted. >
Do you mean a one pulse per revolution tach? Otherwise I don't know what you mean by "clocking a sampler with the output a PLL". And, I'm curious or I wouldn't mention it. I would think that the number of lines is almost *always* one of the things to be dealt with. I did a dc motor tape drive controller with a 1000 line tach and PLL for low wow and flutter - that was pretty cool. With 1000 lines and constant speed it was easy. Here the OP has variable speed - so it takes more thought as you've pointed out. Fred
Fred Marshall wrote:

> "Jerry Avins" <jya@ieee.org> wrote in message > news:4152d4da$0$4027$61fed72c@news.rcn.com... > >>Fred Marshall wrote: >> >> ... >> >> >>>By "increase the rotational sample rate", I mean that you generate the >>>sampling clock with something that looks like a frequency synthesizer. >>>Inside the synthesizer is a phase-locked loop. Instead of the input >>>being a "time stable", lower frequency, oscillator, the input is the tach >>>and the synthesizer generates higher frequencies that are locked to the >>>tach. By setting the synthesizer parameters you can change the output >>>clock rate and generate higher rate clocks. >> >>Beware of clocking a sampler with the output a PLL. Residual FM -- >>usually a sawtooth -- can inject artifacts. When the PLL follows a >>varying input, the effect is worse. A tach with more lines is wanted. >> >>If the tach signal is derived from a two-track bidirectional encoder, a >>simple circuit will give 4 pulses per line. If the analog signals >>(before the Schmitt triggers) is available, you can double that to 8. >>An 8X increase in sampling resolution may be enough. >> > > Jerry, > > Yeah, I thought about that - but not as much as you have. In a perfect > (i.e. very high bandwidth) PLL implementation the frequency output might > "jump" to a new value each time a new axis crossing of the input occurred. > Thus the sawtooth error. That obviously doesn't follow a smooth ramp in > rotational velocity. But, if the rotational acceleration is low enough it > wouldn't be noticed.
With an analog PLL, its actual frequency drifts toward its free-running frequency between corrections, unless there's a perfect integrator in it. Digital integrators are perfect, but that doesn't help if the actual speed is changing. The PLL frequency can only be corrected in jumps when a correction pulse comes along, so it becomes a staircase, or a sawtooth riding on a ramp depending on how you choose to look at it.
> ("low enough" and "noticed" are subjective terms - have to be qualified for > the specific situation) > > >>Beware of clocking a sampler with the output a PLL. Residual FM --
... The output *of* a PLL....
>>usually a sawtooth -- can inject artifacts. When the PLL follows a >>varying input, the effect is worse. A tach with more lines is wanted. >> > > > Do you mean a one pulse per revolution tach? Otherwise I don't know what > you mean by "clocking a sampler with the output a PLL". And, I'm curious or > I wouldn't mention it.
I don't understand your puzzlement.
> I would think that the number of lines is almost *always* one of the things > to be dealt with. I did a dc motor tape drive controller with a 1000 line > tach and PLL for low wow and flutter - that was pretty cool. With 1000 > lines and constant speed it was easy. Here the OP has variable speed - so > it takes more thought as you've pointed out.
If your 1000 lines are distributed among two tracks in quadrature -- the standard incremental bi-directional encoder layout -- there are 2000 distinguishable locations around the disk. If those tracks have close to equal areas of clear and dark, and if the phase shift id close to quadrature throughout, then each location will occupy the same angle as all the others. The actual track sensor outputs will be approximately sinusoidal, and by running the outputs of both tracks into a single differential comparator (and again with suitable inversions), a new set of outputs can be generated 45 degrees displaced from the first set. In all, 4000 locations (or clock transitions if you use them that way) are stably generated from 1000 lines. Quadrature encoders are usually characterized by the number of lines per track, so we would say with my example that we generates 4000 locations with a 500-line encoder. In my collection, I have the 10,000-line BEI encoder that I used (without the last doubling) to provide accurate position information in a machine to locate and repair defects on RCA's video disk masters. The amazing part was not distinguishing 1/40,000th of a circle, but getting the servo to settle onto it. Jerry -- ... they proceeded on the sound principle that the magnitude of a lie always contains a certain factor of credibility, ... and that therefor ... they more easily fall victim to a big lie than to a little one ... A. H. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;