Reply by Robert Adams February 24, 20092009-02-24
On Feb 24, 6:57�pm, buleg...@columbus.rr.com wrote:
> On Feb 24, 11:32&#4294967295;am, Vladimir Vassilevsky <antispam_bo...@hotmail.com> > wrote: > > > &#4294967295; - Why it is impossible to have sex in the middle of the Red Square in > > Moscow? > > I thought it was because the communist regime neutered all the men > rendering them all impotent
Your formula does not look right, for example;
> Output = ([1/(2^n -1)]*input) + ([2^n/(2^n -1)]*PreviousOutput)
will be unstable because the coefficient applied to the previousOutput is > 1. What is much more common is; 2^-n H(z) = --------------------------------- [1 - (1- (2^-n))*Z^-1 )] The reason this is common is that 2^-n is just a shift and therefore the the implementation does not require a multiplier (and if you are slightly clever, the shift can be shared between numerator and denominator). The drawback is that the cutoff frequency is very coarsely quantized, depending on n. It is also nice that the DC gain is 1.0 by construction. Bob Adams
Reply by February 24, 20092009-02-24
On Feb 24, 11:32&#4294967295;am, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> &#4294967295; - Why it is impossible to have sex in the middle of the Red Square in > Moscow? >
I thought it was because the communist regime neutered all the men rendering them all impotent
Reply by HardySpicer February 24, 20092009-02-24
On Feb 25, 1:36 am, Glen Herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> steveu wrote: > >>Rohit wrote: > > (snip) > > >>>I googled a lot about IIR filters but nowhere I could find this > >>>formula. > >>Yes it is an IIR filter. It might be that it is used more by > >>statisticians than EE/CS so it has a different name. > > (snip) > > > Huh? I would have thought the basic single pole LPF was about the most > > used filter for statisticians, EE, CS, DSP, or just about any other > > denomination of folks who filter that I can think of. > > I have never seen the term "IIR filter" in a statistics book, > or anything related to poles. > > The same filter under a different name. > > -- glen
They use the terms Autoregressive Moving Average (ARMA) or just AR lets say. Hardy
Reply by cpshah99 February 24, 20092009-02-24
> > - Why it is impossible to have sex in the middle of the Red Square in >Moscow? > > - Because every idiot bystander will be trying to give you the >invaluable advice of how to do it. > > >VLV >
%%% Somebody might even record that and put it on youtube..
Reply by Vladimir Vassilevsky February 24, 20092009-02-24
  - Why it is impossible to have sex in the middle of the Red Square in 
Moscow?

  - Because every idiot bystander will be trying to give you the 
invaluable advice of how to do it.


VLV
Reply by Tim Wescott February 24, 20092009-02-24
On Tue, 24 Feb 2009 04:10:15 -0800, Rohit wrote:

