comparison docs/aimFileFormats @ 0:5242703e91d3 tip

Initial checkin for AIM92 aimR8.2 (last updated May 1997).
author tomwalters
date Fri, 20 May 2011 15:19:45 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5242703e91d3
1
2
3 Appendix C Output File Formats
4
5 This Appendix describes the format of output from the ASP modules, for
6 users who wish to process this output with another program of their own.
7 For example, gensai produces a stabilised auditory image which is suitable
8 as input to a speech recognition system. In most cases the output file
9 will probably require an additional processing step before it may be used
10 by another program.
11
12 Each ASP module produces an output file in response to the -output option.
13 These output files consist of a header (containing information concerning
14 the makeup and history of the file) followed by a series of 16-bit data
15 items which represent the actual data contained in the file.
16
17 There are two obvious ways in which such a data file may be used as input
18 to a user's own program; firstly, the user's program may be adapted to read
19 and interpret the header of ASP output files before actually processing the
20 data in them, and secondly, the header may be removed and the relevant
21 information entered into the user's program manually before it proceeds to
22 process the data section of the ASP output file. The former of these
23 techniques is preferable in many ways, providing consistency and insulating
24 the user from the details of ASP headers, although it may require some
25 effort to alter the user's program to correctly process these headers. The
26 second method may be preferable if the user is merely interested in testing
27 the ASP software's suitability as a preprocessor for their program, or if
28 the program in question cannot be altered (either because it was purchased
29 from someone else, or because it would be too complicated to change it).
30
31 The second method merely requires a reliable way to separate an ASP output
32 file into header and data sections, and the user must then 'translate' the
33 information in the header into the terms understood by the parameters of
34 his/her program. To this end, the ASP package includes two programs called
35 head and tail which take an ASP output file as their argument and produce
36 another file containing its header and data sections, respectively. The
37 header is adapted to resemble very closely an ASP module's options file,
38 and ought to be easily understood by anyone familiar with the ASP modules
39 and the way in which they are used. As far as translation concepts from
40 ASP to another program is concerned, we can only volunteer this
41 documentation as a guide to the interpretation of each ASP option.
42
43 The former of the two methods requires rather more detailed understanding
44 of the output file structure, and this discussion will be divided into two
45 parts, one on the header and the other on the data itself.
46
47 Head and Tail
48
49 For users who wish to remove the header part of an ASP output file, the
50 software includes two programs called head and tail which take an ASP
51 output file as their argument and produce another file containing its
52 header and data sections, respectively. The header is adapted to resemble
53 very closely an ASP module's options file, and ought to be easily
54 understood by anyone familiar with the ASP modules and the way in which
55 they are used. As far as translation of concepts from ASP to another
56 program is concerned we can only volunteer this documentation as a guide to
57 the interpretation of each ASP option.
58
59 Whichever method the user chooses in combining ASP output files with their
60 own programs, some information regarding the types and format of
61 information in ASP output modules will be needed. Discussion of the
62 structure of the output files will be divided into two sections, one on the
63 header and the other on the data itself.
64
65 The header
66
67 Each ASP module's output file contains a header which provides information
68 about the origin and history of the data in the file. This information is
69 used by subsequent modules in the ASP hierarchy, as described in Appendix
70 B. The header is a sequence of ASCII characters (and is thus readable, so
71 even using more on the output file would produce sensible text for the
72 duration of the header). This sequence is divided into three parts.
73
74 1 An identifying line.
75
76 2 A series of option setting lines.
77
78 3 NULL (ASCII 0) character.
79
80 The identifying line is a means of determining, from the first few
81 characters in a file, whether that file is in fact an ASP output file. It
82 also is used for determining the length of the header as a whole; thus,
83 each output file begins with a string such as:
84
85 header_bytes=0000709
86
87 where header_bytes is the identifying string (which actually descended from
88 the 'pipes' signal processing language) and the header is 709 bytes long.
89 The length of the header includes the identifying line and the final NULL
90 character.
91
92 Each option setting line is of the form:
93
94 <option name>=<option value>
95
96 and these lines taken together will closely resemble a normal ASP options
97 file, although there may be some options which are not familiar to even an
98 experienced ASP user. These options are 'hidden' ones which are passed
99 between ASP modules, but which are of no interest to users of the software.
100 They may, however, be of interest to programmers who wish to take ASP
101 output as input to their own programs, so a complete list of these hidden
102 options is given at the end of this Appendix.
103
104 The data
105
106 The structure of the actual data section of an ASP output file will be
107 dependent on the ASP module which produced it. Since we are then committed
108 to describing each of the output structures in detail, we will begin with
109 the data structure that ASP modules expect in input waveforms.
110
111 Input waveform structure
112
113 For convenience, the ASP software assumes that input waveforms do not have
114 headers of any form. The only information about the structure of an input
115 waveform that is required relates to the samplerate at which the waveform
116 was generated or collected, and the number of significant bits that are in
117 the data. These two attributes are taken as options which must be entered
118 by the user, but they could just as easily be viewed as the contents of a
119 suitable header for a waveform. The actual data section of a waveform
120 consists of a single stream of (16-bit, or 'short') integers whose length
121 determines the actual length, in points, of the waveform. To view the
122 waveform only the user can use genwav.
123
124 Basilar membrane motion output structure
125
126 The genbmm module takes a waveform of the structure defined above and
127 produces the basilar membrane motion corresponding to this input waveform
128 by using a gammatone filter bank. The output data is expressed as the
129 multiplexed output of a series of channels, one per channel in the filter
130 bank. Thus the first n data points (where n is the number of channels) in
131 the output correspond to the first output data point for each of the n
132 channels, beginning with the highest frequency channel and ending with
133 lowest. The second batch of n data points in the output file correspond to
134 the second data point for each of the n channels in turn, and so on. There
135 will be m of these n-data item segments, where m is the length of the input
136 file in data points, and the length of a sgm output file will thus be the m
137 x n, which may obviously be quite large.
138
139 Prepended to this data is a header which contains information related to
140 the way in which the data was produced. Some of this information was
141 supplied by the user of the genbmm program (eg samplerate, length_wave,
142 mincf_afb, etc) and some was derived from other sources (eg channels and
143 pointsperchannel, which were computed by genbmm from the mincf_afb,
144 maxcf_afb, dencf_afb, and length_wave options).
145
146 Cochleogram output structure
147
148 The output of gencgm is of identical structure to that of genbmm, although
149 of course the header will contain extra information related to how the
150 cochleogram was generated.
151
152 Stablised auditory image output structure
153
154 The output of gensai is a series of 'frames', one per graphical image that
155 is displayed by gensai and revsai. Each of these frames has the structure
156 of an entire data section of a genbmm or gencgm output file. Thus the .sai
157 data is structured as a series of multiplexed waveforms. The size of a
158 .sai file will be m x n x f, where f is the number of frames generated by
159 gensai, and is thus likely to be huge. Again, the header will have
160 additional information related to the generation of the stabilised auditory
161 image.
162
163
164
165
166