DSPRelated.com
Forums

sample rate acceleration - any experiences?

Started by Bernhard Holzmayer August 2, 2004
Background is a mechanical movement, accelerating from zero or very 
slow speed to a predefined maximum speed.
Signals related to the speed have to be filtered with a bandpass 
filter which follows with speed.

Since modifiying filter coefficients on the fly is difficult 
(transient distortions when switching coefficients) and inefficient 
(calculation or memory intensive), I had another idea and I would 
like to receive some feedback - opinions, experience, directions...

Basic filter should be something like 4th order butterworth 
bandpass. (Might be FIR, too, because phase is an issue.)  

Now let's assume that we have a motion clock rate, which means:
more speed, more pulses - less speed, less pulses.

My idea is: 
By some sort of decimation I generate a sample rate which is 
proportional to the motion clock rate.
(Time between two consequent samples isn't constant, but varying 
with speed.)
These samples pass the filter, which is always the same.
After that, the former sample rate is restored by an adequate 
interpolation.

As an example, let's assume some realistic values:
basic (maximum) sample rate is 48kS/s
filter at max speed (passband 1kHz....10kHz),
filter at half speed  (0.5kHz...5kHz) etc.
filter should work downto (0.5Hz...5Hz), with steps smaller than 
1:1.5 or 1.5:1.
assume constant acceleration from min speed to max speed
within 1s.
Signal (samples) have spurious pulses (we might assume isolated, 
single pulses gauss-like) - which should pass the filter.

My challenges  are:

Which sort of distortions, degradations, etc. should I expect?

Certainly, decimation and interpolation will both contribute errors. 
Will I manage to get them out of band?

Is it necessary to have and will I achieve very fine-grained sample 
rate conversion at all?

The filter stage itself, would it "take notice" of the 
non-equidistant samples?

Since my idea is nothing more than a mapping from normal linear 
time-scale (with an accelerated filter) to another, non-linear time 
scale (with a fixed filter), and then back again, I would expect 
the same result as without this mapping.

So, will there be any advantage with this approach?
I guess so, because I get rid of filter calculations.

Curiously waiting for your hints...

Bernhard



