PDA

View Full Version : Simple Discrete integrator question


vinching
12-07-2006, 05:09 PM
Hi all,

I am new here and would like to ask questions about discrete integrator.

>>>How can I characterise a discrete integrator??
for example I can measure the time constant of a continous integrator, ca
i do so with discete integrator?? Is there any other characteristics?? lik
gain??

>>>If I build a discrete integrator how can i measure the characteristi
you have mentioned??
For example input a step input and measure its declay time, etc.

Thanks for your help
Vincent

Martin Eisenberg
12-07-2006, 07:16 PM
vinching wrote:

> I am new here and would like to ask questions about discrete
> integrator.

I assume you mean the recurrence y[n] = x[n] + a y[n-1]
with transfer function H(z) = 1/(1 - a/z), a in (0,1).

>>>>How can I characterise a discrete integrator??
> for example I can measure the time constant of a continous
> integrator, can i do so with discete integrator??

It's easy to see that the impulse response of H(z) above is
h[n] = a^n, n >= 0. Now a^n = e^(n ln(a)), so you could call
tau = 1/ln(a) the time constant in samples and tau' = tau/f_s
the time constant in seconds, where fs is your sampling frequency.

> Is there any other characteristics?? like gain??

The integrator's gain of course depends on frequency. Frequency wraps
around the unit circle in the z-domain, so the gain (magnitude
spectrum) is M(w) = |H(e^(j w))| for angular frequency w.

If you meant the maximum gain which occurs at w = 0, that tells us
it's M_max = M(0) = |H(1)| = 1/(1 - a).

>>>>If I build a discrete integrator how can i measure the
>>>>characteristic you have mentioned??

Because the maximum gain occurs at zero frequency, the step response
approaches M_max as time grows. You can measure your implementation's
behavior by feeding it a step and generating output until it stops
changing, then compare the final value to the ideal M_max above.

You can measure the effective time constant similarly over some
"large" number of samples N. You'd apply the filter to the impulse
x = (1,0,0,0, ...) to get y[N]. This is approximately h[N], so
tau_eff = N / ln(y[N]).

"Measuring" the whole spectrum could mean many different things, but
the results of http://groups.google.com/groups?q=group:comp.dsp+measure+filter+response
seem relevant.


Martin

--
Better to remain silent and be thought a fool,
than to speak out and remove all doubt.
--Abraham Lincoln

Martin Eisenberg
12-07-2006, 07:40 PM
vinching wrote:

> I am new here and would like to ask questions about discrete
> integrator.

I assume you mean the recurrence y[n] = x[n] + a y[n-1]
with transfer function H(z) = 1/(1 - a/z), a in (0,1).

>>>>How can I characterise a discrete integrator??
> for example I can measure the time constant of a continous
> integrator, can i do so with discete integrator??

It's easy to see that the impulse response of H(z) above is
h[n] = a^n, n >= 0. Now a^n = e^(n ln(a)), so you could call
tau = 1/ln(a) the time constant in samples and tau' = tau/f_s
the time constant in seconds, where fs is your sampling frequency.

> Is there any other characteristics?? like gain??

The integrator's gain of course depends on frequency. Frequency wraps
around the unit circle in the z-domain, so the gain (magnitude
spectrum) is M(w) = |H(e^(j w))| for angular frequency w.

If you meant the maximum gain which occurs at w = 0, that tells us
it's M_max = M(0) = |H(1)| = 1/(1 - a).

>>>>If I build a discrete integrator how can i measure the
>>>>characteristic you have mentioned??

Because the maximum gain occurs at zero frequency, the step response
approaches M_max as time grows. You can measure your implementation's
behavior by feeding it a step and generating output until it stops
changing, then compare the final value to the ideal M_max above.

You can measure the effective time constant similarly over some
"large" number of samples N. You'd apply the filter to the impulse
x = (1,0,0,0, ...) to get y[N]. This is approximately h[N], so
tau_eff = N / ln(y[N]).

"Measuring" the whole spectrum could mean many different things, but
the results of http://groups.google.com/groups?q=group:comp.dsp+measure+filter+response
seem relevant.


Martin

--
Better to remain silent and be thought a fool,
than to speak out and remove all doubt.
--Abraham Lincoln

Heid the baw - goal!!
12-08-2006, 06:53 AM
"Martin Eisenberg" <[email protected]> wrote in message
news:1165518969.711899@localhost...
> vinching wrote:
>
> > I am new here and would like to ask questions about discrete
> > integrator.
>
> I assume you mean the recurrence y[n] = x[n] + a y[n-1]
> with transfer function H(z) = 1/(1 - a/z), a in (0,1).
>

That's not a pure integrator - only when a=1.


Tam



--
Posted via a free Usenet account from http://www.teranews.com

Heid the baw - goal!!
12-08-2006, 06:54 AM
"Martin Eisenberg" <[email protected]> wrote in message
news:1165520435.913210@localhost...
> vinching wrote:
>
> > I am new here and would like to ask questions about discrete
> > integrator.
>
> I assume you mean the recurrence y[n] = x[n] + a y[n-1]
> with transfer function H(z) = 1/(1 - a/z), a in (0,1).
>
>
That's a low-pass filter. Some uniformed people call it a leaky integrator
of course.

Tam



--
Posted via a free Usenet account from http://www.teranews.com

