Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!hp-pcd!hplsla!bobc From: bobc@hplsla.HP.COM (Bob Cutler) Newsgroups: comp.sys.handhelds Subject: Re: Convolution Algerbra Message-ID: <10130001@hplsla.HP.COM> Date: 10 Dec 90 17:59:51 GMT References: <1990Dec8.224427.513@en.ecn.purdue.edu> Organization: HP Lake Stevens, WA Lines: 51 Here's a program I've been using on my 28s. There's probably a more efficient way to write a convolution program, but what the heck, it works. CONV expects two vectors on the stack as input and returns a vector. For example, To solve: (3x^2 +2x + 1)( x + 5) Enter: [3 2 1] [ 1 5] 'CONV' The result is [ 3 17 11 5] or (3x^4 + 17x^2 + 11x + 5) Enjoy, Bob Cutler KE7ZJ Hewlett-Packard Lake Stevens Instrument Division Everett, WA 98205 ---------------------------------------------------------------------- 'CONV' << -> A << -> B << A SIZE LIST-> DROP B SIZE LIST-> DROP + 1 - -> N << A N 1 -> LIST RDM -> A << B N 1 ->LIST RDM -> B << 1 N FOR I 0 1 I FOR J A J GET B I J - 1 + GET * + NEXT NEXT N -> ARRY >> >> >> >> >> >>