Bernhard Holzmayer wrote:
> Background is a mechanical movement, accelerating from zero or very > slow speed to a predefined maximum speed. > Signals related to the speed have to be filtered with a bandpass > filter which follows with speed. > > Since modifiying filter coefficients on the fly is difficult > (transient distortions when switching coefficients) and inefficient > (calculation or memory intensive), I had another idea and I would > like to receive some feedback - opinions, experience, directions... > > Basic filter should be something like 4th order butterworth > bandpass. (Might be FIR, too, because phase is an issue.) > > Now let's assume that we have a motion clock rate, which means: > more speed, more pulses - less speed, less pulses. > > My idea is: > By some sort of decimation I generate a sample rate which is > proportional to the motion clock rate. > (Time between two consequent samples isn't constant, but varying > with speed.) > These samples pass the filter, which is always the same. > After that, the former sample rate is restored by an adequate > interpolation. > > As an example, let's assume some realistic values: > basic (maximum) sample rate is 48kS/s > filter at max speed (passband 1kHz....10kHz), > filter at half speed (0.5kHz...5kHz) etc. > filter should work downto (0.5Hz...5Hz), with steps smaller than > 1:1.5 or 1.5:1. > assume constant acceleration from min speed to max speed > within 1s. > Signal (samples) have spurious pulses (we might assume isolated, > single pulses gauss-like) - which should pass the filter. > > My challenges are: > > Which sort of distortions, degradations, etc. should I expect? > > Certainly, decimation and interpolation will both contribute errors. > Will I manage to get them out of band? > > Is it necessary to have and will I achieve very fine-grained sample > rate conversion at all? > > The filter stage itself, would it "take notice" of the > non-equidistant samples? > > Since my idea is nothing more than a mapping from normal linear > time-scale (with an accelerated filter) to another, non-linear time > scale (with a fixed filter), and then back again, I would expect > the same result as without this mapping. > > So, will there be any advantage with this approach? > I guess so, because I get rid of filter calculations. > > Curiously waiting for your hints... > > Bernhard > > >
This sounds like one of those ideas that seems good at first but gets more and more complicated the deeper you get into it, until finally you find that you've bitten off more than you can chew. If you do pursue it you could probably use some sort of polyphase filtering algorithm to do the decimation and reconstruction -- I'm not sure how much computation you'll need to handle the constantly-varying sample rate, however. OTOH, have you considered building a filter that is consistent in the states, so you can change your filter coefficients without causing transients? If you realize your filter in state-space such that x = Ax + Bu, y = xC and keep the output vector ('C') constant then your filter shouldn't contribute any transient behavior as the frequency changes (heaven knows about the thing you're measuring, though). You _will_ have to design the filter yourself, but that's fun. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Bernhard Holzmayer wrote:

> Background is a mechanical movement, accelerating from zero or very > slow speed to a predefined maximum speed. > Signals related to the speed have to be filtered with a bandpass > filter which follows with speed. > > *[SNIP]* > > Now let's assume that we have a motion clock rate, which means: > more speed, more pulses - less speed, less pulses. > > My idea is: > By some sort of decimation I generate a sample rate which is > proportional to the motion clock rate. > [snip]
I think we need more details of what you are trying to accomplish - not what means you were going to use. [ Jerry and others will recognize me giving advice I've received in various fora ;] For Example: What came to mind reading your description was analyzing vibration as a rotating member came up to speed. My thought would be, "Why not sync samples to angular position rather than time?" And YES, I can think of situations that it wouldn't work. Twas just an example to show why we need to know more about your environment.
Richard Owlett wrote:
> Bernhard Holzmayer wrote: > >> Background is a mechanical movement, accelerating from zero or very >> slow speed to a predefined maximum speed. >> Signals related to the speed have to be filtered with a bandpass >> filter which follows with speed. >> >> *[SNIP]* >> >> Now let's assume that we have a motion clock rate, which means: >> more speed, more pulses - less speed, less pulses. >> >> My idea is: By some sort of decimation I generate a sample rate which >> is proportional to the motion clock rate. >> [snip] > > > I think we need more details of what you are trying to accomplish - not > what means you were going to use. > [ Jerry and others will recognize me giving advice I've received in > various fora ;] > > For Example: > > What came to mind reading your description was analyzing vibration as a > rotating member came up to speed. > > My thought would be, "Why not sync samples to angular position rather > than time?" > > And YES, I can think of situations that it wouldn't work. > Twas just an example to show why we need to know more about your > environment. >
I was wondering that myself. But doing it without changing the sample speed is so much more fun to give advise about. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Tim Wescott wrote:

> This sounds like one of those ideas that seems good at first but > gets more and more complicated the deeper you get into it, until > finally you find that you've bitten off more than you can chew.
I see. I remember such approaches - months passing while chewing... when we ride over country in our car, my wife and my children usually sigh if I happen to discover a road which seems to promise to be a nearer or prettier way - until a couple of hours later, I have to realize that it wasn't. Maybe, I HAVE to find out, if this thing works... not sure yet.
> > If you do pursue it you could probably use some sort of polyphase > filtering algorithm to do the decimation and reconstruction -- I'm > not sure how much computation you'll need to handle the > constantly-varying sample rate, however.
That was the first thing I thought of: polyphase filtering. But I guess, it becomes complicated if sample rate keeps changing.
> > OTOH, have you considered building a filter that is consistent in > the states, so you can change your filter coefficients without > causing > transients? If you realize your filter in state-space such that > > x = Ax + Bu, y = xC > > and keep the output vector ('C') constant then your filter > shouldn't contribute any transient behavior as the frequency > changes (heaven knows > about the thing you're measuring, though). You will have to > design the filter yourself, but that's fun. >
No, I didn't try an approach using state-space form. That's because my task requires steep filters in combination with bad Fc/Fs relation. With this in background, I preferred SOS structures of DF1, which promise best behavior through switching. But now, when I read your proposal, I guess it might be worth trying from this side. Bernhard
Richard Owlett wrote:

