help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lsim and butter for octave


From: Erich Schneider
Subject: lsim and butter for octave
Date: Thu, 24 Sep 98 18:12:32

Since I need to use matlab's lsim and butter intensively I have ported
them to octave. However, there were only minor modifications of the
original matlab files necessary.

I had to write ltitr.oct as a replacement for matlab's builtin function
ltitr. This function is called by lsim. The output of butter can be
used in octave's filter function.

The following files are needed for lsim and butter to work properly:

CPLXPAIR.M  LP2LP.M     SSSELECT.M  abcdchck.m  buttap.m    ltitr.cc
LP2BP.M     LSIM.M      TF2SS.M     abcdchk.m   butter.m    ltitr.oct
LP2BS.M     SERIES.M    TFCHK.M     append.m    cloop.m     stest.m
LP2HP.M     SS2ZP.M     ZP2SS.M     bilinear.m  lltitr.m

Since a part of the files remained unchanged, I'm not quite sure how to
distribute them to people who are interested in using them without
hurting matlab's copyrights. Maybe someone could give me an advice.

BTW, when trying to port these files there was a problem with the
indexing of vectors. If I define a vector d = [3 4 5 6] I get this
answer for d(d>1):

>d=[3 4 5 6];
>d(d>1)
ans =
  3  3  3  3

The indexing mechanism seems to be buggy when the indexing vector only
consists of ones. As soon as the vector contains a 0 it works as
expected. If I want to get d(d>4) I get the right answer:

oct:115>d(d>4)
ans =
  5  6

A workaround is to use e.g. d(find(d>1)). However, since a lot of
m-files use this indexing technique this is pretty annoying bug.

Regards,
Erich Schneider



----------------------------------------------------------------------
Erich Schneider, Dipl.-Phys.     | address@hidden
Neurologische Forschung          | address@hidden
Ludwig-Maximilians-Universit"at  | 
Klinikum Grosshadern, M"unchen   | Fax: +49,89,70906,101



reply via email to

[Prev in Thread] Current Thread [Next in Thread]