Structure of the ILO TEOAE files

Over the year's we have received a number of requests from many users regarding the ILO-Viewer and its EXPORTING capabilities. Most of the users require a method to export the TEOAE variables, for batch- processing or single record processing. The ILO software up to ILO V6 was offering a "txt" export option of the TEOAE ILO files. The ILO-viewer software offers the same option , but it saves only the TEOAE signal ( buffers A & B) , the noise  ( A-B) and the signal FFT (real part ) . These solutions are not optimized for a large processing of ILO data TEAE data. 

Back in the late 90's some members of the OAE Portal had access to the ILO TEOAE file structure and had implemented subroutines in BASIC and Pascal to read the ILO TEOAE file and save its contents to various arrays. The same subroutines appeared in mid-2005 as MATLAB m files. For the latter it has been difficult to trace the authors and offer freely the subroutines in the Portal.

The listing below is the code of a BASIC subroutine which was used to import TEOAE files for signal processing, Time-Frequency analysis and discriminant spectral classification. Unfortunately these programs were written for a DOS environment ( as the early flavors of the ILO software) therefore are obsolete at the present day. The code although could be used as a map to design modern versions of ILO Importing subroutines. The most important part of the file is the description of the various parts where the ILO information was stored. This ILO structure was valid up to version 5 , we have no reports that works for subsequent ILO versions. Probably users do not attempt to read separately the ILO files outside the ILO software environment. 

 

'---------------------- Get the Whole File ----------------------------------

OPEN FileName$(NF%) FOR RANDOM AS #1 LEN = LEN(FileBuffer)
GET #1, Stav, FileBuffer
CLOSE #1
'--------------------- Retrieve Information ---------------------------------

Subject$(NF%) = MID$(FileBuffer.Specs, 2, 18)
ear$(NF%) = MID$(FileBuffer.Specs, 23, 5)

' Even part : 1 - 1024
' Odd part : 1025 - 2048
' Stimulus : 2049 - 2304
' FFT : 2305 - 2560
' Noise : 2561 - 2816
' numb. of sweeps: 2817 - 2818
' High THR : 2819 - 2820
' Threshold : 2821 - 2822
' EE : 2823...2828 (6) Echo Energy
' Correlation : 2829 - 2830
' Contam : 2831...2836 (6)
' SE : 2837...2842 (6) Stimulus Energy
' Probe stabil. : 2843 - 2844
' ........... : 2845 - 2850
' LoHi % : 2851 - 2852
' Mode : 2853
' ILO Attenuation : 2854-2855
' ilo SAMPLING : 3093-3096

Shift% = 1024 ' Location of the Second seq
Temporary$ = MID$(FileBuffer.Sequences, 2817, 2)
ILOSweeps%(NF%) = CVI(Temporary$)

comp:
Temporary$ = MID$(FileBuffer.Sequences, 2837, 6)
A$ = "00" + Temporary$
Attenuation = CVS(A$)

Temporary$ = MID$(FileBuffer.Sequences, 2854, 2)
Attenuation% = CVI(Temporary$)
IloGain%(NF%) = (20 - CVI(Temporary$)) * 1.5

Startreading% = (Timeshift%) * 2
IF Startreading% = 0 THEN Startreading% = 1

FOR t% = Startreading% TO ((Timeshift% + Points%) * 2) STEP 2' Recall that points% of 2 Bytes each

Temporary$ = MID$(FileBuffer.Sequences, t%, 2)
TEmporary1$ = MID$(FileBuffer.Sequences, t% + Shift%, 2)

E = CVI(Temporary$) * Factor * .812 ' Volts Conversion +ILO matching
E = E / .0024414 ' Steps estimation
E = E * .01536 ' To convert in mPa
Even(NF%, Count%) = E / ILOSweeps%(NF%)

o = CVI(TEmporary1$) * Factor * .812 ' Volts Conversion
o = o / .0024414 ' Steps estimation
o = o * .01536 ' To convert in mPa
Odd(NF%, Count%) = o / ILOSweeps%(NF%)

AVE1 = AVE1 + Even(NF%, Count%)
AVE2 = AVE2 + Odd(NF%, Count%)

Count% = Count% + 1
IF Count% > Points% THEN EXIT FOR
Random2:
NEXT
' BUFFER FILES with zeros iF TIMESHIFT IS USED

' Store the STIMULUS data
o:
Count% = 1
Shift% = 2048 ' Location of the Second seq
StimPeak = 0
IF Points% < 256 THEN A% = Points% * 2 ELSE A% = 256
FOR t% = 1 TO A% STEP 2
Temporary$ = MID$(FileBuffer.Sequences, t% + Shift%, 2)

S = (CVI(Temporary$)) * 10 / 256' Voltage equivalent
S = S / .03906 ' To get Voltage steps
S = S * 9.96 * .812 ' mPa equivalent
Stimulus(NF%, Count%) = S