> I think we need more details of what you are trying to accomplish > - not what means you were going to use.
Ok. Here's a brief description of what's behind. ( see www.foerstergroup.de ) A signal is coupled into a metallic surface. A probe measures eddy currents in the neighborhood. These currents are filtered and represent the quality of the surface. This could be the production line of a rod, wire or tube. During the production process, the line might stop, then accelerate until it reaches normal process speed, then slows down again etc. If you imagine a fissure / flaw on the material, this will generate a peak on the signal. The system's goal is to find and measure these peaks. Usually, the system is part of the production line and the flaws are automatically treated (marked, sorted out). Such a peak which is generated by a material flaw is sort of an image of the geometrical form of the flaw. If we want to receive the same image independent of the transport speed, we must scale the samples according to the transport speed. Given, we're not interested in the speed itself, but only in the geometrics of the material, and especially in the geometrics of the flaws. Then, it's a challenging idea to couple sample rate and transport speed. Currently, we work with an analog system with butterworth filters of 4th to 6th order and dynamic range of around 100 dB. We have not been able to slide these filters because of the transient effects. Instead we use a tchebycheff of 2nd order in addition which is moved proportional to the speed. (Filters are from 0.25Hz to 16kHz, for both HPF and LPF) If nominal transport speed is high, LPF must be high, too. Let's assume that it has to sit at 16kHz. When transport speed falls to almost zero, then signal frequency content is lower, HPF must be down at the acceptable minimum (maybe 1Hz). Result is a very bad Fc/Fs ratio of 1/48.000, if we sample at reasonable 48kS/s. But we can only reduce sample rate, if we can bandlimit the signal, this is, if we can move the LPF down. As soon as transport speed rises, we can increase HPF and LPF. So, we have bad conditions at low speed, because of bad Fc/Fs. But we cannot reduce sample rate in case of high transport speed. That's why I had the idea to dynamically adjust the sample rate. I gathered some experience: An adjustment of sample rate or filter positions every 10...30ms and the resulting steps would be acceptable, longer intervals wouldn't. Bernhard
Bernhard Holzmayer wrote:

> Richard Owlett wrote: > > >>I think we need more details of what you are trying to accomplish >>- not what means you were going to use. > > > > Ok. Here's a brief description of what's behind. > ( see www.foerstergroup.de ) > > A signal is coupled into a metallic surface. > A probe measures eddy currents in the neighborhood. > These currents are filtered and represent the quality of the > surface. > This could be the production line of a rod, wire or tube. > During the production process, the line might stop, then accelerate > until it reaches normal process speed, then slows down again etc. > > If you imagine a fissure / flaw on the material, this will generate > a peak on the signal. The system's goal is to find and measure > these peaks. Usually, the system is part of the production line > and the flaws are automatically treated (marked, sorted out). > > Such a peak which is generated by a material flaw is sort of an > image of the geometrical form of the flaw. > If we want to receive the same image independent of the transport > speed, we must scale the samples according to the transport speed. > > Given, we're not interested in the speed itself, but only in the > geometrics of the material, and especially in the geometrics of the > flaws. > > Then, it's a challenging idea to couple sample rate and transport > speed. > > Currently, we work with an analog system with butterworth filters of > 4th to 6th order and dynamic range of around 100 dB. > We have not been able to slide these filters because of the > transient effects. Instead we use a tchebycheff of 2nd order in > addition which is moved proportional to the speed. > (Filters are from 0.25Hz to 16kHz, for both HPF and LPF) > > If nominal transport speed is high, LPF must be high, too. > Let's assume that it has to sit at 16kHz. > When transport speed falls to almost zero, then signal frequency > content is lower, HPF must be down at the acceptable minimum (maybe > 1Hz). Result is a very bad Fc/Fs ratio of 1/48.000, if we sample at > reasonable 48kS/s. > But we can only reduce sample rate, if we can bandlimit the signal, > this is, if we can move the LPF down. > As soon as transport speed rises, we can increase HPF and LPF. > > So, we have bad conditions at low speed, because of bad Fc/Fs. > But we cannot reduce sample rate in case of high transport speed. > > That's why I had the idea to dynamically adjust the sample rate. > > I gathered some experience: > An adjustment of sample rate or filter positions every 10...30ms and > the resulting steps would be acceptable, longer intervals wouldn't. > > Bernhard
Thanks for the details. I just might have an idea. There are two factors that need attention. One affects the signal, the other, the analysis. The eddy-current pick-up is sensitive to speed. Providing a gain inversely proportional to speed can work above some low speed, but I think that slower than that, you're out of luck. The frequency of the data are proportional to speed. That seems to raise a difficulty, but it needn't. You don't need to tune the filters if you lock the speed at which they're clocked to the speed of work through the die. That approach isn't available with analog circuits, so it might not occur to us old hands. Still the option to sample uniformly in space rather than in time shouldn't be overlooked. The axis change keeps the essence of the math intact. Nicht wahr? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
I think what Jerry and Tim just said
(with obvious bias towards my comments :)

