[Numpy-discussion] Recurrence relationships

Fabrice Silva silva@lma.cnrs-mrs...
Wed May 6 09:29:21 CDT 2009


Le mercredi 06 mai 2009 à 10:21 -0400, josef.pktd@gmail.com a écrit :
> On Wed, May 6, 2009 at 10:00 AM, Talbot, Gerry <Gerry.Talbot@amd.com> wrote:
> > Sorry, I guess I wasn't clear, I meant:
> >
> >        for n in xrange(1,N):
> >          y[n] = A*x[n] + B*y[n-1]
> >
> > So y[n-1] is the result from the previous loop iteration.
> >
> 
> I was using scipy.signal for this but I have to look up what I did
> exactly. I think either signal.correlate or using signal.lti.
> 
> Josef

Isn't it what scipy.signal.lfilter does ?
y=scipy.signal.lfilter([A],[1,-B],x)

You may be careful with initial conditions...
-- 
Fabrice Silva <silva@lma.cnrs-mrs.fr>
LMA UPR CNRS 7051



More information about the Numpy-discussion mailing list