> On Feb 24, 1:44&nbsp;pm, "mboigner" <mboig...@two-pi.com> wrote: >> > &nbsp;/* First order IIR filter z-transform(formula): >> >> > &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ 2^-n/(1-(2^-n)) ] >> > &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;H(z) = --------------------------------- >> > &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [1 - ( &nbsp;(1/ (1- (2^-n)))*Z^-1 &nbsp;)] >> >and the final equation which is implemented into code is a sfollows: >> >> >Output = ([1/(2^n -1)]*input) + ([2^n/(2^n -1)]*PreviousOutput) >> >> Hello Rohit, >> >> It is an IIR. >> >> Best Regards, >> Markus >> >> PS: general transfer function for first order IIR: >> >> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;b0 >> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; H(z) = ------------------------ >> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[1 - ( &nbsp; a1 &nbsp;* Z^-1 &nbsp;)] >> >> y[n] = x[n] b0 + y[n-1] * a1 >> >> y[n] is the same as Output in your formula, y[n-1] the same as >> PreviousOutput and x[n] is input, n is time index. > > Thanks to all for help. Possibly I could not convey my question > properly. I do not know z- transform and filter design. I am a C > programmer and I need to verify that whether the equation implemented in > code i.e. > > Output = ([1/(2^n -1)]*input) + ([2^n/(2^n -1)] > *PreviousOutput)...........................Eq.1 > > is implementing the 1st order IIR filter whose z - transform function is > > [ 2^-n/(1-(2^-n)) ] > H(z) = > --------------------------------- > .....................................Eq. 2 > [1 - ( (1/ (1- (2^-n)))*Z^-1 )] > where n is filter constant. > > I am sure that Eq.1 is implemented correctly in code. But whether Eq.1 > implements the requirement i.e. Eq.2 or not, is the question. > > So if anybody could help me in deriving Eq.1 from Eq.2, I will deeply > appreciate. > > --Rohit
Does this help? http://www.wescottdesign.com/articles/zTransform/z-transforms.html -- http://www.wescottdesign.com
Reply by Andor February 24, 20092009-02-24
Rohit wrote:
> Dear All, > > I do not have any background in DSP, so please excuse if this question > seems silly. > I am working on a bugfix for an IIR filter implementation in C. > It takes samples from ADC and filters them. Filtering is done by an > First order IIR filter. > The transfer function is as follows: > &#4294967295; /* First order IIR filter z-transform(formula): > > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;[ 2^-n/(1-(2^-n)) ] > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; H(z) = --------------------------------- > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;[1 - ( &#4294967295;(1/ (1- (2^-n)))*Z^-1 &#4294967295;)] > and the final equation which is implemented into code is a sfollows: > > Output = ([1/(2^n -1)]*input) + ([2^n/(2^n -1)]*PreviousOutput) > > I googled a lot about IIR filters but nowhere I could find this > formula. > Can anyone of you please throw a light on whether this formula really > implements an IIR filter or not, > and where to find more information on this.
Rick Lyons explains exactly this filter in a recent blog of his: http://www.dsprelated.com/showarticle/72.php
Reply by Glen Herrmannsfeldt February 24, 20092009-02-24
steveu wrote:

>>Rohit wrote:
(snip)
>>>I googled a lot about IIR filters but nowhere I could find this >>>formula.
>>Yes it is an IIR filter. It might be that it is used more by >>statisticians than EE/CS so it has a different name.
(snip)
> Huh? I would have thought the basic single pole LPF was about the most > used filter for statisticians, EE, CS, DSP, or just about any other > denomination of folks who filter that I can think of.
I have never seen the term "IIR filter" in a statistics book, or anything related to poles. The same filter under a different name. -- glen
Reply by Rohit February 24, 20092009-02-24
On Feb 24, 1:44&#4294967295;pm, "mboigner" <mboig...@two-pi.com> wrote:
> > &#4294967295;/* First order IIR filter z-transform(formula): > > > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; [ 2^-n/(1-(2^-n)) ] > > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;H(z) = --------------------------------- > > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; [1 - ( &#4294967295;(1/ (1- (2^-n)))*Z^-1 &#4294967295;)] > >and the final equation which is implemented into code is a sfollows: > > >Output = ([1/(2^n -1)]*input) + ([2^n/(2^n -1)]*PreviousOutput) > > Hello Rohit, > > It is an IIR. > > Best Regards, > Markus > > PS: general transfer function for first order IIR: > > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;b0 > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; H(z) = ------------------------ > &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;[1 - ( &#4294967295; a1 &#4294967295;* Z^-1 &#4294967295;)] > > y[n] = x[n] b0 + y[n-1] * a1 > > y[n] is the same as Output in your formula, y[n-1] the same as > PreviousOutput and x[n] is input, n is time index.
Thanks to all for help. Possibly I could not convey my question properly. I do not know z- transform and filter design. I am a C programmer and I need to verify that whether the equation implemented in code i.e. Output = ([1/(2^n -1)]*input) + ([2^n/(2^n -1)] *PreviousOutput)...........................Eq.1 is implementing the 1st order IIR filter whose z - transform function is [ 2^-n/(1-(2^-n)) ] H(z) = --------------------------------- .....................................Eq. 2 [1 - ( (1/ (1- (2^-n)))*Z^-1 )] where n is filter constant. I am sure that Eq.1 is implemented correctly in code. But whether Eq.1 implements the requirement i.e. Eq.2 or not, is the question. So if anybody could help me in deriving Eq.1 from Eq.2, I will deeply appreciate. --Rohit
Reply by steveu February 24, 20092009-02-24
>Rohit wrote: > >> I am working on a bugfix for an IIR filter implementation in C. >> It takes samples from ADC and filters them. Filtering is done by an >> First order IIR filter. >> The transfer function is as follows: >> /* First order IIR filter z-transform(formula): >> >> [ 2^-n/(1-(2^-n)) ] >> H(z) = --------------------------------- >> [1 - ( (1/ (1- (2^-n)))*Z^-1 )] >> and the final equation which is implemented into code is a sfollows: > >> Output = ([1/(2^n -1)]*input) + ([2^n/(2^n -1)]*PreviousOutput) > >http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average > >(Though the two coefficients should add to one, not subtract to one, >in the usual case.) > >> I googled a lot about IIR filters but nowhere I could find this >> formula. > >Yes it is an IIR filter. It might be that it is used more by >statisticians than EE/CS so it has a different name. > >> Can anyone of you please throw a light on whether this >> formula really implements an IIR filter or not, >> and where to find more information on this. > >http://en.wikipedia.org/wiki/Moving_average > >Otherwise, statistics books.
Huh? I would have thought the basic single pole LPF was about the most used filter for statisticians, EE, CS, DSP, or just about any other denomination of folks who filter that I can think of. Steve