Sample at intervals that are linear in process output.
Adjust sensor gains as a function of process rate.

[Too many engineers in loop
  we techs must correct ;]

Jerry Avins wrote:

> Bernhard Holzmayer wrote: > >> Richard Owlett wrote: >> >> >>>I think we need more details of what you are trying to accomplish >>>- not what means you were going to use. >> >> >> >> Ok. Here's a brief description of what's behind. >> ( see www.foerstergroup.de ) >> >> A signal is coupled into a metallic surface. >> A probe measures eddy currents in the neighborhood. >> These currents are filtered and represent the quality of the >> surface. >> This could be the production line of a rod, wire or tube. >> During the production process, the line might stop, then >> accelerate until it reaches normal process speed, then slows down >> again etc. >> >> If you imagine a fissure / flaw on the material, this will >> generate a peak on the signal. The system's goal is to find and >> measure these peaks. Usually, the system is part of the >> production line and the flaws are automatically treated (marked, >> sorted out). >> >> Such a peak which is generated by a material flaw is sort of an >> image of the geometrical form of the flaw. >> If we want to receive the same image independent of the transport >> speed, we must scale the samples according to the transport >> speed. >> >> Given, we're not interested in the speed itself, but only in the >> geometrics of the material, and especially in the geometrics of >> the flaws. >> >> Then, it's a challenging idea to couple sample rate and transport >> speed. >> >> Currently, we work with an analog system with butterworth filters >> of 4th to 6th order and dynamic range of around 100 dB. >> We have not been able to slide these filters because of the >> transient effects. Instead we use a tchebycheff of 2nd order in >> addition which is moved proportional to the speed. >> (Filters are from 0.25Hz to 16kHz, for both HPF and LPF) >> >> If nominal transport speed is high, LPF must be high, too. >> Let's assume that it has to sit at 16kHz. >> When transport speed falls to almost zero, then signal frequency >> content is lower, HPF must be down at the acceptable minimum >> (maybe 1Hz). Result is a very bad Fc/Fs ratio of 1/48.000, if we >> sample at reasonable 48kS/s. >> But we can only reduce sample rate, if we can bandlimit the >> signal, this is, if we can move the LPF down. >> As soon as transport speed rises, we can increase HPF and LPF. >> >> So, we have bad conditions at low speed, because of bad Fc/Fs. >> But we cannot reduce sample rate in case of high transport speed. >> >> That's why I had the idea to dynamically adjust the sample rate. >> >> I gathered some experience: >> An adjustment of sample rate or filter positions every 10...30ms >> and the resulting steps would be acceptable, longer intervals >> wouldn't. >> >> Bernhard > > Thanks for the details. I just might have an idea. There are two > factors that need attention. One affects the signal, the other, > the analysis. > > The eddy-current pick-up is sensitive to speed. Providing a gain > inversely proportional to speed can work above some low speed, but > I think that slower than that, you're out of luck.
Sensitivity to speed is probably not critical. Differential coils have a highpass effect, which will cause trouble around zero speed. With other coils we have almost no speed dependency. Maybe I should provide another piece of information: We introduce a stationary magnetic field (e.g. sine wave of 100kHz). The sensor coil receives this signal, the geometrical information is in the modulation (e.g. <10kHz). This method works even without speed, and since speed is low (maybe 0..1m/s) with respect to the chosen frequency, we can ignore the speed's influence to signal amplitude. The only handicap is that the current analog high-pass filter cannot handle too low speeds, so we either have to switch it off and lose the filter effect, or we have to stop measurements if speed drops beyond the limit. We hope to remove this limitation by applying intelligent algorithms to a digital system (see below).
> > The frequency of the data are proportional to speed. That seems to > raise a difficulty, but it needn't. You don't need to tune the > filters if you lock the speed at which they're clocked to the > speed of work through the die.
Stimmt genau. That's what led me to the idea behind this post. Maybe I didn't express it very well, because I was caught in FFT terms, where all is described based on time.
> That approach isn't available with > analog circuits, so it might not occur to us old hands. Still the > option to sample uniformly in space rather than in time shouldn't > be overlooked.
> The axis change keeps the essence of the math intact. > Nicht wahr? > > Jerry
Das ist des Pudels Kern. Thanks for that change of aspect. This helps me very much. I had this in mind: even when the line comes to a stop, and if no new samples are fed into the filter, it just waits (without the previous samples fading away). Then, as the line proceeds again, the filter is fed with new samples, and goes on filtering - providing the same result as if there hadn't been a stop. With your point of view, this reads: every position increment provides a sample, which is fed into a filter. Out comes the filtered signal. There's no need to even tell that the line went slow or fast or came to a stop... I like it. I'm sure that mathematics will hold. All that complicated interpretation because of different line speeds gets away, and leaves a quasi static situation, which is much easier to treat. I'm not sure, if physics will be that easy if related to position. Speed-variant effects like those caused by a differential coil which provides no signal if the line stops will certainly be a handicap, because the speed-information isn't available in the processed signal any more. There may occur other effects which hadn't attracted attention up to now because they were hidden behind the filters. Now they might fold into the signal range (bandpass). I'll meditate on this during my holidays (starting on weekend :-). Bernhard
Bernhard Holzmayer wrote:

