"y=recur(a, b, x, x0, y0)"
seems to do the same job as the built-in function
"[Y, SF] = filter (B, A, X, SI, DIM)".

upulse, uramp, ustep would be best place in the signal-processing
package, but each can be written as a "single" line of code.

   # for upulse:
     t0=5;
     y=zeros(10,1); y(t0)=1
   # for uramp:
     y=[zeros(1,t0) 1:n-t0]
   # for ustep:
     y=[0:9]>=t0

On Sat, Aug 08, 2009 at 10:36:09PM +1000, Lyle Collins wrote:
> Attached to this email I have attached three functions which I consider
> useful in octave. I'm not sure whether they are adequately coded, but no
> worries if they are not. The general idea of each function is as follows:
> 
> y = recur(a, b, x, x0, y0) : Returns a vector equal in length to that of x,
> which is the solution to a causal discrete system equation, where x is the
> input and y the output. 'a' and 'b' corresponds to the coefficients of y and
> x respectively, given that the equation is of following form:
> 
> y[n] = a(0)y[n-1] + a(1)y[n-2] + ... + b(0)x[n] + b(1)x[n-1] + ....
> 
> x0 and y0 are the intial conditions.
> 
> y = upulse(t,t0): Returns vector equal in length to t and defined as y(t) =
> 0 if t != t0, y(t) = 1 if t = t0.
> 
> y = uramp(t,t0): Returns vector equal in length to t and defined as y(t) = 0
> if t < t0, y(t) = t if t >= t0.
> 
> y = ustep(t,t0): Returns vector equal in length to t and defined as y(t) = 0
> if t < t0, y(t) = 1 if t >= t0.
> 
> I hope these functions are of some use.
> Lyle

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to