Martin Eisenberg
12-08-2006, 03:37 PM
Heid the baw - goal!! wrote:
> "Martin Eisenberg" <[email protected]> wrote in message
> news:1165520435.913210@localhost...
>> vinching wrote:
>>
>> > I am new here and would like to ask questions about discrete
>> > integrator.
>>
>> I assume you mean the recurrence y[n] = x[n] + a y[n-1]
>> with transfer function H(z) = 1/(1 - a/z), a in (0,1).
>
> That's a low-pass filter. Some uniformed people call it a leaky
> integrator of course.

The reason for calling it that may be any mixture of ignorance and
convenience. Vincent can clarify if I missed his understanding.


Martin

--
Sphinx of black quartz, judge my vow!
--David Lemon

Jerry Avins
12-08-2006, 03:57 PM
Martin Eisenberg wrote:
> Heid the baw - goal!! wrote:
>> "Martin Eisenberg" <[email protected]> wrote ...

It is usually unproductive to reply to trolls.

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Andor
12-08-2006, 04:03 PM
On 8 Dez., 16:57, Jerry Avins <[email protected]> wrote:
> Martin Eisenberg wrote:
> > Heid the baw - goal!! wrote:
> >> "Martin Eisenberg" <[email protected]> wrote ...
>It is usually unproductive to reply to trolls.

Why troll? Tam's objection is solid: a stable lowpass filter is not an
integrator.

Regards,
Andor

Jerry Avins
12-08-2006, 04:13 PM
Andor wrote:
>
> On 8 Dez., 16:57, Jerry Avins <[email protected]> wrote:
>> Martin Eisenberg wrote:
>>> Heid the baw - goal!! wrote:
>>>> "Martin Eisenberg" <[email protected]> wrote ...
>> It is usually unproductive to reply to trolls.
>
> Why troll? Tam's objection is solid: a stable lowpass filter is not an
> integrator.

Read all his messages. I have yet to see a productive answer. A short
quibble seems to be his recurring style.

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Scott Seidman
12-08-2006, 04:30 PM
"Andor" <[email protected]> wrote in news:1165593781.238754.117100@
16g2000cwy.googlegroups.com:

>
>
> On 8 Dez., 16:57, Jerry Avins <[email protected]> wrote:
>> Martin Eisenberg wrote:
>> > Heid the baw - goal!! wrote:
>> >> "Martin Eisenberg" <[email protected]> wrote ...
>>It is usually unproductive to reply to trolls.
>
> Why troll? Tam's objection is solid: a stable lowpass filter is not an
> integrator.
>
> Regards,
> Andor
>

A low pass filter with an infinite time constant is the mathematical
equivalent of an integrator. One could thus think of a low pass filter
with a smaller time constant as a leaky integrator. If you want to The
term became popular because often we want to integrate, but we really want
the integration to leak a bit to avoid saturation, and in the analog world,
the integrator is only as good as the "real" capacitors used to implement
them.

Think about a perfect integrator, and subtract a low-pass "leak" term, and
what you'll get back is a low pass filter.

--
Scott
Reverse name to reply

Ikaro
12-08-2006, 04:42 PM
> Why troll? Tam's objection is solid: a stable lowpass filter is not an
> integrator.

Because if he was so well informed he would know that an integrator is
a type of low-pass filter.

Granted, the integrated should really have a=1.
But worst than critizing Martin's good detailed post, is trying to get
personal on it.

vinching
12-08-2006, 06:10 PM
>Heid the baw - goal!! wrote:
>> "Martin Eisenberg" <[email protected]> wrote in message
>> news:1165520435.913210@localhost...
>>> vinching wrote:
>>>
>>> > I am new here and would like to ask questions about discrete
>>> > integrator.
>>>
>>> I assume you mean the recurrence y[n] = x[n] + a y[n-1]
>>> with transfer function H(z) = 1/(1 - a/z), a in (0,1).
>>
>> That's a low-pass filter. Some uniformed people call it a leaky
>> integrator of course.
>
>The reason for calling it that may be any mixture of ignorance and
>convenience. Vincent can clarify if I missed his understanding.
>
>
>Martin
>
>--
>Sphinx of black quartz, judge my vow!
>--David Lemon
>

sorry for giving incomplete information the discrete integrator I am usin
have a transfer function H(Z)=1/(Z-1)

Vincent

Martin Eisenberg
12-11-2006, 03:56 PM
vinching wrote:

> sorry for giving incomplete information the discrete integrator
> I am using have a transfer function H(Z)=1/(Z-1)

Do you mean z/(z - 1)? Either way, the expression for the magnitude
spectrum doesn't depend on the specific transfer function H.

With the exact integrator, I can't easily assume what it is that you
want to measure about your implementation since roundoff error is
more important now. For instance, measuring the impulse response as I
described before you'll find the result is a perfect step --
perfect only because it never changes. The measured step resonse will
deviate from a straight line as it grows toward the processor's
wordsize limit, but quantifying that effect isn't useful if your
intended inputs won't resemble a piecewise constant.

So another way to characterise a discrete integrator is roundoff
noise behavior. Qualitatively, the large magnitude spectrum at low
frequencies leads to baseline drift over time. But for actual
measurements, make sure you include test signals from the class
you're most interested in.


Martin

--
Quidquid latine scriptum sit, altum viditur.