bit operations -- are they possible?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bit operations -- are they possible?

Bernt Nilsson
Hello all,

I have an older FORTRAN program for demultiplexing sampled data files.
In these multiplexed files, consisting of 16 bit words, each word
contains a 12 bit value and a 4 bit channel number.

The problem with the FORTRAN program is that it cannot handle files
larger than 32 MB. therefore I would like to let Octave handle the
demultiplexing instead.

Is it possible to use Octave for "sifting" out the value and the
channel number respectively, or do I have to use C/FORTRAN for this?
That is, is it possible to rewrite my old program as an Octave m-file?

Since I wrote this message I have found out that I could use the
string routines bin2dec and dec2bin. The question is then, would an
m-file using these routines be painfully slow? Is there anyone with
experience in doing these operations?

Thanks for any input on this!

Bernt






Bernt Nilsson                               email : [hidden email]
National Defence Research Establishment       tel :    +46 8 706 3611
S-172 90 Stockholm, Sweden                    fax :    +46 8 706 3543


Reply | Threaded
Open this post in threaded view
|

Re: bit operations -- are they possible?

Ted.Harding
( Re Message From: Bernt Nilsson )

>
> I have an older FORTRAN program for demultiplexing sampled data files.
> In these multiplexed files, consisting of 16 bit words, each word
> contains a 12 bit value and a 4 bit channel number.
>
> The problem with the FORTRAN program is that it cannot handle files
> larger than 32 MB. therefore I would like to let Octave handle the
> demultiplexing instead.
>
> Is it possible to use Octave for "sifting" out the value and the
> channel number respectively, or do I have to use C/FORTRAN for this?
> That is, is it possible to rewrite my old program as an Octave m-file?
>
> Since I wrote this message I have found out that I could use the
> string routines bin2dec and dec2bin. The question is then, would an
> m-file using these routines be painfully slow? Is there anyone with
> experience in doing these operations?

Whether or not it is possible, let alone reasonably fast (which it
probably wouldn't be), under octave, I would go for C in this case.
A C program to do this job would be very short, and very fast, and
would not have a problem with file size.

Ted.                                    ([hidden email])