help-octave
[Top][All Lists]
Advanced

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

Octave-IT++, Octave extensions to IT++ library, Re: Communications Toolb


From: Muthiah Annamalai
Subject: Octave-IT++, Octave extensions to IT++ library, Re: Communications Toolbox,
Date: Sat, 11 Mar 2006 16:44:57 -0800 (PST)

Steve,

IT++ for Octave will be like the latter scheme you described.
>octave:> convolutional_code (type_of_code, inverse_rate, ...
>constraint_length);
>octave:> output = convolutional_code_encode (input);

Im presently looking to form a sensible API for IT++ files that
includes access based on native Octave matrices and vectors,
and outputs in a similar form.

I will move only the IT++ Communication library and necessary
parts of IT++ base library into Octave functions via a .oct file.

To give you an example,  a typical file in /test/bch_test.cpp will
look like this when IT++ extensions for Octave are developed.

#! /usr/bin/octave -q

%*---------------------------------------------------------------------------*
%*                                   IT++                         *
%*---------------------------------------------------------------------------*
%* Copyright (c) 1995-2005 by Tony Ottosson, Thomas Eriksson, Pål Frenger,   *
%* Tobias Ringström, and Jonas Samuelsson.                                   *
%*                                                                           *
%* Permission to use, copy, modify, and distribute this software and its     *
%* documentation under the terms of the GNU General Public License is hereby *
%* granted. No representations are made about the suitability of this        *
%* software for any purpose. It is provided "as is" without expressed or     *
%* implied warranty. See the GNU General Public License for more details.    *
%*---------------------------------------------------------------------------*/

%    Octave-IT++
%       IT++ Information Theory & Communication Toolbox for GNU Octave.
%    Copyright (C)  March, 2006 Muthiah Annamalai, Octave-IT++
%   
%    These are examples in Octave-IT++ translated from existing IT++ examples
%    in C++.
%
%    This program is free software; you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation; either version 2 of the License, or
%    (at your option) any later version.
%
%    This program is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warr! anty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with this program; if not, write to the Free Software
%    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

%
% inputs are a column vectors [input:binary,errpos:int]
% output is binary:vector.
%
function output=set_errors(input, errpos)
     output=input ;
     for i=0:length(errpos)
         output(errpos(i))=xor(output(errpos(i)),1);
     end
end


function main()
  ITcomm(); %load the IT++ library extensions into Octave runtime.
 
  bch=BCH(31, 21, 2,[! 3 5 5 1]); %n,k,t,genpolynomial [0 1 1, 1 0 1, 1 0 1, 0 0 1] as in wicker.

  disp("==================================")%
  disp("      Test of BCH encoder/decoder") %
  disp("==================================")%

  disp("A two error case (should be corrected)")%

  %random bit string of length 21.
  input=randb(21);


  %we have set the encoder object statistics, and
  %generator polynomial, so it remembers the object.
  %Now we can perform  encoding on input vector,
  %and get a 31 bit vector.
  encoded=bch.encode(input);
 
  %flip the bits...?
  err=set_errors(encoded,[1 2]);% error positions

  %decode the bits
  decoded=bch.decode(err);

  disp("input=   ")
  input

  disp("encoded= ")
  encoded

  disp("err=     ")
  err

  disp("decoded= ")
  decoded
 
  input=randb(21);
  encoded=bch.encode(input);
  err=set_errors(encoded,[1 2 27]) ;% error positions passed as vectors.
  decoded=bch.decode(err);

  disp("A three error case (will cause decoding errors)")

  disp( "input=   ")
  input

  disp("encoded= " )
  encoded

  disp("err=     ")
  err

  disp("decoded= ")
  decoded

  return;
end

main()


%*************************************************************************

Thanks
Muthu



"Steve C. Thompson" <address@hidden> wrote:
On 11 Mar 06 15:25P! M, Muthiah Annamalai wrote:
> Im working on moving IT++ with an external interface
> to GNU Octave for it. It will be on the lines of a
> loadable module that will use IT++ as an external
> library.

Does this mean we'll be able to call IT++ functions
just like we call existing built-in functions, or does
this mean that the IT++ C/C++ libraries will be
available so that someone could write a C/C++ program
which could then be dynamically linked to Octave?
Hopefully the former. Will something like:

octave:> convolutional_code (type_of_code, inverse_rate, ...
constraint_length);

octave:> output = convolutional_code_encode (input);

be possible, for example?

Regards,
Steve


Yahoo! Mail
Use Photomail to share photos without annoying attachments.
reply via email to

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