IF Stimulus(NF%, Count%) > StimPeak THEN StimPeak = Stimulus(NF%, Count%)
Count% = Count% + 1
NEXT
StimPeak = StimPeak / SQR(2)
'STEPS

'Define dB level
DBLevel% = 80 + IloGain%(NF%)

' Define IDEAL level
Ideal = .02 * 10 ^ (DBLevel% / 20)

' Define ratio for the appropriate dB reduction/addition

dBratio = StimPeak / Ideal

FOR t% = 1 TO A% / 2
Stimulus(NF%, t%) = Stimulus(NF%, t%) / dBratio
NEXT

' Store Correlation and Stability indexes
F:
Correl%(NF%) = CVI(MID$(FileBuffer.Sequences, 2829, 2))
Stability%(NF%) = CVI(MID$(FileBuffer.Sequences, 2843, 2))
GOTO CHECKPOINTS

ASCIIFILES:

' Have in mind that we need to read INDIVIDUAL files not MATRICES

OPEN FileName$(NF%) FOR INPUT AS #1
ErroRcounter% = 0
Count% = 1

AVE1 = 0:
AVE2 = 0

INPUT #1, G
IloGain%(NF%) = G

FOR Count% = 1 TO 512

INPUT #1, Position
IF Count% < Timeshift% OR Count% > (Timeshift% + Points%) THEN GOTO outofhere
Even(NF%, Count%) = Position ' Single precision
Even(NF%, Count%) = Even(NF%, Count%) * Factor

AVE1 = AVE1 + Even(NF%, Count%)
IF Even(NF%, Count%) = 0 AND Count% < Points% / 4 THEN ErroRcounter% = ErroRcounter% + 1

IF ErroRcounter% = Points% / 2 THEN
GOTO ERRORWINDOW
END IF
outofhere:
NEXT

' Read the Odd Sequence

ErroRcounter% = 0

FOR Count% = 1 TO Points%
IF Count% < Timeshift% OR Count% > (Timeshift% + Points%) THEN GOTO outofhere1
INPUT #1, Position
Odd(NF%, Count%) = Position ' Single precision
Odd(NF%, Count%) = Odd(NF%, Count%) * Factor

AVE2 = AVE2 + Odd(NF%, Count%)
IF Odd(NF%, Count%) = 0 AND Count% < Points% / 4 THEN ErroRcounter% = ErroRcounter% + 1

IF ErroRcounter% = Points% / 2 THEN
GOTO ERRORWINDOW
END IF
outofhere1:
NEXT

CLOSE #1

CHECKPOINTS:
' Pad the files with 000 if necessary
Check1:

EAVE(NF%) = AVE1 / (Points%)
OAVE(NF%) = AVE2 / (Points%)

m = LOG(Points%) / LOG(2)

IF INT(m) < m THEN

FOR y% = (Timeshift% + Points% + 1) TO 2 ^ (INT(m) + 1)
Even(NF%, y%) = 0
Odd(NF%, y%) = 0
NEXT

END IF

IF AVE1 = 0 OR AVE2 = 0 THEN GOSUB ERRORWINDOW

FOR y% = 129 TO 2 ^ m
Stimulus(NF%, y%) = 0
NEXT
'STOP
RETURN

'--------------------- Errors CURE ----------------------------------------
ERRORWINDOW:
BEEP: BEEP:
' Print the Error Window
Ymin% = 14: Ymax% = 21
Xmin% = 8: Xmax% = 72
Front% = 15
Back% = 9
GOSUB GWINDOW

LOCATE 15, 11
PRINT " Dear User ";
LOCATE 16, 11
PRINT " The INPUT routine has detected "; Points% / 2;
PRINT " zeros in the current";
LOCATE 17, 11
PRINT " file. Decide upon the action to be taken.";

Menu$(1) = " RESUME operations "
Menu$(2) = " EXIT to check File "
E1:

Num% = 2
Horizontal% = 36
Yposition% = 19
StartPoint% = 11
FrontColor% = 15
MenuEnable% = 1
GOSUB LR.ARROW

IF Number% = 0 THEN BEEP: GOTO E1
IF Number% = 1 THEN GOTO E2 ELSE GOTO Terminate
E2:
' Erase Current Window
COLOR 11, ScreenColor%
CLS
GOSUB lines

' Print the Original screen window
Ymin% = 12: Ymax% = 16
Xmin% = 10: Xmax% = 70
Front% = 15
Back% = 11
GOSUB GWINDOW

LOCATE 13, 30
COLOR 14, 11
PRINT "This is file #"; NF%;
A% = LEN(FileName$(NF%))
B$ = "I am Reading "
B% = LEN(B$)
X% = 15 + (50 - A% - B%) / 2
LOCATE 14, X%: COLOR 15, 11
PRINT B$; : COLOR 12, 11
PRINT FileName$(NF%);

ErroRcounter% = 0
CLOSE #1:
NF% = NF% + 1
ON VAL(Filetype$) GOTO ASCIIFILES, RANDOMFILES