File: README

package info (click to toggle)
gwave 20031224-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,512 kB
  • ctags: 1,065
  • sloc: ansic: 8,029; lisp: 1,619; sh: 1,202; makefile: 170
file content (42 lines) | stat: -rw-r--r-- 1,832 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

libspicefile - a library for reading analog waveform data files of the
sort generated by spice-type simulators, and similar data files.  

We've called the library spicefile instead of wavefile because:
- at present, only analog waveforms of represented by floating-point numbers
are handled.
- We want to avoid confusion with the "wav" format for soundfiles.


Our model for datafiles of this sort is as follows: Files contain a
single independent variable, and zero or more dependent variables.
Files can be thought of as organized into "rows" and "columns."  The
first column is the independent variable, remaining columns are
associated with dependent variables.  A single dependent variable may
comprise several columns; for example complex variables occupy two
columns, one for the real part and one for the imaginary part.  Each
row contains a one value for the independent variable and one value
for each of the dependent variables.

Two different levels of abstraction are provided, SpiceStream and WaveFile.

A SpiceStream is like an open file from which one row of datapoints is
read at a time.

A WaveFile comprises all of the datapoints for all values of the
independent variable, suitable for fast random access.  It is implemented
using a SpiceStream to read a whole file into memory.


Two complete programs are provided.

sp2sp ("spice to spice") uses SpiceStream to convert any file format
supported by the SpiceStream layer into one of several ASCII printable
formats.  In addition to testing the SpiceStream code, this is
extremely useful for converting files any of the binary formats into a
printable form, where they can easily be processed by awk, perl, or
some other scripting language.   

Test_read tests the WaveFile abstraction by loading a file into memory
and printing various information about it.