> Jerry Avins wrote:
...
>>The eddy-current pick-up is sensitive to speed. Providing a gain >>inversely proportional to speed can work above some low speed, but >>I think that slower than that, you're out of luck. > > > Sensitivity to speed is probably not critical. Differential coils > have a highpass effect, which will cause trouble around zero speed. > With other coils we have almost no speed dependency. > Maybe I should provide another piece of information: > We introduce a stationary magnetic field (e.g. sine wave of 100kHz). > The sensor coil receives this signal, the geometrical information is > in the modulation (e.g. <10kHz). > This method works even without speed, and since speed is low (maybe > 0..1m/s) with respect to the chosen frequency, we can ignore the > speed's influence to signal amplitude.
I can't decide between "very clever" and "how stupid of me not to assume that". Whatever, I like the way you do things.
> The only handicap is that the current analog high-pass filter cannot > handle too low speeds, so we either have to switch it off and lose > the filter effect, or we have to stop measurements if speed drops > beyond the limit. We hope to remove this limitation by applying > intelligent algorithms to a digital system (see below). > > >>The frequency of the data are proportional to speed. That seems to >>raise a difficulty, but it needn't. You don't need to tune the >>filters if you lock the speed at which they're clocked to the >>speed of work through the die. > > > Stimmt genau. > That's what led me to the idea behind this post. > Maybe I didn't express it very well, because I was caught in FFT > terms, where all is described based on time. > > >>That approach isn't available with >>analog circuits, so it might not occur to us old hands. Still the >>option to sample uniformly in space rather than in time shouldn't >>be overlooked. > > >>The axis change keeps the essence of the math intact. >>Nicht wahr? >> >>Jerry > > > Das ist des Pudels Kern.
Pudel? Hund?
> Thanks for that change of aspect. This helps me very much. > > I had this in mind: even when the line comes to a stop, and if no > new samples are fed into the filter, it just waits (without the > previous samples fading away). Then, as the line proceeds again, > the filter is fed with new samples, and goes on filtering - > providing the same result as if there hadn't been a stop. > > With your point of view, this reads: > every position increment provides a sample, which is fed into a > filter. Out comes the filtered signal. > > There's no need to even tell that the line went slow or fast or came > to a stop... I like it. > > I'm sure that mathematics will hold. All that complicated > interpretation because of different line speeds gets away, and > leaves a quasi static situation, which is much easier to treat. > > I'm not sure, if physics will be that easy if related to position. > Speed-variant effects like those caused by a differential coil which > provides no signal if the line stops will certainly be a handicap, > because the speed-information isn't available in the processed > signal any more. There may occur other effects which hadn't > attracted attention up to now because they were hidden behind the > filters. Now they might fold into the signal range (bandpass).
I would plan for a second channel where each sample is the speed information associated with a corresponding eddy-current sample. If it's not needed, leave it out of the next unit. If it's useful, you won't be tempted to get by with a work-around.
> I'll meditate on this during my holidays (starting on weekend :-).
Enjoy! Jerry -- Engineering is the art of making what you want from things you can get. &#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;