UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

An acoustic scatter-mapping imaging system Mellema, Garfield Richard 1990

You don't seem to have a PDF reader installed, try download the pdf

Item Metadata

Download

Media
UBC_1990_A7 M44.pdf [ 9.65MB ]
[if-you-see-this-DO-NOT-CLICK]
Metadata
JSON: 1.0065444.json
JSON-LD: 1.0065444+ld.json
RDF/XML (Pretty): 1.0065444.xml
RDF/JSON: 1.0065444+rdf.json
Turtle: 1.0065444+rdf-turtle.txt
N-Triples: 1.0065444+rdf-ntriples.txt
Original Record: 1.0065444 +original-record.json
Full Text
1.0065444.txt
Citation
1.0065444.ris

Full Text

An Acoustic Scatter-Mapping Imaging System by Garfield Richard Mellema BSE, Calvin College, 1986  A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE in THE FACULTY OF GRADUATE STUDIES Department of Electrical Engineering  We accept this thesis as conforming to the required standard  THE UNIVERSITY OF BRITISH COLUMBIA February 1990 © Garfield Richard Mellema, 1990  In  presenting  this  degree at the  thesis  in  partial fulfilment  of  University of  British Columbia,  I agree  freely available for reference copying  of  department publication  this or of  and study.  thesis for scholarly by  this  his  or  her  purposes  representatives.  Engineering  The University of British Columbia Vancouver, Canada Date  DE-6  (2/88)  February  9, 1990  that the  may be It  thesis for financial gain shall not  Electrical  requirements  I further agree  permission.  Department of  the  that  advanced  Library shall make it  by the  understood be  an  permission for extensive  granted  is  for  allowed  that without  head  of  my  copying  or  my written  ii ABSTRACT  The development of improved models of seismic diffraction is assisted by the availability of accurate scattering data. An acoustic scatter-mapping system was developed for the purpose of providing such data rapidly and at low cost. This system uses a source-receiver pair suspended on a trolley over the structure to be mapped. Signal generation, acquisition, processing, and plotting are performed on an ATcompatible microcomputer and a laser printer. The entire process can be performed in an automated manner within five hours, generating scatter-mapping plots in a format familiar to the geophysical industry. The system hardware was similar to those of Hilterman [1] and others referenced by him, but used a controlled source transducer. The available processing power of a microcomputer allowed the use of a 1 to 15 KHz swept-frequency source signal, similar to that used in Vibroseis and Chirp Radar, which is later crosscorrelated with received signal to provide precise scattermapping data for the target structure. Several examples of theoretical and experimental acoustic scatter-mappings are provided for comparison. The novelty of this system lies in its use of a swept frequency source signal. While common in the fields of seismology and radar, swept frequency source signals are new to the area of acoustic scatter mapping. When compared to a similar system using a pulsed source signal,  this system produces a  better controlled source signal of greater energy, resulting in a  more useful resultant signal and better mapping characteristics. The system was able to map scattering from features in the target structure smaller than one percent of the crosscorrelated source signal's 37 mm dominant wavelength.  iii TABLE OF CONTENTS ABSTRACT  ii  TABLE OF CONTENTS  iii  TABLE OF FIGURES  iv  ACKNOWLEDGEMENTS  vi  1 INTRODUCTION 1.1 Acoustic Imaging of Scattering 1.2 The Purpose of This Acoustic Imaging System 1.3 Previous Work on This System 1.4 Thesis Outline  1 1 3 .4 .4  2 THE SYSTEM SIGNAL PATH 2.1 The System Signal Path 2.2 Source Signal Calculation 2.3 Source Signal Generation 2.4 Translating Between Electrical and Acoustic Signals 2.5 Characteristics of an Acoustic Signal in Air 2.6 Scattering Due to Structures in the Target Region 2.7 The Relevance of Translation Characteristics  6 6 6 8 9 14 16 18  3 OTHER ASPECTS OF THE IMAGING SYSTEM 3.1 Repositioning the Transducers 3.2 Plotting of Acquired Data 3.3 Further Processing of Data  19 19 22 23  4 DEVELOPMENT OF A SUITABLE SOURCE SIGNAL 4.1 Characteristics of a Good Source Signal 4.2 Selection of a Usable Source Signal 4.3 Swept-Frequency Source Signal Description 4.4 Selection of a Suitable Swept-Frequency Source Signal  25 25 26 29 33  5 EVALUATION OF THE SYSTEM ON SOME SIMPLE MODELS 5.1 Target Region Description  39 39  5.2 The Vacant Target Region , „  5.3 5.4 5.5 5.6  A Half Plane A 13 cm Step A Plane Ending in a Rounded Edge of Constant Radius A Small Edge  ,  39  47 47 53 61  6 CONCLUSIONS 6.1 Summary 6.2 Areas for Future Development  65 65 65  REFERENCES  68  BIBLIOGRAPHY  70  APPENDIX A Software Used by This System  72  iv T A B L E OF FIGURES  1.1 Typical Seismic Reflection and Diffraction  2  2.1 The System Signal Path  7  2.2 Photograph of the Loudspeaker and Microphone  10  2.3 SPL Versus Frequency Response of the Loudspeaker  12  2.4 SPL Versus Frequency Response of the Microphone  12  2.5 Impedance Versus Frequency Response of the Loudspeaker  12  2.6 Horizontal and Vertical Off-Axis Response for the Loudspeaker  13  2.7 Polar Response Pattern for the Microphone  13  2.8 Absorption of Sound in Air  16  3.1 A Target Region Uniform in Two Directions  20  3.2 Photograph of the Transducers as Mounted on the Trolley  21  4.1 A Calculated Pulse Source Signal  27  4.2 Distortion of a Pulse Source by the Signal Path  27  4.3 A Calculated Swept-Frequency Source Signal  32  4.4 The Received Swept-Frequency Signal  32  4.5 The Crosscorrelated Received Swept-Frequency Signal  33  4.6 Spectral Density of the Calculated Source Waveform  37  4.7 Spectral Density of the Generated Source Waveform  37  4.8 Autocorrelation of the Reference Waveform  38  4.9 Autocorrelation of the Reference Waveform  38  5.1 Photograph of the Vacant Target Region . .  40  5.2 Expected Acoustic Scatter-Mapping of the Vacant Target Region  .43  5.3 Diagram of Expected Returning Signal Paths and Times  44  5.4 Acoustic Scatter Mapping of the Vacant Target Region  45  5.5 Median Filtered Acoustic Scatter Mapping of the Vacant Target Region  46  5.6 Diagram of the Half Plane Model  48  V  5.7 Expected Acoustic Scatter Mapping of a Half Plane  49  5.8 Acoustic Scatter Mapping of the Half Plane Model  50  5.9 Median Filtered Acoustic Scatter Mapping of the Half Plane Model  51  5.10 Diagram of the 13 cm Step Model  52  5.11 Expected Scatter Mapping of a 13 cm Step  54  5.12 Acoustic Scatter Mapping of the 13 cm Step  55  5.13 Median Filtered Acoustic Scatter Mapping of the 13 cm Step  56  5.14 Diagram of the Creeping Wave Test Model  57  5.15 Expected Scatter Mapping of the Creeping Wave Test Model  58  5.16 Acoustic Scatter Mapping of the Creeping Wave Test Model  59  5.17 Median Filtered Acoustic Scatter Mapping of the Creeping Wave Test M o d e l . . . 60 5.18 Diagram of the Small Edge Model  62  5.19 Acoustic Scatter Mapping of the Small Edge Model  63  5.20 Median Filtered Acoustic Scatter Mapping of the Small Edge Model  64  vi ACKNOWLEDGEMENTS  The author would like to thank his supervisor, E.V. Jull, and his co-supervisors, M J . Yedlin and B.B. Narod, for their guidance and suggestions. Thanks is also due to P.D. Lawrence for his encouragement. He would also like to acknowledge the assistance rendered by his colleagues, including David Aldridge, David Dalton, and Steven Dods. This work was funded under a Natural Sciences and Engineering Research Council strategic grant.  1  1 INTRODUCTION  1.1 Acoustic Imaging of Scattering  The scattering of acoustic pulses has long been used in seismology to determine the characteristics of buried structures. As shown in Fig. 1.1, a known source signal is introduced into the earth at a source point, S, and signals resulting from the interaction of the source signal and the underground structures are received at the receiving point, R, recorded, and plotted. Examination of the signals received at a series of receiver locations yields information as to the location and nature of those objects from which the source signal was scattered. A source signal impinging on a smooth surface will be reflected from that surface at an angle equal but opposite to the angle at which it arrived at that surface. A somewhat different form of scattering occurs when the source signal impinges on a non-smooth surface. A source signal impinging on a nonsmooth surface, or one with discontinuities, results in a signal which appears to have originated from that surface. This signal, containing both reflection and diffraction components, scatters in all directions from the surface, its amplitude and phase varying with its angular direction. This complex form of scattering, called diffraction, is a topic of great interest in the areas of seismology and electromagnetics. Exact solutions for the diffractive scattering of an impinging wave from a non-smooth surface are sufficiently complex and time-consuming to determine that they have been determined for only a limited number of structures. Diffractive scattering from other structures is typically estimated using one of several simplified models of diffraction. In order to provide experimental data for comparison with theoretical data generated using these models, acoustic scatter-mapping systems have been constructed [l]-[5]. One of the early systems, constructed by Angona [2], consisted of several joined sections of solid materials into which pressure pulses were transmitted at regular time intervals. The  Fig. 1.1 Typical Seismic Reflection and Diffraction  pressure pulses received at a receiver location were translated into electrical signals and photographed on an oscilloscope. Scattering, occurring at each boundary between adjacent sections of dissimilar materials, within known structures could in this way be observed and measured for comparison with calculated or geophysical scattering. This technique, while useful for the acquisition of data in the case of scattering from multiple layers, such as may be found in real g e o p h y s i c a l scattering  reqnfred substantial  skill  and  resources i n the construction a n d  examination of models under study. An improved seismic modeling apparatus was constructed by Hilterman [1]. This system used air as the medium into which single-layer models were placed. A fixed spark gap source and microphone were used to generate and receive acoustic pulses, and the models under study were placed on a movable platform. Received signals were photographed on an oscilloscope. Data from this system also showed good agreement with calculated experimental results, but was limited in its accuracy.  3  The system described here was similar to that constructed by Hilterman but took advantage of recent improvements in data acquisition and processing. The major difference between this system and those previous was the application of a crosscorrelated swept-frequency source signal, similar to those found in seismology and radar. A swept-frequency source signal is emitted into air from a loudspeaker source and is scattered from a target structure below. Scattered copies of the source signal, shifted in time and possibly in phase, are received at a microphone and digitized. The digitized received signal is then crosscorrelated with a copy of the source signal to determine thetimeand phase shift of any copies of the source signal contained within them. The effect of this crosscorrelation is to replace copies of the source signal in the received data with autocorrelations of the source signal, without altering the time or phase information in the data. By careful selection of the source signal characteristics it was possible to generate autocorrelated source signal waveforms of more desirable parameters than those of the traditional pulsed source signal. The use of this improved source signal resulted in greatly improved accuracy and resolution.  1.2 The Purpose of This Acoustic Imaging System  Although exact time-domain solutions are calculable for both high and low-frequency diffraction for a few structures, their development, in general, is typically both complex and time-consuming. For this reason, various simplified models have been used to estimate the diffraction of a wave impinging on a given structure, especially a complex structure or one with surfaces smaller than or equal to the wavelength of the impinging wave. One of the objectives of the Seismic Pulse-Diffraction Project, of which this system was a part, was to improve and further develop such models. One of the preferred ways to demonstrate the validity of a model is to compare data generated by the model with experimental data. A modeling facility was thus needed to collect real scattering data from scale models similar to those modeled theoretically. This acoustic scatter-mapping facility was constructed in response to the requirements of the larger diffraction  4 research project with the intent of using it to collect scattering data for comparison with that generated by synthetic diffraction models.  1.3 Previous Work on This System  The initial work on this acoustic imaging system was carried out by A. Adler and B. B. Narod between November 1988 and March 1988 [6], [7]. The core of the system consisted of an RC Electronics data-acquisition card installed in an XT- compatible microcomputer. The dataacquisition card was used to digitally generate a pulsed-source signal, which was sent to a loudspeaker, and to digitize an analogue signal received from a microphone. The speaker and microphone were suspended on a trolley over the region in which models were placed. The trolley was moved by a synchronous motor under the control of the computer via the data acquisition card. Both the outgoing source pulse and the returning signal were sampled at position intervals of 2 mm across the region containing the model, until data at a thousand positions had been collected. Data at each position was acquired sixteentimesto increase the resolution of the received data from twelve to sixteen bits. After the entire scatter-mapping had been acquired it was plotted on a 72 dpi dot matrix printer, using a grey scale technique, in a standard seismic profile format. The data-acquisition and plotting software were written, especially for the project, in FORTH.  1.4 Thesis Outline  The previously described acoustic scatter-mapping system was complete in itself yet offered many opportunities for improvement. The pulsed source, as produced by the loudspeaker, had an annoying tendency to ring. This was an area which demanded attention since the acoustic source signal eventually became the indicator of the location, amplitude, and phase of scattering from the target structure. Increasing the precision of the acoustic source signal directly increases the precision of the overall system results. This relationship becomes  5 strikingly clear when one compares the improvement in resolution between the images of similar targets at different stages of the system's development. Therefore, one of the criteria for evaluating improvement of the acoustic imaging system was the improvement of the acoustic source signal. The format of this thesis was selected to reflect the importance of the source signal. However, it is not useful to discuss the source signal out of the context of the overall acousticimaging system. For this reason, those aspects of the system less direcdy related to the system signal path, such as mechanical aspects of the overhead trolley, are also discussed, but in less depth. These aspects of the research occupied a significant portion of our time. Chapter 1 is intended to provide an overview of the context of this system in general, by discussing it in a historical and logistical perspective. Having shown the general context of the system, the next step is to discuss specific aspects of the system. The path of the source signal, from its calculation to its incorporation in a finished data set, is discussed in Chapter 2. This portion is worthy of at least a chapter in its own right as this path forms the heart of the system and was the site of most of the system's improvements. System components of interest, but not directly related to the signal path, such as the plotting of data and repositioning of the transducers, are discussed in Chapter 3. Once the reader has been provided an insight into the acoustic imaging system, the development of an improved source signal may be described. This task was undertaken in Chapter 4,  followed  in Chapter 5 b y  several  examples of scatter-mappings acquired from simple  models. Chapter 6 discusses the relevance of the project and suggests some avenues for future improvements.  6  2 THE SYSTEM SIGNAL PATH  2.1 The System Signal Path  This acoustic scatter-mapping system relied on the emission and reception of a signal used to gather the information that this system was constructed to acquire. As this signal and its derivatives formed the core of the system, we will begin discussion of the system with a discussion of the factors influencing the source signal. The following sections are ordered according to the location of their topic in the source signal path shown in Fig. 2.1.  2.2 Source Signal Calculation While recent analog signal generation, processing, and storage techniques are good, the use of digital techniques to perform similar tasks has greatly improved the ease, flexibility, and accuracy with which such operations can be performed. Our generation of a desired source signal is a case in point. Analog techniques typically require the variation of control voltages to amplifiers and voltage controlled oscillators. Digital techniques require amplitude information at a sequence of points along the desired source waveform. Below certain frequency limits, the generation of a signal requires no more data than that required to describe an accurate amplitude versus time plot of the signal. This acoustic imaging system made use of fully digital techniques for signal calculation, generation, acquisition, processing, and storage. In order to generate a specific source signal using digital techniques, it was necessary to describe the signal as a time-series of signal amplitudes. This task was handled by a program called Wavegen which used embedded parameters to calculate a time-series of amplitudes to be sent to a digital-to-analog convertor (DAC). Knowledge of the specific DAC conversion rate and range to be used was required to select the correct time interval and amplitude range of the calculated signals. The system had an amplitude range from 0 to 4095, corresponding to an output range of -5 to +5 V, and a minimumtimestep interval of 3 us. The range employed was between -2.5 and +2.5 V, so as to prevent overloading the input of the power amplifier following  AT- compatible Computer  Source Signal Calculation  i j  Source Signal Generation  Data Acquisition Card  Sampling Received Signal  Power Amplifier  Processing and Plotting  Amplifier  Bandpass Filter  Fig. 2.1 The System Signal Path  8 the DAC. The minimum time step interval was achieved using an assembly language loop to copy values from an array in computer memory to the DAC at a computer port. The use of a 3 us sample rate gave a Nyquist frequency of 166 KHz, well above the range of any signal we wished to reproduce. The Nyquist frequency is the highest frequency which can be fully determined by a timeseries of points at a given rate. Shannon's theorem states that a signal can be fully determined by a time-series of points at a rate twice the frequency of the highest frequency signal component [8]. Each time that an analog signal was represented digitally in this system it was oversampled, i.e. sampled at a rate greater than that required by Shannon's theorem. In the first case, that of a calculated signal being sent to the DAC, the signal was oversampled to ensure that the Nyquist frequency was well above the upper frequency hmit of the power amplifier used to bandpass filter the source signal prior to passing it to the loudspeaker. If the Nyquist frequency of the calculated source signal had been below the upper frequency limit of the power amplifier, aliasing could have occurred, resulting in undesired signal components at frequencies between the Nyquist frequency and the upper frequency limit of the power amplifier. The higher sampling rate presented no difficulties with respect to the computer apparatus. The second case, that of oversampling the signal received by the microphone, was done to ensure sufficient data points for accurate plotting of the finished data.  2.3 Source Signal Generation Most of the tasks required to collect an acoustic image of a target structure were controlled by a single program called Multrace. This program, listed in Appendix A, controlled the generation of the source signal, the acquisition of the information signal, the crosscorrelation of the information and reference signals, and the repositioning of the transducers after gathering data, at each of the 125 scatter-mapping positions. We will now examine the way in which Multrace controlled the output of the source signal. Once calculated, the source signal was stored in a file called Inwove. This file was read by Multrace into an array at the start of the scatter-mapping operation and passed to an assembly  9  language function, named Echo, whenever generation of the source signal was required. The function, upon receiving the size of the array and a pointer to the beginning of the array, triggered acquisition of the information signal and copied the array containing the calculated source signal to a DAC. The DAC used by this system was a component of an R.C. Electronics ComputerScope data acquisition card. The DAC in this configuration had no decoded parameters, other than its address. At the highest conversion rate, 330 KHz, the output of the DAC appeared as a series of discrete voltage levels at 3 us intervals and had, therefore, frequency components well in excess of the range of most audio equipment, 20 Hz to 20 KHz. This signal was intended as a reference only and lacked sufficient power to drive any sizeable load. Following the conversion from digital to analog by the DAC, the source signal was passed to an audio power amplifier, an MEIPA300H. This amplifier had two main functions. The first function was that of amplifying the signal passed to it so that it could be passed to the loudspeaker. Voltage gain occurred at this point. The output impedance of the amplifier was also much lower, 4 Cl, than that of the DAC, 50 Cl. Note that current gain also occurred at this point, as the input impedance of the loudspeaker driver, 16 Q, was much less than that of the power amplifier, 20 KQ. The second function of the power amplifier section was low-pass filtering of the source signal. In order to correctly generate the calculated source waveform, only those frequency components which were intended to be in the waveform could be passed. As discussed in the previous section, with a high digital to analog conversion rate the undesired frequency components were well out of the 20 Hz to 20 KHz range of the audio power amplifier.  2.4 Translating Between Electrical and Acoustic Signals The translation of signals from electrical to acoustic and vice-versa was accomplished using loudspeakers and microphones. These two devices share many characteristics, and for that reason are discussed concurrendy. Those characteristics unique to microphones or loudspeakers, or unique to either signal translation will be mentioned separately. The loudspeaker, a JBL  10  Fig. 2.2 Photograph of the Loudspeaker and Microphone  model 2425J driver attached to a JBL model 2370A horn, and the microphone, an Altec Lansing (now University Sound) model 681 A , is shown in Fig. 2.2. Let us assume that one had an electrical source signal in the audio frequency range, i.e. between 20 Hz and 20 K H z , and that one wished to translate this signal into an acoustic signal. Because of the large frequency range of interest, and the inherent complexity of these transducers, we should consider several aspects before simply sending the electrical signal to a loudspeaker. The first characteristic of concern would be the frequency response of the speaker. The response of a speaker is normally mapped as Sound Pressure Level (SPL) in dB versus frequency in hertz. The SPL is a measure of the air pressure increase, in dB referenced to 20 uPa, at a stated electrical power input, and distance from the speaker, often one watt at one meter for a loudspeaker. A similar measure applies for microphones. The frequency response of a loudspeaker is usually flat within several dB over most of its frequency range and usually ends with fairly sharp roll-offs. This variation of response with frequency indicates that most  11 loudspeakers do not translate single frequency tones uniformly over the audio frequency range. The repeated translation of particular individual tones is, however, quite reliable. The SPL versus frequency responses, from the manufacturer's data, of the loudspeaker and microphone used in this system were shown in Figs. 2.3 and 2.4, respectively. The second important characteristic,- also strongly frequency dependent, would be the electrical impedance of the loudspeaker. This parameter is especially important for loudspeakers. As with the SPL of the speaker, this aspect takes into consideration the acoustic impedance of the environment into which the acoustic signal will be travelling. That is, the impedance of a speaker driver attached, via a well-matched horn, to free space will have a different SPL and impedance-versus-frequency response, compared to the same driver attached to a terminated plane-wave tube. This variation of impedance could affect the output level of the device driving the loudspeaker and cause further variation of the SPL when generating single frequency tones. The impedance versus frequency response of the loudspeaker of this system was shown in Fig. 2.5. The third important characteristic of both loudspeakers and microphones would be their polar response. This parameter, usually measured at several frequencies, describes the relationship between the SPL of a signal and the location of an observer with respect to the front of the loudspeaker horn. An emitted signal usually has greatest amplitude directly in front of the horn, the amplitude decreasing as the angle between the observer and the horn face increased. The distance between the observer and the horn must remain fixed for this measurement. The polar response may be described in a number of ways, including off-axis response, or contours of constant sound pressure. The off-axis response of the loudspeaker is shown in Fig. 2.6 and the polar response of the microphone is shown in Fig. 2.7. We have seen that some limitations apply to the ability of a loudspeaker to translate single-frequency electrical signals into acoustic signals. Further restrictions apply to the translation of frequency-varying electrical signals into acoustic signals, with most of the restrictions due to the inertial aspect of air and other physical components. Having finite mass, a loudspeaker driver's voice coil and diaphragm, as well as the air in the loudspeaker horn, tend to  12  >3£V  V;"  V  »>~  *^ .'•.' * i »>.'-*10 i  v  •>  • -Vt--:  C-'f-  • *•* *  -.  :  v.  •-  :  -  -/  —  v-'-.io - •* *i *  H i .. ...;;,1000_  Fig. 2.3 Sound Pressure Level versus Frequency Response for the Loudspeaker  1  LO C C . T A l tt  •  1  V.  f  me  ••FIE  •  I  1  .0  \ V.  c  N  »  M  toe  to*  Mt  teee  me  ftoae  leooe  mcoutNCr IN HERTZ  Fig. 2.4 Sound Pressure Level versus Frequency Response for the Microphone  110  Frequency Hi  Fig. 2.5 Impedance versus Frequency Response for the Loudspeaker  13  5"  0  60! Pi ft"  ->  T 100  IV (fl 1  1  _r  t  1000  10000  20000  10000  20000  Frequency H i  100  1000 Frequency Hx  Fig. 2.6 Horizontal and Vertical Off-Axis Response for the Loudspeaker  Fig. 2.7 Polar Response Pattern for the Microphone  14 continue moving in the same pattern in which they were previously moving. This means that the electrical input level required by a loudspeaker to produce a desired SPL is dependent, not only on thefrequencyof the desired tone, but on the conditions existing in the loudspeaker at the time the electrical signal is applied as well. This characteristic is often referred to as the attack of the loudspeaker. A similar characteristic, the decay or damping factor, of driver voice coil, diaphragm, and the surrounding air, describes the amount of energy absorbed by these components. The influence of these characteristics on the translation of single and variable frequency electrical signals into acoustic signals in this system was significant, as shall be discussed in Section 4.2.  2.5 Characteristics of an Acoustic Signal in Air  While the medium in which the target structure had been immersed, i.e. air, was not ideal, its characteristics can be idealized, within certain constraints, without significant error. Let us consider two aspects of acoustic transmission through air: signal velocity and attenuation. When an acoustic signal passes through air, its velocity varies as  (2.1)  where v is she velocity of the signal, y is the ratio of specific heats of air (1.402), p is die air s  pressure in kilopascals, and p is the density of air, which varies as 1.276 x 10" p P = 1 + 0.00367 T 5  (2.2)  where T is the temperature in degrees Celsius. Substituting equation 2.2 into equation 2.1 and reducing, we find that  = 331 Vl  + 0.00367 T  (2.3)  15 The velocity of an acoustic signal in air is thus a function of the air temperature. For the situation with which we were concerned, that of an acoustic signal travelling a short distance through still air, we see that the velocity of the signal will vary about one sixth percent per degree Celsius temperature change at room temperature (20°C). Since the images have been acquired at room temperature, variations due to temperature have not been a problem. Although variations in acoustic velocity during data acquisition could have resulted in incorrect distance measurements, observed variations have not been significant. This is primarily due to the location of the target region, within a closed room and bounded by three walls. As an acoustic signal from a pseudo point source travels through air, its energy is spread over a surface with an area increasing with the square of the distance from the source. It was, therefore, not unexpected that the strength of a signal reflected or diffracted from a surface would decrease as the surface became further from the source and receiver. Variations in reflector distance resulted in signal amplitude variations at the microphone. These variations were carried through the remainder of the system and resulted in signal amplitude variations in the finished plots. These variations were minor, due to the short distances involved. Of greater concern, because of their variation with frequency, was attenuation of the acoustic signal due to characteristics of air such as viscosity, heat conduction, and molecular translation. The effect of this attenuation in the received signal due to absorption of sound in air, shown in Fig. 2.8, varied from approximately 0.2 dB/m at 15 KHz to 0.001 dB/m at 1 KHz [10]. This level of absorption, in comparison to the geometric dispersion of the acoustic signal, was considered relevant, but not  sufficiently important to warrant further investigation at thetimethe system was constructed. Analysis of crosscorrelation responses from near (50 cm) and far (2.0 m) reflectors did not reveal any significant variation in the shape of the autocorrelation wavelet. Had disruptive frequency dependent attenuation been present, the crosscorrelation wavelet would have varied significantly from the autocorrelation wavelet of the reference signal.  16  0 05  n  002  o I  0.01 0.005  C 0.002  0.001 0.0005  0.0002  Fig. 2.8 Absorption of Sound in Air [9]  2.6 Scattering Due to Structures in the Target Region After the source signal was emitted by the loudspeaker, it travelled into the target region until it encountered a scattering structure. The mechanism of this scattering is described below. When the source signal impinges on a smooth surface, it will be reflected from that surface at an angle equal to the angle at which it struck the surface and with a slighdy reduced amplitude, due to absorption by the surface material. Only those surfaces perpendicular to the path of the signal from the loudspeaker to the surface could, therefore, cause a reflected signal to appear in the finished data set.  17 When the source signal strikes a surface which is not smooth, it will be diffracted from that surface, at all angles and with varying coefficients, back into the air. Although solutions for diffraction from most given structures is sufficiently complex to make the calculation of an exact solution a formidable task, with a few approximations estimated solutions may be generated. The purpose of this acoustic scatter-mapping system, after all, is the generation of experimental data for comparison with numerical solutions. For the case of a zero-offset transducer pair in an acoustic medium of constant velocity and low reflectivity, such as that found in the acoustic scatter-mapping system, Trorey [11] provides the following approximation using a scalar potential to represent the acoustic wave field scattered from a surface 9  i  w  v  _  J _^  2 * * / W e - ^ _ zRf(p)  e  lM  (24)  e  where <p is the potential at a point P, R is the reflection coefficient of the surface,/(p) is the Laplace transform of the source waveform associated with the source point, p is the Laplace transform variable, v is the velocity of the medium, and z and % are the distance from the sourcereceiver pair to the plane of the surface and the edge of the surface under consideration, respectively. The first term in equation 2.4 is the reflection response of the surface under consideration and the second term is the diffraction response. Notice that the effect of reflection or diffraction on the source can be described as a multiplication of the Laplace Transform of the source signal with a reflection or diffraction coefficient independent of the characteristics of the  source signal. In a practical sense, equation 2.4 means that a source-receiver pair moving past an edge will observe a diffraction response whose amplitude and phase vary with the angle between the source receiver pair and the diffracting edge. The returning signal is diffracted from the edge as if it had originated there, with only minor variation due to the angle of source signal incidence. This variation, however, is important as the diffraction response must change phase by 180 degrees as the transducers pass over edge. This phase change, coupled with the amplitude of the diffraction increasing to 50% of and resembling the reflected response at the diffracting edge are  18  necessary for the overall scattering response from a target plane to be continuous. Reflection from a plane thus appears to originate in the crest of the diffraction hyperbola caused by the plane edge. This will be discussed further in Section 4.3.  2.7 The Relevance of Translation Characteristics  When considering the effect of individual signal path components, it is possible to lose sight of the signal path as a whole. Let us now consider the net effect of the signal path from the calculated source signal to the plotted received signal. The attenuation of a signal traversing the system signal path was as expected and was not observed to vary significandy with the distance between the transducers and the target structure. The effect, for the most part, of the signal path on a source signal did not vary significandy due to the expected ranges of temperature, humidity, or distance. Those factors which may have had a variable effect on the transmitted signal were limited to reflection and diffraction, and in both cases an effect related to the size and angle of the feature influencing the signal were desired. Thus, while ideal system components would be desirable, the benefits to be gained by thenexistence were not expected to be substantial.  19 3 OTHER ASPECTS OF T H E IMAGING SYSTEM  3.1 Repositioning the Transducers  The acoustic scatter-mapping imaging system was capable of collecting scatter-mappings in multiple dimensions by repositioning its transducers with respect to the target structure. Had the transducers been fixed in position, the acquired information would have been limited to signal amplitude and phase versus travel time. For the case of a target region radially uniform in the vicinity of the transducers, this information could be used to describe the structure of the target region in the radial direction. Were the target region to vary angularly, i.e. in a second dimension, this acoustic scatter-mapping configuration would be unable to distinguish dissimilar features occurring at differing angles but at similar radii. The data for all features at a given radius would be a combined function of those features. The amount of useful data from the study of radially uniform models is quite limited. By collecting data at a number of transducer positions, it became possible to collect signal amplitude information in a second dimension, as shown in Fig. 3.1. Assume that the location of the transducers was fixed in the x and z coordinates, but that their position in the y coordinate could be shifted a known amount between data acquisition cycles. Assume also that the target structure was far enough from the transducers and the coverage angle small enough that a  plane, constant in the x c o o r d i n a t e , could be approximated as a surface of constant radius.  If the target region was uniform in the x-direction, within the vicinity of the transducers, but varied in the y-direction, the amplitude of the received signal could be mapped in two dimensions: signal travel time and the y-coordinate of the transducers. This was the format used in the development of the system described here. The potential for mapping variations in all coordinates will be discussed in Chapter 6. In order that the transducer position be variable in the z-coordinate it was necessary to mount the transducers on a mobile frame as shown in Fig. 3.2. An overhead trolley was established to transport the transducers across the target region and an overhead rail was fixed in  20  the z-cc<>rdinate. In order that the movement of the trolley along the rail be both precise and remotely controlled, a synchronous motor was used to turn a rod, mounted alongside the rail, which in turn operated a linear actuator attached to the trolley. The synchronous motor was operated from the mains and controlled via a data acquisition card installed in the microcomputer. Limit switches at each end of the trolley rail interrupted power to the synchronous motor in the appropriate direction whenever the switch was depressed. This arrangement allowed automatic positioning of the transducers before and during data acquisition sequences. Prior to data acquisition, the trolley was positioned to rest against the east limit switch. Following each data acquisition cycle, the trolley was moved to the next data acquisition location by controlling the duration and direction of motor operation. Although the target structure and signal transducers could be accurately positioned with respect to a fixed point of reference in the target region, the data sets generated by the system  21  Fig. 3.2 Photograph of the Transducers as Mounted on the Trolley  lacked this physical reference point. They had, instead,  a reference line in the z coordinate  resulting from the direct reception of the transmitted signal by the receiver transducer, as well as information as to the position of the transducers relative to their initial position. It was therefore necessary to relate the coordinates of the plotted data generated by the system to the reference coordinates in the target region. This was done by acquiring an image of a plane ending in a sharp edge. The reflection from the plane surface was used to relate the z coordinates, while the apex of the hyperbola resulting from the edge was used to relate the y coordinates. The error in  22 relating the z coordinates was less than 4 mm and the error in relating the y coordinates was less than 10 mm. Most of this error can be attributed to the scale at which the data is plotted.  3.2 Plotting of Acquired Data For the information acquired by the acoustic scatter-mapping system to be useful, it had to be available in a readable format. This kind of data is most often presented as a series of adjacent traces on ay - z plot, each trace representing a single data acquisition cycle location. The horizontal axis represented the position of the trolley, in centimeters, relative to the position at which scatter-mapping was initiated. This initial position coincided with the location of the east limit switch. No reference was provided as to the amplitude variations of each trace. Traces were normally plotted using the same amplitude scale for the entire plot and optimized to make as complete use of the available plotting region as possible. When a reference was required, a known reflector at a known distance was used. The vertical axis of the y - z plots represent time delayed between the emission of the source signal from the loudspeaker and the collection of the information signal by the microphone. The time delay was described in terms of distance to assist in the interpretation of the data sets. The distance was calculated assuming two way travel at a velocity of 342 meters per second, calculated using equation 2.3 as discussed in Section 2.5. The system used a plotting routine, Lasrplot, which was written in C and generated a Postscript file which was sent to a laser printer. Queries were directed to the user as to the names of the source and destination files as well as the number and length of the traces the user wishes to plot. The plot data was scaled, in amplitude, on either a trace by trace basis or over the entire set of data. To assist in the interpretation of the plotted data, the data could be plotted such that data points above the zero trace were shaded, below the trace zero line were shaded, both above and below the trace zero hne were shaded, or no points were shaded. Plot and axis titles were also user-selectable. A listing of this program is in Appendix A.  5  23  3.3 Further Processing of Data  The data acquired by the acoustic scatter-mapping system was processed, compressed, and then filed. When the information signal was received by the microphone, it was passed, via an amplifier, to an analog to digital convenor (ADC). The ADC digitized the information signal of a typical sweep at 5 us intervals for a period of 81.92 ms. About two million samples were acquired from a typical 125 trace run. After datafromeach trace had been collected, it was processed and the result of the processing was windowed, to about 465 KB of data, and filed. The data within the filed window contained all of the information available about the target region from the acoustic scatter-mapping system. The data outside of thefiledwindow contained information about signals which arrived at the microphone before or after sufficient time had elapsed for the source signal to scatter from structures in the target region. This, otherwise superfluous, data was valuable in determining the exact nature of thefinisheddata. The entire set of collected data was notfileddue to the amount of data collected, about 8 MB per run, the rate at which it was collected, almost daily, the intimate relationship between the data collected and the reference waveform used to process it, and the ease with which replacement data could be acquired. The use of a standardized data file format within the acoustic scatter-mapping system encouraged the use of postprocessing. That is, afilecould be further processed, after it had been initially acquired and processed, without jeopardizing the system's ability to plot the data. The data could also be converted to ASCII format and then transferred to another computer for further processing. As an example of postprocessing, Median3, a three-point space-median filter program, was written. Median3 was used to reduce the amplitude of horizontally recurring reflections on finished sets of data. A medianfilterexamines a set of data points, determines the median of these points and uses it to generate a new set of points. By using the median, or middle value, of these data points, thefilterrestricts the rate at which data may change in line with the filter. Atime-medianfilterrestricts thefrequencycomponents of a set of data. A space-medianfilterrestricts the rate at which data appearing at a regular time-position in a set of  24  space-adjacent traces may change. Median3 examined space-adjacent,time-similardata points, three at atime,to determine the median value. These median values, had they been plotted as a set of data, would have appeared to be a blurred version of the original set of data. Instead, they were subtracted from the original set of data to reduce the influence of those features which tend to appear at a regular time-position through a number of traces. The effect of median filtering as used by this system can be seen by comparing Figs. 5.8 and 5.9, which are plots of the same set of data before and after filtering.  25  4 DEVELOPMENT OF A SUITABLE SOURCE SIGNAL  4.1 Characteristics of a Good Source Signal The ideal source signal is that which could be used to provide the maximum amount of information about the structure under study. With the understanding that the ideal source signal was probably not realizable, we chose to evaluate potential source signals by comparing the results of their use with expected results of the ideal source signal. Let us begin by describing the results possible using the ideal source signal, and later use this reference to evaluate actual source signals. The ideal source signal will be capable of accurately representing the location of a reflection or diffraction in a plot representative of the target region. That is to say, it must be possible to determine the precise location of the source signal, or a derivative thereof, on a scatter-mapping plot of the target region. This location information is essential to the accurate locating of target structure features in the acquired data. This specification encompasses not only the location intimeof the source signal, or its derivative, but the amplitude signature of the source signal, or its derivative, as well. An accurately located feature of unpredictable signature will not be considered useful. The ideal source signal will be of very short time duration. Often, reflection and/or diffraction returns have extremely short time separations. For these adjacent returns to be easily discernable, the ideal source signal, or its derivative, must be composed of no more than a single positive lobe and one or, at most, two negative lobes. The signal may be inverted if desired. The ideal source signal will be transmitted through air. Because air is a frequency dependent attenuator, this means that the source signal must be either bandwidth limited or compensated for this attenuation. The complexity of compensation would be increased by the use of the source signal, or its derivative, to determine the distance travelled by the source signal. Bandwidth limitations, however, will limit the minimum size of the signaltimewindow. We expected that the selection of a source signal, even the ideal source signal, would not be straightforward, given the non-ideal conditions under which it would be used. We applied a  26 final condition, that the source signal be reproducible using the acoustic scatter-mapping system hardware. By imposing this condition, we demanded that the source signal accommodate the attack and decay characteristics of the loudspeaker as well as the frequency response characteristics of the loudspeaker and microphone. While these appeared to be great limitations on the choice of source signal, the crux of the matter remained unchanged. A good source signal had to be repeatable. None of the limitations far affected this, as this acoustic scatter-mapping system was established with the goal of generating repeatable data.  4.2 Selection of a Usable Source Signal In spite of the discussed limitations imposed on the source signal, the possible choices of source signal form remained virtually unlimited. The constraints on the source signal required only that the end result of the source signal, after having been calculated, generated, translated to an acoustic signal, transmitted through air, translated back to an electrical signal, digitized, and plotted, was of a specified nature. No further restrictions were placed on the form of the source signal or the processing of the received signal. Prior to my involvement in this project, the acoustic scatter-mapping system made use of a pulsed source. While a pulsed source was quite simple to calculate, the result of passing this signal through a digital to analog converter (DAC), an amplifier and a loudspeaker, was that the desired pulse was malformed and followed a ringing signal of approximately the same amplitude and frequency as the desired pulse. A typical pulsed-source signal and the resultant received signal are shown in Figs. 4.1 and 4.2. This difficulty invited further consideration of possible source signals. The distortion seen in the signal received by the microphone, when a calculated pulse source was generated, was, predominantly, the result of two factors: 1.  The limited bandwidth of components in the signal path. The loudspeaker, as discussed in Section 4.3, had a limited response outside of its 800 Hz to 15 KHz range. The microphone responded similarly outside its 200 Hz to 13 KHz range. .  r  j I I M i l I I I | I I I I I I I I I | I I I I I I I I I | I I I I I 2000 4000 6000 8000 Time (microseconds)  I I I I I I I I I  0  I  I I I 10000  Fig. 4.1 A Calculated Pulse Source Signal  0  i i i i i i i i i | i i i i i i i i i | i i i i i i i i i | i i i i i i i i i | i i i i i i i i i 2000 4000 6000 8000 10000  Time (microseconds)  Fig. 4.2 Distortion of a Pulse Source by the Signal Path  28 2.  The attack and decay parameters of the transducers. These parameters, not normally available for loudspeakers other than those designed for use at low audio frequencies, were found to be on the order of several cycles for the loudspeaker used in this system. Having better understood the limitations imposed on the calculated source signal, we  intuited that any desired source signal must be a pre-distorted version of the waveform occurring as an indicator on the plotted data sets. Thus, attention shifted from the question of which kind of pulse signal was most desirable in the finished plots to which kind of source signal would cause the most desirable signal to appear in the finished data sets. At this point the issue of whether or not to use a pulsed source signal at all was raised. In order for the acoustic scatter-mapping system to make use of a pulsed source signal, the non-ideal parameters of the loudspeaker and microphone required that the signal be predistorted. The exact characteristics of the pre-distortion, however, were unknown, although the large size and low damping factor of the loudspeaker suggested that its attack and decay parameters were quite large. Three options were apparent: 1.  Determine the response parameters of this loudspeaker and determine a matching predistortion such that the predistortion and distortion effectively cancel each other out.  2.  Replace the loudspeaker, and possibly the microphone, with another of improved and/or known parameters and determine a suitable pre-distortion for this new configuration.  3.  Replace the pulsed source signal with a signal more compatible with the system components and capable of causing pulses to appear at the appropriate locations in the finished data sets. We decided to make use of the third option, that of replacing the form of the calculated  source signal. In the field of seismology there is a technique called Vibroseis [12], wherein a sweptfrequency mechanical vibrator source replaces the traditional explosive charge source used to study underground structures. While recordings made of the signal transmitted through the ground as a result of pulsed source signals were used to directly determine the underground structures, in the Vibroseis technique the received swept-frequency signal was crosscorrelated  29  with a copy of the source signal. The result was similar to the traditional method in that a pulse appeared at the relative location of significant events, but differed in that the pulse was not the originally transmitted signal, but the autocorrelation of the originally transmitted signal. A similar technique in radar is called Chirp Radar [13]. We decided to make use of a similar technique in this acoustic scatter-mapping system.  4.3 Swept-Frequency Source Signal Description In order to best appreciate the differences between a direcdy-recorded pulsed source system and a crosscorrelated swept-frequency system, let us consider the characteristics of signals of both types as they are acquired, processed, and plotted. In order to simplify analysis of the signals, we will first determine the ideal response and then present data for the non-ideal case to demonstrate the difficulties inherent in using non-ideal components. Let us assume that the system is immersed in a homogenous medium of constant velocity v and contains a single reflector at a distance r from the source-receiver pair. The system response, observed at the receiver, to a step function signal emitted from the source, would be kit)  = u(t ) 0  + a (r)  u(t-2r/v)  d  (4.1)  where u(t) is the step function, a^r) is the spatial attenuation of the signal due to the distance from the source-receiver pair to the reflector, and t is thetimerequired for the signal to leave 0  the source and enter the adjacent receiver.. The first term is the result of a zero-offset source receiver pair and the second is identical to first but delayed by the time required for the signal to travel to and from the reflector. More generally, the signal h(t), seen at the receiver when the signal g(t) is emitted by the source, can be described as the convolution of the source signal and the system response h(t) = g(t) ® k(t)  Or, in the frequency domain,  = g(t) ® u(t ) 0  + a (r)g(t) d  ® u(t-2r/v).  (4-2)  30  H(f)  = G(f)K(f).  (4.3)  Now let us assume that an ideal unit amplitude pulse source is used. The expected result h (t) = 6 (t ) + a (r) 6{t- 2r/v) 0  (4.4)  d  would be as shown in Fig. 4.1. Unfortunately, generating signals using a non-ideal source transducer tended to result in the response shown in Fig. 4.2. This was a result of the factors discussed in the previous section. Let us now consider a swept-frequency source signal. Swept-frequency source signals may be described as [12]-[13] s(t) = a, (t) cos [{?(*)]  (  4 5 )  where a (t) is the amplitude function, typically s  a (0 = A[u(ti) s  - u(f )]  (4.6)  2  where t j is the start and t£ is the end of the sweep. A is the peak amplitude, a constant. The phase function, 0(r), typically quadratic, is expressed as ii  6{t) = ~  + 2ix  J  [c + c ( r - t )) dr x  2  (4.7)  x  where C j and C2 are constants. Now let us assume that this swept-frequency signal is used as a source. The expected result h (t) = a (t) cos [9 (t)} + a (r) a (t - 2r/v) cos [9 (t - 2r/v)] 3  d  s  ( -8) 4  31 would be as shown in Fig. 4.3. While the signal seen at the receiver, shown in Fig. 4.4, in response to a calculated signal of this form would be slightly different from that expected, it would not differ as severely as the response to the pulse source signal. After the received signal resulting from a calculated swept-frequency source signal had been digitized, it would be crosscorrelated with a copy of the source signal. The crosscorrelation function [14] is defined as oo  (4.9)  Rgh{t) = J 9{r + t) h(r) dr  in thetimedomain. In the frequency domain, this is expressed as [14]  n  gh  (4.10)  = G(f)H*(f).  Substituting in equation 4.3 makes the situation much clearer  (4.1D  Tl = G(f)G*(f)K(f) 9h  The effect of crosscorrelating the received signal with a copy of the source signal was the same as convolving the autocorrelated source signal with equation 4.1, the response of the system. This allowed greater latitude in the choice of source signal, as the precise envelope of the signal is no longer important so long as the uniqueness of the source signal with respect to a time shifted copy of itself can be optimized. The crosscorrelation of the received sweptfrequency signal with a copy of the source signal is shown in Fig. 4.5. The system response to a source waveform does not change dramatically for the case of multiple reflectors or diffractors replacing reflectors. For a case of reflections from more than one point, equation 4.1 would become n  w(t)  = u(t ) 0  + V] a (r ) u(t d  r  2r /v). r  32  i—r  I ' M  20000  i—i—i—i—i—i—|—i—i—r 40000 Time  l—i—i—i—i—|—r 60000  (microseconds)  Fig. 4.3 A Calculated Swept-Frequency Source Signal  | i i i i i i i i i Ii i i 0  i I i i i i i i i i i I i i i i i i i i i I 40000 60000 80000  20000 Time  (microseconds)  Fig. 4.4 The Received Swept-Frequency Signal  33  I I I I I I I | I I I I I I I I I | I I I IT I I I I | I I I I I I I I I | I I I I I I I I I  2000  4000 6000 Time (microseconds)  8000  10000  Fig. 4.5 The Crosscorrelated Received Swept-Frequency Signal  The situation for diffractors is similar, as discussed in Section 2.6, but causes a phase shift also. Thus, the system response would become  w (t) = u(t ) = 52 a (r ) a  d  r=o  r  u(t  - 2r /v)+^2 r  d  <*d(r ) u(t + 6 /u d  d  -  2r /v) d  =o  (4.13)  where 8^ is the phase shift caused by the diffractor and co is the instantaneous frequency of the source signal. Whereas the existence of a reflector in the target region would cause a timeshifted copy of source signal to appear in the received signal, the existence of a diffractor would cause a time and phase shifted copy of the source signal to appear in the received signal.  4.4 Selection of a Suitable Swept-Frequency Source Signal Having determined the characteristics of a good swept-frequency source signal, and having understood the stages through which the signal must pass, thefinalstep was to develop a  34  swept-frequency source signal suited to the exact characteristics of the other components of the acoustic scatter-mapping system. This involved trading off signal bandwidth, signal-to-noise ratio, sweep rate, and amplitude envelope to find the autocorrelation pulse best approximating the ideal source signal. The bandwidth and sweep rate of a swept-frequency source signal were predominantly limited by the characteristics of the source transducer, the loudspeaker. This was a result of both the relative power and complexity of the source transducer. The first step, therefore, was to determine the relative tradeoff between the signal bandwidth and sweep rate. We found that a linearly swept source signal, i.e. a sweep whose instantaneous frequency varied linearly with time, could be swept at a high rate if the sweep bandwidth was quite narrow. As the bandwidth of the signal was increased, the amplitude envelope of the received signal began to show successive maxima and minima at regular intervals. When the bandwidth was held constant and the sweep rate reduced, the distance between the minima increased. In order to eliminate the successive maxima and minima within the envelope of the received signal, we decreased the sweep rate until only two minima were observed, one at each end of the sweep. A maximum also appeared near the center of the envelope. This solution to the bandwidth versus sweep rate tradeoff left unresolved the tradeoff between bandwidth, sweep rate, and autocorrelated pulse shape. The signal-to-noise ratio of the crosscorrelated received signal, varying with the square root of the total sweeptime[12] was not directly considered. The width of the pulse which appeared at the center of autocorrelated source signal was inversely related to the bandwidth of the autocorrelated received signal and the received signal prior to autocorrelation. It was therefore decided that the source signal should have as wide a bandwidth as possible within the limitations of the transducers. This left the problem of selecting the most useful signal amplitude envelope and it became necessary to establish quantitative criteria to evaluate the effect of the envelope shape on the autocorrelated signal. We also found that the realization of a particular received signal was not direcdy attainable. That is, given a particular autocorrelated pulse, we were not able to specify the exact nature of the calculated source signal necessary to realize the particular pulse as its crosscorrelated received  35 signal. Instead, we knew the relationships between the envelope of a signal and its autocorrelation and between a calculated source signal and the resulting received signal. An iterative process was then required to optimize the calculated source signal to realize the desired autocorrelated signal. Koefoed [15] selects three aspects of autocorrelated swept-frequency signals and discusses the effect of signal characteristics on each. These aspects were used as aids in the evaluation of potential source signals. The first characteristic, the breadth of the central lobe, is expressed as the time difference between the extrema of the two side lobes. The second, the side lobe ratio, is expressed as the ratio between the amplitude of the side lobes and that of the central lobe. The final aspect, the amplitude of the side-tail oscillations, is described as the shape of the wavelet at a time larger than three-quarters of the dominant period from the center of the wavelet For the purposes of this thesis, this characteristic will be described by the maximum amplitude of lobes in this region with respect to the amplitude of the main lobe. Koefoed states that the infinite integral of the wavelet must be zero, requiring sufficient area of the negative portions of the wavelet to balance the area of the positive portions. Should the side lobe ratio be less than 0.5, side-tail oscillations must occur to balance the main lobe area unless the side lobes are sufficiently wide to accommodate their low amplitude. While the prospect of large side-tail oscillations or a large side lobe amplitude were undesirable, the alternative situation of wide side lobes was even less so. We chose to use an autocorrelation envelope containing large, narrow side lobes and minimal side-tail oscillations. Koefoed recommended the autocorrelation of a signal with a triangularly shaped amplitude envelope. Having determined the characteristics of a suitable received signal, we calculated a source signal to realize the desired received signal. This was done iteratively, beginning with a calculated signal similar to the desired received signal. As we observed the effects of transducer attack and decay we compensated for them and calculated a new source signal. In addition to fitting the amplitude envelope of the received signal, we had to further taper the ends of the calculated source signal to hmit the background level of the autocorrelation [16]. We did this with a cosine taper at both the start and end of the sweep. The cosine taper was of the form  36 1 - cos (n 7t / AO, where n was the number of data points from the start or end, respectively, of the signal, and N was the number of points over which the taper was to occur. The spectral density of the calculated and received signals are shown in Figs. 4.6 and 4.7 respectively. The autocorrelation of the received signal is shown in Figs. 4.8 and 4.9. The listing of the program, Wavegen, used to calculate the source signal is in Appendix A. The dominant period of the autocorrelated received signal was 107 Lis, corresponding to a dominant frequency of 9.3 KHz. The sidelobe ratio was 63% and the side-tail oscillations were no greater than 7% beyond the first sidetail at 11%. A copy of this received signal, acquired by directing the loudspeaker into an area effectively free of scatterers and directing the microphone toward the loudspeaker at a distance of 50 cm, was used as the reference signal, with which to crosscorrelate a received signal, in the subsequent operation of the acoustic scatter-mapping system.  37 100  CD  o 0) >  a <u DC  Frequency ( K H z )  Fig. 4.6 Spectral Density of the Calculated Waveform  100  T i i i i | i i i i i i—i—i—i—— | r  12.0  Frequency ( K H z )  16.0  Fig. 4.7 Spectral Density of the Generated Waveform  20.0  38 100  -4500  i—i—i—|—i—r -3000  1—|—i—i—i—i—|—i—r -1500 0  I  1500  Time (microseconds)  i i i r 3000  4500  Fig. 4.8 Autocorrelation of the Reference Waveform  - 1 0 0 I I I I I | l I I I | l l l l | l l 1.1 | l I l I | I I I I | l l l I | I I I I | I ) I I | I I I I I -250 -200 -150 -100 - 5 0 0 50 100 150 200 250  Time (microseconds)  Fig. 4.9 Autocorrelation of the Reference Waveform  39  5 EVALUATION OF THE SYSTEM ON SOME SIMPLE MODELS  5.1 Target Region Description  In order to demonstrate the applicability of this acoustic scatter-mapping system, scattermappings acquired from three models are provided. In each case, the model is described along with the acoustic scattering expected due to features of interest on the model. The acoustic scatter mapping of the model is then presented with a discussion of any relevant differences between the expected and mapped acoustic scattering. The first model, that of no model, is provided to familiarize the reader with the characteristics of target region prior to the entry of a model. The second model, that of a buried edge, is presented to demonstrate the ability of the system for the case of a well-known structure. The final model, that of a plane ending in a rounded edge of constant radius, is provided to demonstrate the sensitivity of the system and corroborate the results of a diffraction model prediction.  5.2 The Vacant Target Region  The first model to be considered is that of the vacant target region. While this may not appear to be a useful model, its importance lies in the baseline it will provide for other models. That is, effects observed in the acoustic scatter-mapping of the vacant target region are likely to appear as well in acoustic scatter-mappings of other target structures. This baseline mapping is valuable also as a simplified introduction to the data sets generated by this system. When considering the diagram of the vacant target region in Fig. 5.1, one should take note of several important features. The first is that the target region is virtually continuous in the x - direction in the vicinity of the transducers. This is important as the variations in which we are interested are restricted to those in the y and z directions. Should there be variations in a third dimension, the system, able to vary its acquisition of information in only two dimensions, time  41 and the y - direction, would not be able to provide sufficient information to the user for the user to locate the features responsible for all of the returns in the scatter mapping. A second consideration of the physical layout of the acoustic scatter mapping system in the target region is the adjacent position of the transducers. This is important as the system was initially developed to acquire data for the simplified case of a zero-offset source-receiver pair. This desire was thwarted by the physical dimensions of the transducers as well as interference between transducers in close proximity. The compromise places the face plate of the loudspeaker, the point on the loudspeaker from which locational measurements were made, horizontally adjacent to and 9 cm beside the microphone cartridge. The result is that there is a measurable delay between the signal being sent to the loudspeaker and a copy of the signal, travelling from the loudspeaker driver, through the loudspeaker horn, diffracting from the face plate of the loudspeaker, and travelling to the microphone cartridge, being sampled. This delay does not vary unless the transducers are repositioned relative to each other, a situation which does not normally occur. The result of this delay is a phase shifted copy of the source signal appearing in the generated scatter mapping which may be used for relative amplitude and time measurements. The time delayed signal resulting from the non-zero offset of the source and receiver appeared in plots of scatter mappings as if it were the result of a feature located 4.5 cm below the speaker face plate. This apparent impossibility was the result of assuming that features responsible for scattering are sufficiently far away from the transducers to validate the assumption that the transducers are zero-offset. A third feature to consider in the environment of the acoustic scatter mapping system is the location of the nearby walls, floor, and ceiling. The south wall, in the background of the vacant target region diagram, is 270 cm away from the transducers. Because the net time window in which the signal received by the microphone is considered is only 9.3 ms, returns from features more than 162 cm away from the transducers will not appear in the scatter mappings. Thus, the south wall will not influence the scatter mappings. Neither will the ceiling, at a distance of 260 cm nor the nearest object on the north side, at 335 cm from the transducers. The concrete floor of the region, however, being only 140 cm from the transducers will be  42 responsible for a reflection appearing in the generated data sets. The edges of this reflective material, however, are the cause of a pair of weaker diffractions. The east and west walls, on the left and right sides of the target region diagram respectively, are only 55 cm and 87 cm from the transducers at their respective ends of the trolley position. These will result in returns appearing in the generated plots which will vary with the distance between the transducers and the wall. Corrugated foam absorbers were added to the most significant portions of the east and west walls to reduce their reflection coefficient. Fig. 5.2 is a diagram of the scattering expected due to observed features in the vacant target region. Fig. 5.3. is a diagram of anticipated returning signal paths. The two most easily predicted returns are those generated by the non-zero-offset of the transducers, from (0,4.5) to (248,4.5), and reflectionfromthe floor, from (0,139) to (248,139), sloping shghtly toward a floor drain from (88,141) to (190,141). A corner reflection, expected from the corner between the floor and the east wall, appearsfrom(0, 150) to (26, 163). Reflections from the east and west walls are expected from (0, 53) to (110, 163) andfrom(168, 163) to (248, 84) respectively. The wall reflections are expected to be much weaker than those from the floor, as the walls were covered, in relevant areas, with acoustically absorptive foam. The floor drain in the center of the target region was covered with reflective material to reduce diffractionfromthe grating over the drain, although the edges of the material were expected to be responsible for diffraction hyperbolae centered at (88, 141) and (190,141). Fig. 5.4 is an acoustic scatter mapping of the vacant target region. Comparison of this mapping with that expected, Fig. 5.2, shows that the two are nearly identical. The direct signal from the loudspeaker to the microphone appears as a strong phase-shifted return and the floor appears as a strong zero-phase return. Fig. 5.5 shows the same acoustic scatter mapping data following the application of the three-point space median filter discussed in Section 3.3. In all median filtered data presented, the amplitude gain of the plot has been increased significantly to emphasize the smallest details of the data. In this plot we can see that the returns from the uneven floor were not as well filtered out as those of the direct loudspeaker to microphone signal. The weak reflectionfromthe west wall and the weaker reflection from the east wall are  Fig. 5.2 Expected Acoustic Scatter Mapping of the Vacant Target Region  44  o.  O.  in  5 g1/5  O  O.  6  g  8-  £ 2o mO •<t-  B!l!  • v. .  HI"  """•Mr  v.-,  o o VO-  0  10  20  30  40  50  60  70  80  90  100  110  120  130  140  150  160  170  180  190  200  Horizontal Transducer Offset From Reference (cm) (g=7, c=3, s=a)  Fig. 5.4 Acoustic Scatter Mapping of the Vacant Target Region  210  220  230  240  0  10  20  30  40  50  60  70  80  90  100 110 120 130 140 150 160 170 180 190 200 210 220 230 240  Horizontal Transducer Offset From Reference (cm) (g=21, c=3, s=a)  Fig. 5.5 Median Filtered Acoustic Scatter Mapping of the Vacant Target Region  4^  47 locations on the wall, rather than just the one expected. The reflection from the corner of the east wall and thefloor,already noticeable in the unfiltered data, became a smear of main lobes and sidelobes in the median filtered plot as the plotting routine gain was increased. Diffraction hyperbolae from the edges of the material covering the floor drain were also centered in the expected locations.  5.3 A Half Plane  The second model was constructed of a half plane, the edge of which was 59.5cm below the transducers. The half plane was constructed of a sheet of galvanized steel approximately 1.0 mm thick as shown in Fig. 5.6. The scattering solution for this model, scaled for differences in acoustic velocity and dominant frequency, was calculated by D.R. Dalton [17] and appears in Fig. 5.7. The acoustic scatter mapping of this model is shown in Fig. 5.8 and a median filtered mapping is shown in Fig. 5.9. The relative amplitude and phase of the scattering response in the experimental case were similar to that predicted by the theoretical model. The plane reflection appeared from (0, 60) to (129,62) in the experimental data, ending in an edge at (129, 62), the center of the diffraction hyperbola. In those locations where the experimental and theoretical data were dissimilar, limitations in the construction of the model may be sited. The slope of the plane from (0, 60) to (129, 62) was due to a slope in the floor, and the diffraction response appearing from (14, 62) to (96,107), for example, was attributed to a joint in the sheet metal, less than 0.5 mm high.  5.4 A 13 cm Step  The third model, that of a 13 cm step, is shown in Fig. 5.10. The step was constructed of plywood with an durninum frame. The step was chosen as a demonstrative model because it is a commonly occurring natural structure. It was also a sufficiently simple structure that its exact acoustic scattering could be calculated. The exact scattering solution, calculated by Zhang Qin  1.0 mm thick galvanized steel sheet  joint  0 6  128 Horizontal Tranducer Offset (cm)  Fig. 5.6 Diagram of the Half Plane Model  Fig. 5.7 Expected Acoustic Scatter Mapping of a Half Plane (a) exact reflected and diffracted field, (b) Kirchoff equivalent [17]  o_ o.  o. ro O. -3-  o in.  s o o c  O.  Q  0_  O  o  £  2J  8o  mO  o O ve-  rt  10  20  30  40  50  60  70  80  90  100  110  120  130  140  150  160  170  180  190  Horizontal Transducer Offset From Reference (cm) (g=7, c=3, s=a)  Fig. 5.8 Acoustic Scatter Mapping of the Half Plane Model  200  210  220  230  240  o. o. CO  O.  o.  o.  S °Vi O H  __  O ON"  O  13 o 2  £  2.1  8o  co-  co o >/->-  o VO-  0  10  20  30  40  50  60  70  80  90  100  110  120  130  140  150  160  170  180  190  200  210  Horizontal Transducer Offset From Reference (cm) (g=7, c=3, s=a)  Fig. 5.9 Median Filtered Acoustic Scatter Mapping of the Half Plane Model  220  230  240  — |  E sz  Q. QJ  Q  80.7  93.7  132.5 Horizontal Tranducer Offset (cm)  Fig. 5.10 Diagram of the 13 cm Step Model  to  53 [18], is shown in Fig. 5.11. The acoustic scatter mapping of this model is shown in Fig. 5.12 and a median filtered version of the mapping is shown in Fig. 5.13. The relative amplitude and phase of the scattering response in the experimental case were similar to those calculated. The lower plane reflection began at (0,94) and continued to (132, 94), where it blended into the corner reflection and diffraction centered at (132, 94). The corner reflection was the result of the source signal reflecting from face of the step and then from the lower plane. The diffraction hyperbola centered at (132,94) was the result of a diffraction at the end of the upper plane followed by the diffracted wave reflecting from the lower plane and diffracting a second time from the end of the upper plane before being received by the microphone. One side of this diffraction hyperbola was obscured by the comer reflection. The hyperbola from a diffraction at the end of the upper plane was centered at (132, 81).  5.5 A Plane Ending in a Rounded Edge of Constant Radius  The fourth model, that of a plane ending in a curved edge of constant radius, is shown in Fig. 5.14. This model was especially interesting as the scattering solution for it, calculated by Q. Zhang [19] and appearing as Fig. 5.15, includes a creeping wave. This weak response was the predicted result of the source signal creeping along the surface of the rounded edge, diffracting on the end of the rounded edge, and creeping along the rounded surface again before arriving at the microphone. This effect results in a response from the end of the rounded edge, even when the end is not visible to the transducers. The acoustic scatter mapping of the model is shown in Fig. 5.16. The median filtered version of the mapping, shown in Fig. 5.17, revealed a continued response beyond the 118 cm trolley position, the limit at which the end of the rounded edge is no longer visible to the transducers. The apparent duplication of the model about 59 cm below the actual model was the result of the signal returning from the surface of the model, reflecting from the loudspeaker horn, and reflecting from the surface of the model once again.  54  Fig. 5.11 Expected Scattering Mapping of a 13 cm Step [18]  o o. o. cn O.  o.  s o  c3 o-.  Q SI—I in  a  00  u o.  6 <=*  S§> 2 „ H 2rt  8o CO-  CO  O >/->O  VO-  0  10  20  30  40  50  60  70  80  90  100 110 120  130  140 150  160  170 180  190 200 210 220 230 240  Horizontal Transducer Offset From Reference (cm) (g=7, c=3, s=a)  Fig. 5.12 Acoustic Scatter Mapping of the 13 cm Step  o_ o. CN  o. ro O . "3-  o. m O  3'  S gC/5  0>  H  o  2.  3o roO  o inO  von 0  10  20  30  40  50  60  70  80  90  100  110  120  130  140  150  160  170  180  190  200  210  H o r i z o n t a l T r a n s d u c e r Offset F r o m R e f e r e n c e (cm) (g=7, c=3, s=a)  Fig. 5.13 Median Filtered Acoustic Scatter Mapping of the 13 cm Step  220  230  240  E o_  polished aluminum surface over a wood frame  SZ  i  Q .  CD  o  I  57 72  .__  ..—  .„.,,.  4 5 ° /  147  190  Horizontal Tranducer Offset (cm)  Fig. 5.14 Diagram of the Creeping Wave Test Model  58  CO --C3  -  cn  -C3  - -CD  CO  Fig. 5.15 Expected Scattering Mapping of the Creeping Wave Test Model [19]  o. CN O. cn  o. o. 6  8-  6 * £ o 13 ocd  £ 2J  o mO  .o </->oVO-  ID  10  20  30  40  50  60  70  80  90  100  110  120  130  140  150  160  170  180  190  200  210  Horizontal Transducer Offset From Reference (cm) (g=7, c=3, s=a)  Fig. 5.16 Acoustic Scatter Mapping of the Creeping Wave Test Model  220  230  240  10  20  30  40  50  60  70  80  90  100 110 120 130 140 150 160 170 180 190 200 210 220 230  Horizontal Transducer Offset From Reference (cm) (g=21, c=3, s=a)  Fig. 5.17 Median Filtered Acoustic Scatter Mapping of the Creeping Wave Test Model  61 5.6 A Small Edge  The final model, that of single and double layers of masking tape on a smooth steel sheet is shown in Fig. 5.18. These small stacks of tape presented very small edges, a significant challenge to the resolution of the system. The single strip of tape was 0.1 mm thick and 13 mm wide and the double strip was 0.2 mm thick and 13 mm wide. Compared to the dominant wavelength of the system, 36.8 mm, these edges are 0.54% and 0.27% of a wavelength respectively. The acoustic scatter mapping of this model is shown in Fig. 5.19 and a median filtered version of the mapping is shown in Fig. 5.20. In the unfiltered data, no effect attributable to the edges was observed. In the filtered data, however, a diffraction hyperbola centered about the location of the double layer of tape (152,45) was plainly visible. The single layer of tape at (91,45) did not appear to have caused any noticeable effect Hyperbolae, attributable to diffraction by the edges of the steel sheet, were observable on both ends of the plot as were reflections due to the east and west walls.  1.0 mm thick galvanized steel sheet  i  I  1 strip of 0.1 mm thick • 13 mm wide tape  2 strips of 0.1 mm thick 13 mm wide tape  91  152  Horizontal Tranducer Offset (cm)  Fig. 5.18 Diagram of the Small Edge Model  244  o. CN  o. CO  O .  o.  in  fi o o. ci  -  Q  s-  cd U  o  t o « 2" t5  2  H 2"" o  coO  O  O  0  10  20  30  40  50  60  70  80  90  100  110  120  130  140  150  160  170  180  190  Horizontal Transducer Offset From Reference (cm) (g=7, c=3, s=a)  Fig. 5.19 Acoustic Scatter Mapping of the Small Edge Model  200  210  220  230  240  o. CN  O. CO  O.  o.  8 8o.  00 Q oo  a  O. 00  U  o  >  ~  2 8H  2-  o  CO-  CO  o mo  VO-  0  10  20  30  40  50  60  70  80  90  100  110  120  130  140  150  160  170  180  190  200  210  220  Horizontal Transducer Offset From Reference (cm) (g=21, c=3, s=a)  Fig. 5.20 Median Filtered Acoustic Scatter Mapping of the Small Edge Model  230  240  ^  65 6 CONCLUSIONS  6.1 Summary  The described acoustic scatter-mapping system was significant for its accuracy, resolution, speed and low cost, relative to other acoustic scatter-mapping systems. The use of a cross-correlated swept-frequency source signal similar to that used in seismology and radar was novel in the area of acoustic scatter-mapping in air. The system was able to generate scattermappings, in less than five hours, with sufficient accuracy to distinguish between diffractionreflection pairs less than a wavelength apart. Plotting routines for a Postscript laser printer were written as well to make a truly stand-alone system. This acoustic scatter-mapping system, while significant in itself, presents further opportunities for a number of large and small data acquisition and image processing projects. The intent of the original system development was not the definitive acoustic scatter-mapping system, but, rather, a system which demonstrated the improvement possible using a well chosen crosscorrelated swept-frequency source signal in the particular application of acoustic scattermapping within the given constraints oftime,cost, resolution, and flexibility.  6.2 Areas for Future Development  The images acquired to date have shown the realization of our early goals. But further progress is possible without significant redirection, and we look forward to seeing some of these improvements implemented. The simple median filter described in Section 3.3 was useful in enhancing the visibility of diffractions by limiting the influence of reflections from horizontally continuous returns. Further processing, using other common geophysical processing techniques, greatly simplified by the availability of the finished data in a standard geophysical format, may also be applied to  66 the acquired data, either during acquisition or post-acquisition, to further enhance the desired features of the data or test geophysical processing, interpretation, and inversion techniques. The resolution of this system presents several opportunities for improvement. With respect to source signal calculation and generation, and received signal acquisition and processing, the system may be seen as extremely accurate, owing, predominantly, to the resolution and speed of the computer and data acquisition card. The translation of the source signal from electrical to acoustic and received signals from acoustic to electrical is also reliable. The greatest weakness of the system, with regard to accuracy, lies in its locational accuracy. That is, the positioning of the loudspeaker, microphone, and target structure with respect to the target region and to each other. This positioning problem might be reduced, but never eliminated, by using additional devices to locate each of the aforementioned objects in three dimensions. But even this would not be enough - the loudspeaker and microphone radiation patterns would have to be accurately mapped and their acoustic centers pinpointed. The trolley and overhead rail would require replacement as well. The floor on which the target structures rest is neither level nor smooth. This also should be corrected, as should the location of the walls responsible for the wall reflections seen in Figs. 5.4 and 5.5. Certainly, the possibilities are numerous. The system was sufficient to demonstrate viable techniques and useful results within the limits of their resolution. Further enhancements would improve the system but should be undertaken with an understanding of the system as a whole. The addition of an elaborate locational system would be of little benefit without an adequate control system to position the transducers and the software to operate it. After the signal received from the microphone had been digitized, it was crosscorrelated with a reference signal to produce the finished data set. This reference signal was acquired in such a manner to expect that it was a near-perfect representation of a zero-phase signal as would be collected from a pure reflection. The indicator of a reflection in the finished data set was, therefore, a zero-phase autocorrelation of the zero-phase reference signal. The indicator of a signal returning at 45 or 225 degrees, i.e., a diffraction, was, similarly, a 45 or 225 degree autocorrelation, respectively, of the zero-phase reference signal. A question which arose  67 concerning this point was whether one could, by crosscorrelating the finished data set with an nphase autocorrelation of the zero-phase reference signal, automatically locate the position and amplitude of n-phase signals in the finished data set. This technique may have potential as an automated method for locating diffractions in acquired data, and, by further processing using an automated method, map some of the features responsible for the diffractions. At the completion of this project, this acoustic scatter-mapping system was capable of acquiring useful datafrommodels varying in the y and z dimensions so long as they were continuous in the x dimension. Expansion of the present trolley to reposition the transducers in both x and y dimensions would facilitate the acquisition of useful data in three dimensions. The implementation of this improvement would also require significant changes in the manner in which the acquired data would be processed and plotted. The most gratifying improvement in this system would be the use of it to map the scattering due to specific models. This aspect has, to some extent, been taken advantage of already, but opportunity awaits to make fuller use of the system potential.  68  REFERENCES [1] F J . Hilterman, "Three-Dimensional Seismic Modeling," Geophysics, vol. 35, pp.1020-1037, December 1970. [2] F.A. Angona, "Two-Dimensional Modeling and its Application to Seismic Problems," Geophysics, Vol. 25, pp. 468-482,1960. [3] F. Rieber, "Complex Reflection Patterns and Their Geologic Sources," Geophysics, vol. 2, pp. 132-160,1937. [4] S. Kamal and K.K. Sekharan, "Recent Improvements to the Physical Modeling System," Semi-annual Progress Review: April 1983, Houston: Seismic Acoustics Laboratory, University of Houston, April 1983. [5] D. Khosla and G.H.F. Gardner, "Vibroseis Data Acquisition in the Modeling Tank," Semiannual Progress Review: April 1983, Houston: Seismic Acoustics Laboratory, University of Houston, April 1983. [6] B.B. Narod and M.J. Yedlin, "A Basic Diffraction Experiment for Demonstrating the Geometrical Theory of Diffraction," American Journal of Physics, vol. 54, pp. 11211126, December 1986. [7] A.V. Oppenheim and R.W. Schafer, Digital Signal Processing, Englewood Cliffs, New Jersy: Prentice-Hall, 1975. [8] M J . Yedlin, LF. Jones and B.B. Narod, "Application of the Karhunen-Loeve Transform to Diffraction Separation," IEEE Transactions on Acoustics, Speech and Signal Processing, vol. Aspp-35, pp. 2-8, January 1987. [9] D. Davis and C. Davis, Sound System Engineering, Indianapolis, Indiana: Howard W. Sams & Co., 1975. [10] L.E. Kinsler et al. Fundamentals of Acoustics, New York: John Wiley & Sons, 1982. n i l A.W. Trorey, "A Simple Theory for Seismic Diffractions," Geophysics, vol 35, pp. 762784, 1970. [12] J.M. Crawford, W.E.N. Doty and M.R. Lee, "Continuous Signal Seismograph," Geophysics, vol. 25, pp. 95-105, February 1960. [13] J.R. Klauder, A.C. Price, S. Darlington and W.J. Albersheim, "The Theory and Design of Chirp Radars," Bell System Technical Journal, vol. 39, pp. 745-808. [ 14] W.H. Press et al., Numerical Recipes in C: The Art of Scientific Computing, New York: Cambridge University Press, 1988. [15] O. Koefoed, "Aspects of Vertical Seismic Resolution," Geophysical Prospecting, vol. 29, pp. 21-30,1981. [16] P.L. Goupillaud, "Signal Design in the Vibroseis Technique," Geophysics, vol. 41, pp. 1291-1304, December 1976.  69 [17] D.R. Dalton and M J . Yedlin, "Time Domain Solutions for Diffraction of Acoustic Waves by a Half Plane," Surveys in Geophysics vol. 11, (to be published). [18] Q. Zhang and E.V. Jull, "Pulse Diffraction by a Step Discontinuity," IEEE Antennas and Propagation Society International Symposium, pp. 146-149, June 1988.  [18] Q. Zhang and E.V. Jull, "Acoustic Pulse Diffraction by Step Discontinuities on a Plane," Geophysics, June 1990. [19] Q. Zhang and E.V. Jull, "Acoustic Pulse Diffraction by a Curved Half Plane," 1989 URSI International Symposium on Electromagnetic Theory, Stockholm, pp. 263-265, August 1989.  70  BIBLIOGRAPHY A. Berry, "Controlled Experiments of the Diffraction of Sound by a Curved Surface," Journal of the Acoustical Society of America, vol. 83, pp. 2047-2058,1988.  V. Cerveny and R. Ravindra, Theory of seismic head waves, Toronto: University of Toronto Press, 1971. C. B. Chinoy and P.T. Lewis, "Acoustical Signal Processing: FFT Convolution and Deconvolution," Acoustics Letters, vol. 8, pp. 120-127,1985. J.F. Claerbout, Fundamentals of Geophysical Data Processing: With Applications to Petroleum •  Prosepecting, New York: McGraw-Hill, 1976. W.H. Dragoset, "Marine Vibrators and the Doppler Effect," Geophysics, vol. 53, pp. 1388-1398, 1988. B. M. Gurbuz, "Signal Enhancement of Vibratory Source Data in the Presence of Attenuation," Geophysical Prospecting, vol. 20, pp. 421-438,1972.  F J . Hilterman, "Amplitudes of Seismic Waves - A Quick Look," Geophysics, vol. 40, pp. 745762,1975. F J Hilterman, "Seismic Imaging," Acoustic Imaging: Visualtization and Characterization:  Volume 9, New York: Plenum Press, 1980.  G.M. Hoover, "Acoustical Holography using Digital Processing," Geophysics, vol. 37, pp. 1-19, 1972. F.K. Levin and H.C. Hibbard, "Three Dimensional Seismic Model Studies," Geophysics, vol. 20, pp. 19-32,1955. A.F Linville and M.A. Dablain, "A Case Study in Seismic Diffraction Near a Gulf Coast Salt Dome," Geophysics, vol. 50, pp. 1077-1082,1985. L . A . Mayer, and L.R. LeBlanc, "The Chirp Sonar: A New, Quantitative High Resolution SubBottom Profiling System," Pace, N.G. Ed., Acoustics and the Sea Bed, Bath: Bath University Press, 1983. D. R. Pant and S.A. Greenhalgh, "Lateral Resolution in Seismic Reflection - a Physical Model Study" Geophysical Journal,\o\97,pp.  187-198,1989.  A. Paul and M. Campillo, "Diffraction and Conversion of Elastic Waves at a Corrugated Interface," Geophysics, vol. 53, pp. 1415-1424,1988. L.R. Rabiner and R.W. Schafer, Digital Processing of Speech Signals, Englewood Cliffs, New Jersy: Prentice-Hall, 1978. E. Reitsch, "Computerized Analysis of Vibroseis Signal Similarity," Geophysical Prospecting, vol. 25, pp. 541-552,1977. E. Reitsch, "Vibroseis Signals With Proscribed Power Spectrum," Geophysical Prospecting, vol. 25, pp. 613-620,1977.  71 R.A. Roberts and C T . Mullis, Digital Signal Processing, Reading, Massachusetts: AddisonWesley, 1987. T.D. Rossing, The Science of Sound, Reading, Massachusetts: Addison Wesley Publishing Co., 1982. S.G. Schock, L.R. LeBlanc and L.A. Mayer, "Chirp Subbottom profiler for Quantitative Sediment Analysis," Geophysics, vol. 54, pp. 445-450,1989. H. Taub and D.L. Schilling, Principles of Communication Systems, 2nd Ed., New York: McGraw-Hill Book Company, 1986. M.J. Yedlin and D.R. Dalton, Diffraction Coefficient Formulation of an Exact Solution for Acoustic Diffraction by a Half Plane,  72  APPENDIX A Software Used by This System  The software used in operation of the system included the following programs, the source code of which follows these descriptions.  Dotplot.c - This program collects information from the operator in a question and answer format and uses this information to print the specified image on a Roland PR-1112 (72 dpi) dot matrix printer.  Ecko.asm - This subroutine expects a pointer to and the size of an array of integer data. The specified array is copied to the digital to analogue convertor on the data acquisition card.  Flotuintx - This program will convert a designated floating point binary format file, as produced by Multrace.c, to a designated unsigned integer binary format file, as used by all other system software.  Lasrplotc - This program collects information from the operator in a question and answer format and uses this information to generate a Postscript file containing a plot of the specified image. The Postscript file is normally sent, by the operator, to a (300 dpi) laser printer.  Median3.c - This program will three-point space-median filter a designated source image, string the result in the designated destination file.  Multrace.c - This is the heart of the system. It uses Ecko.asm to send out the source signal, collects the returning signal, moves the trolley, crosscorrelates the collected data with a reference signal and stores the result in the designated file.  73 Sourtran.c - This program will send out a source signal, collect the returning signal, and store the collected signal as the system reference signal.  Uintasci.c - This program will convert a designated unsigned integer binary format file to a designated ASCII format file.  Wavegen.c - This program will, based on the constants stored in it, calculate a source signal and store it as the system source signal file.  74 /* d o t p l o t . c */ /****************************************************/ /* /* /* /*  DOT m a t r i x P L O T t i n g r o u t i n e s by G a r f i e l d Mellema November 16, 1988  */ */ */ */  /* */ /****************************************************/ /* /* /* /* /* /*  */ T h i s program w i l l , a f t e r a s k i n g t h e u s e r a */ few r e l e v a n t q u e s t i o n s , p r i n t d a t a r e a d from */ a specified f i l e . The d a t a i n t h e f i l e must */ be a r r a n g e d i n c o n s e c u t i v e b l o c k s o f e q u a l , */ s p e c i f i e d l e n g t h . The b l o c k s a r e p r i n t e d as */  /* /* /* /* /* /* /* /* /* /* /*  a s e r i e s o f l i n e graphs, each b l o c k a new */ line. The l i n e graph l e n g t h s a r e s c a l e d , as */ much as p o s s i b l e , t o f i l l a p r i n t e r l i n e . */ T i t l e s may be i n c l u d e d between t h e b l o c k s */ and w i l l be p r i n t e d on t h e s c r e e n as t h e */ block i s being read. A t i t l e may be p r i n t e d */ a t t h e t o p o f t h e graphs. Portions of the */ d a t a b l o c k s may be s k i p p e d over, as w e l l as */ g r o u p s o f d a t a b l o c k s . The graphs a r e */ normalized e i t h e r i n d i v i d u a l l y or g l o b a l l y , */ and t h e i r maximum a m p l i t u d e i s s p e c i f i e d */  /* */ /****************************************************/ • i n c l u d e <stdio.h> • i n c l u d e <math.h> unsigned unsigned unsigned  c h a r l i n e s [14][16384]; i n t newdata[16384]; i n t twopow[2][9] = {{1, 3, 7, 15, 31, 63, 127, 255, 255}, {1, 2, 4, 8, 16, 32, 64, 128, 0}};  v o i d main () { double zero; f l o a t minamp, maxamp, globemin, globemax, s c a l e ; i n t i , j , k, 1, linenumb[16], t r a c l e n g , tracnumb, traceamp; i n t n e w l i n e [ 5 ] , s k i p l e n g , endleng, s k i p t r a c , base, b s c a l e , e s c a l e ; char t i t l e [ 1 0 0 ] , filename[80], i f s c a l e [ 5 ] , g l o s c a l e [ 5 ] ; FILE * f i ; printf printf printf printf printf  ("\nMultiple t r a c e p l o t t i n g software"); ("\nwritten by G a r f i e l d Mellema (November 16, 1988)"); ("\n\nThis program w i l l r e a d u n s i g n e d i n t e g e r d a t a (0-65535) from " ) ; ("a s p e c i f i e d \ n b i n a r y f i l e and p l o t t h e d a t a as a s e r i e s o f " ) ; ("adjacent t r a c e s on a\nRoland PR-1112 (or e q u i v a l e n t ) p r i n t e r . " ) ;  p r i n t f ("\n\nEnter t h e name o f t h e s o u r c e d a t a f i l e \ n " ) ; s c a n f ("%s", f i l e n a m e ) ; p r i n t f ("How many p o i n t s a r e i n e a c h t r a c e (maximum i s 16384)?\n"); s c a n f ("%d", S t r a c l e n g ) ; i f ( t r a c l e n g > 16384) printf  t r a c l e n g = 16384; ("The f i r s t p o i n t r e a d w i l l be number 0.");  p r i n t f (" B e g i n p l o t t i n g a t p o i n t number?\n"); s c a n f ("%d", S s k i p l e n g ) ; i f ( s k i p l e n g > t r a c l e n g - 1 || s k i p l e n g < 0) s k i p l e n g = 0; p r i n t f ("Stop p l o t t i n g a t p o i n t number?\n"); s c a n f ("%d", Sendleng); i f (endleng > t r a c l e n g - 1 || e n d l e n g < s k i p l e n g ) e n d l e n g = t r a c l e n g - 1; p r i n t f ("How many t r a c e s a r e i n t h e f i l e ? \ n " ) ; s c a n f ("%d", Stracnumb) ; p r i n t f ( " P r i n t e v e r y 'n'th t r a c e . What i s 'n'?\n"); s c a n f ("%d", S s k i p t r a c ) ; p r i n t f ("How many a d d i t i o n a l t r a c e s s h o u l d t h e maximum p o s i t i v e v a l u e " ) ; p r i n t f ("\nof e a c h t r a c e o v e r l a p ? The maximum number i s 3.\n"); s c a n f ("%d", Straceamp); i f (traceamp > 3) traceamp = 3; i f (traceamp < 0) traceamp «= 0; p r i n t f ("Do you want p o s i t i v e s h a d i n g ? (Y/N)\n"); s c a n f ("%s", g l o s c a l e ) ; if  ( g l o s c a l e [ 0 ] !•=> 'Y' && g l o s c a l e [ 0 ] != f o r (i=0; i<=8; i++) twopow[0][i] = t w o p o w [ l ] [ i ] ;  'y'){  } f p u t c (27, s t d p r n ) ; /* i n i t i a l i z e */ f p u t c (64, s t d p r n ) ; /* t h e p r i n t e r */ f p u t c (27, s t d p r n ) ; /* s e t i t f o r */ f p u t c (77, s t d p r n ) ; /* e l i t e t y p e */ p r i n t f ("Do you w i s h t o p r i n t a t i t l e above t h e p l o t ? (Y/N)\n"); s c a n f ("%s", g l o s c a l e ) ; i f ( g l o s c a l e [ 0 ] «== 'Y' II g l o s c a l e [ 0 ] == 'y'){ p r i n t f ("Enter t h e t i t l e as you want i t p r i n t e d . To s t o p p r i n t i n g ") p r i n t f ("the t i t l e \ n b e g i n a l i n e w i t h . \ n " ) ; gets ( t i t l e ) ; f p u t c (27, s t d p r n ) ; /* s e t t h e p r i n t e r f o r */ f p u t c (97, s t d p r n ) ; /* c e n t e r e d p r i n t i n g */ f p u t c (1, s t d p r n ) ; do { gets ( t i t l e ) ; i f ( t i t l e [0] !=• " " ) f p r i n t f ( s t d p r n , "%s\n", t i t l e ) ; ) w h i l e ( t i t l e [ 0 ] != ' ) ; f p u t c (27, s t d p r n ) ; /* s e t t h e p r i n t e r t o b e g i n */ f p u t c (97, s t d p r n ) ; /* p r i n t i n g a t t h e l e f t margin */ A  ,  fputc  A  (0, s t d p r n ) ;  } p r i n t f ("Do you want t o p r i n t a s c a l e above t h e p l o t ? (Y/N)\n"); s c a n f ("%s", i f s c a l e ) ; p r i n t f ("Each t r a c e i s i n d i v i d u a l l y n o r m a l i z e d . Do you p r e f e r g l o b a l " ) ; p r i n t f ("scaling? (Y/N)\n">; s c a n f ("%s", g l o s c a l e ) ; globemax = -1; g l o b e m i n = 65536; f i •= f o p e n ( f i l e n a m e , "rb") ; i f ( f i == NULL){ p r i n t f ("\n*********** f i l e opening e r r o r *******************");  76 exit } if  (0);  (gloscale[0] — ' Y' II g l o s c a l e [ 0 ] ~ 'y'){ p r i n t f ("Begin s c a l i n g a t p o i n t number?\n"); s c a n f ("%d", S b s c a l e ) ; p r i n t f ("End s c a l i n g a t p o i n t number? \ n " ) ; s c a n f ("%d", S e s c a l e ) ; p r i n t f ("\nBegin s c a l i n g \ n " ) ; f o r (i=0; i<tracnumb; i++){ p r i n t f ( " S c a l i n g t r a c e number %6d", i ) ; p u t c h (13); f r e a d (newdata, s i z e o f (unsigned i n t ) , t r a c l e n g , f i ) ; /* r e a d i n t h e d a t a from t h e s p e c i f i e d f i l e and f i n d i t s minimum  */ for  (j="bscale; j o e s c a l e ; j++) { /* and maximum */ globemax — (globemax>newdata[j]) ? globemax : n e w d a t a [ j ] ; globemin = (globemin<newdata[j]) ? globemin : n e w d a t a [ j ] ;  >  } rewind ( f i ) ; p r i n t f ("\nFinished s c a l i n g " ) ; p r i n t f ("\nglobemax i s %6.0f", globemax); p r i n t f ("\nglobemin i s %6.0f", g l o b e m i n ) ;  } f p r i n t f (stdprn, "\n"); f o r (i=0; i<14; i++){ p l o t t i n g a r r a y */ f o r (j=0; j<16384; j++) l i n e s [ i ] [ j ] ~ 0;  /* e r a s e t h e  trace  } for  n/216  (i=0; i<16; i++) linenumbfi] - i ; f p u t c (27, s t d p r n ) ; i n c h */ f p u t c (51, s t d p r n ) ; f p u t c (24, s t d p r n ) ; n e w l i n e [ 0 ] •= 27;  mode */ newline[1] =42;  /*  set paper feed  to  /* where n = 24 */ /* B i t image /* c a l i b r a t e d f o r 5 usee sampling  a t 331  m/s  */ f p r i n t f ( s t d p r n , "\n%41s DISTANCE (mm)\n", " " ) ; i f (endleng - s k i p l e n g < 464){ graphics */ p r i n t f ("\n465 d p i g r a p h i c s \ n " ) ; i f ( i f s c a l e t O ] — 'Y' II i f s c a l e [ 0 ] •== 'y'){  /* s t a n d a r d  density  /* p r i n t a s c a l e above  */ fprintf  (stdprn,"\n  0  fprintf  (stdprn,"  207  41  83  124  166  "); 372\n");  line  290  331  } n e w l i n e [ 2 ] = 0;  per  248  */  n e w l i n e [ 3 ] = ( e n d l e n g - s k i p l e n g + 1 ) % 256; n e w l i n e [ 4 ] = ( e n d l e n g - s k i p l e n g + 1 ) / 256;  /* maximum 465 /* s e t t h e number o f d o t s /* p r i n t e d p e r  line  /* e n d l e n g - s k i p l e n g + 1  */  dots  */ to  77 e l s e i f ( e n d l e n g - s k i p l e n g < 929){ p r i n t f ("\n930 d p i g r a p h i c s \ n " ) ; i f ( i f s c a l e [ 0 ] — ' Y' II i f s c a l e f O ]  /* d o u b l e d e n s i t y g r a p h i c s = 'y'){  */  /* p r i n t a s c a l e above  */ fprintf  (stdprn,"\n  0  fprintf  (stdprn,"  414  83  166  248  331  "); 497  579  662  745\n")  } n e w l i n e [ 2 ] = 1; /* maximum 930 d o t s p e r l i n e */ n e w l i n e [ 3 ] = (endleng-skipleng+1) % 256; /* s e t t h e number o f d o t s */ n e w l i n e [ 4 ] = ( e n d l e n g - s k i p l e n g + 1 ) / 256; /* p r i n t e d p e r l i n e t o */ } /* e n d l e n g - s k i p l e n g + 1 */ else{ graphics */  /* quad printf  density  ("\nl860 d p i g r a p h i c s W ) ; /* p r i n t a s c a l e  above  if  */  ( i f s c a l e t O ) -= 'Y' II i f s c a l e [ 0 ) —  ");  fprintf  (stdprn,"\n  0  1490\n");  fprintf  (stdprn,"  828  'y'){ 331  497  1159  1324  662  166 993  } newline[2] = 3 ; /* maximum 1860 d o t s p e r l i n e */ i f (endleng - s k i p l e n g > 1859) e n d l e n g «• s k i p l e n g + 1859; n e w l i n e [ 3 ] = ( e n d l e n g - s k i p l e n g + 1 ) % 256; /* s e t t h e number o f d o t s */ n e w l i n e [ 4 ] = ( e n d l e n g - s k i p l e n g + 1 ) / 256; /* p r i n t e d p e r l i n e t o t h e */ ) /* t h e l e s s e r o f 1872 and e n d l e n g - s k i p l e n g + 1 */ if  (ifscale[0]  | ifscale[0] ~  *y'){  /* p r i n t a s c a l e above  */ f p u t c ( 27, s t d p r n ) ; i f d e s i r e d */ f p u t c ( 42, s t d p r n ) ; the p r i n t e r f o r double */ f p u t c ( 1, s t d p r n ) ; d e n s i t y bit-mapped g r a p h i c s */ f p u t c (192, s t d p r n ) ; d o t s p e r l i n e */ f p u t c ( 3, s t d p r n ) ; f o r (i=0; i<2 9; i++) /* t h e p l o t ,  for  f p u t c (0, s t d p r n ) ; (i=0; i<18; i++){ f p u t c (255, s t d p r n ) ; f o r (j=0; j<4; j++){ f o r (k=0; k<4; fputc  •/* s e t /* /* 960  p r i n t a s c a l e */  k++)  f p u t c ( 1, s t d p r n ) ; (15, s t d p r n ) ;  ) for  (k=0; k<4; k++) f p u t c ( 1, s t d p r n ) ; f p u t c (63, s t d p r n ) ; f o r (j=0; j<4; j++){ f o r (k=0; k<4; k++) f p u t c ( 1, s t d p r n ) ;  78 fputc  (15, s t d p r n ) ;  } for  (k=0; k<4; k++) f p u t c ( 1, s t d p r n ) ;  }  f p u t c (255, s t d p r n ) ; f o r (j=0; j<4; j++){ f o r (k=0; k<4; k++) f p u t c ( 1, s t d p r n ) ; f p u t c (15, s t d p r n ) ; } for  (k=0; k<4; k++) f p u t c ( 1, s t d p r n ) ; f p u t c (63, s t d p r n ) ; f o r (k=0; k<4; k++) f p u t c ( 1, s t d p r n ) ; f p u t c (15, s t d p r n ) ; } for t r a c e s */  (k=l; k<=tracnumb; k++){  /* s t a r t  p r i n t f ("Reading t r a c e number %6d p u t c h (13); f r e a d (newdata, s i z e o f ( u n s i g n e d i f (k % s k i p t r a c == 0){ for  (i=0; i<16384;  , k);  reading  /* r e a d i n t h e d a t a */  i n t ) , tracleng, f i ) ;  i++) {  /* e r a s e t h e  new bottom l i n e s */ lines[linenumb[12]][i] lines[linenumb[13]][i]  = 0; = 0;  } minamp = globemin; /* r e s e t t h e minimum and */ maxamp = globemax; •/* maximum d a t a v a l u e s */ z e r o «• 0; f o r ( j = s k i p l e n g ; j<=endleng; j++){  /* f i n d t h e maximum  and */  /* minimum d a t a  values  */  maxamp •> (maxamp>newdata[j]) ? maxamp : n e w d a t a [ j ] ; minamp = (minamp<newdata[j]) ? minamp : n e w d a t a [ j ] ; z e r o += n e w d a t a [ j ] ;  } zero  /= e n d l e n g - s k i p l e n g ;  /* f i n d t h e average  d a t a v a l u e */ if  (maxamp - z e r o > z e r o -.minamp) minamp = 2 * z e r o - maxamp;  /* and  s c a l e t h e d a t a t o */ else /* c e n t e r on t h a t v a l u e */ maxamp = 2 * zero - minamp; /* s c a l e t h e data t o fit  t h e d e s i r e d bounds */ s c a l e " (16 + 32 * traceamp)  * 0.995 / (1.0 + maxamp - minamp); /* c e n t e r t h e  s c a l e d d a t a i n t h e bounds */ base = 16 * (3 - t r a c e a m p ) ; f o r ( i = s k i p l e n g ; i<=endleng; i++){  79 /* s c a l e t h e d a t a t fill  t h e a v a i l a b l e a r e a */ newdata[i]=(unsigned  int)((newdata[i]-minamp)*scale+base);  } for  ( i = s k i p l e n g ; i O e n d l e n g ; i++) { i f (newdata[i] > 103){ t h i s i s t h e z e r o e t h l i n e */ lines[linenumb[0]][i] 104)]; lines[linenumb[l] [i] lines[linenumb[2] lines[linenumb[3]  [i] [i]  1ines[1inenumb[4]  [i]  lines[linenumb[5]  [i] [i]  lines[linenumb[6]  /* |= t w o p o w [ 0 ] [ ( i n t ) ( n e w d a t a [ i ] |= twopow[0] [ 8 ] ; I= twopow[0] [ 8 ] ; I — twopow[0][8]; | •» twopow [ 0 ] [8]; | «• twopow [ 0 []8 ] ; I= twopow[0] [ 8 ] ;  } { the f i r s t  l i n e */  /* t h i s i s  e l s e i f (newdata[i] > 95 [i]  |= twopow[0][ ( i n t ) (newdata[i]  lines[linenumb[2] lines[linenumb[3] lines[1inenumb[4]  [i] [i] ti]  lines[linenumb[5] lines[1inenumb[6]  [i]  |•= twopow[0] [ 8 ] ; I= twopow[0] [ 8 ] ; |= twopow[0] [ 8 ] ; |= twopow[0] [ 8 ] ; |— twopow[0] [ 8 ] ;  1ines[1inenumb[1]  96) ] ;  ti]  } e l s e i f (newdata[i] > 87  /* t h i s i s  t h e second l i n e */ lines[linenumb[2]  [i]  |~ t w o p o w [ 0 ] [ ( i n t ) ( n e w d a t a [ i ]  lines[linenumb[3] lines[linenumb[4] 1ines[1inenumb[5] lines[linenumb[6]  [i] ti] [i] [i]  |I|° |=  88) ] ; twopow[0][8] twopow[0][8] twopow[0][8] twopowfO][8]  ) e l s e i f (newdata[i] > 79 { the t h i r d  /* t h i s i s  l i n e */ lines[linenumb[3]  [i]  twopow[0][ ( i n t ) (newdata[i]  80) ] ; lines[1inenumb[4] [i] l i n e s [linenumb[5] [ i ] lines[1inenumb[6] [i]  |= twopow[0][8] |= twopow[0][8] |= twopow[0][8]  ) e l s e i f (newdata[i] > 71 {  /* t h i s i s  t h e f o u r t h l i n e */ lines[linenumb[4]  [i]  |- twopow[0] [ ( i n t ) (newdata[i]  1ines[1inenumb[5] lines[linenumb[6]  [i] [i]  |= twopow[0][8]; |= twopowfO][8];  72) ] ;  e l s e i f (newdata[i] > 63 { the f i f t h  /* t h i s i s  l i n e */ lines[linenumb[5]  [i]  |= twopow[0][ ( i n t ) (newdata[i]  1ines[1inenumb[6]  [i]  |= twopow[0][8];  64) ] ;  )  80 e l s e i f (newdata[i] > 55)  /* t h i s i s  t h e s i x t h l i n e */ lines[linenumb[6]][i]  |= twopow[0][ ( i n t ) (newdata[i] -  56) ] ; e l s e i f (newdata[i] > 47)  /* t h i s i s  t h e s e v e n t h l i n e */ lines[linenumb[7]][i]  |= t w o p o w [ l ] [ ( i n t ) ( n e w d a t a f i ]  -  48) ] ; e l s e i f (newdata[i] > 39) the eighth  /* t h i s i s  l i n e */ lines[linenumb[8]][i]  |= t w o p o w [ 1 ] [ ( i n t ) ( n e w d a t a [ i ] -  40)]; e l s e i f (newdata[i] > 31) the nineth  /* t h i s i s  l i n e */ lines[linenumb[9]][i]  |= t w o p o w [ 1 ] [ ( i n t ) ( n e w d a t a [ i ] -  32)]; e l s e i f (newdata[i] > 23)  /* t h i s i s  t h e t e n t h l i n e */ lines[linenumbflO]][i]  |= t w o p o w [ l ] [ ( i n t ) ( n e w d a t a [ i ]  - 24)]; e l s e i f (newdata[i] > 15) eleventh  /* t h i s i s t h e  l i n e */ lines[linenumb[11]][i]  |= twopow[l] [ ( i n t ) (newdata[i]  - 16)]; e l s e i f (newdata[i] > 7)  /* t h i s i s t h e  t w e l f t h l i n e */ lines[linenumb[12]][i]  |= t w o p o w [ l ] [ ( i n t ) ( n e w d a t a [ i ]  - 8)]; else /* t h i s i s t h e t h i r t e e n t h l i n e */ lines[linenumb[13]]  [i] = twopow[1][(int)newdata[i]] ,  }  Carriage  /* p l o t t h e next d a t a t r a c e */ f p u t c (13, s t d p r n ) ;  /*  fputc  /*  R e t u r n */ (10, s t d p r n ) ;  L i n e F e e d */ i f (k > p r i n t t h e t r a c e number */  /*  (3 * s k i p t r a c ) )  fprintf  (stdprn,  "%3u",  (k-3*skiptrac));  else f p r i n t f (stdprn, f o r (j=0; j<-4; j++) /* p r e p a r e t o p r i n t t h e f i r s t */ fputc  "  (newline[j],  ");  /* h a l f  stdprn);  line  o f t h e p l o t */ for  ( l = s k i p l e n g ; K e n d l e n g + 1 ; 1++) fputc (lines[linenumb[0]][1], f p u t c (13, s t d p r n ) ; Carriage  stdprn); /*  R e t u r n */ fputc  (10, s t d p r n ) ;  L i n e Feed */ f p r i n t f (stdprn, " " ) ; f o r (j=0; j<=4; j++) /* p r e p a r e t o p r i n t t h e second */  /*  81 fputc of the p l o t  (newline[j], stdprn);  /* h a l f  line  */ for  (l=skipleng; Kendleng+1; 1++) f p u t c ( l i n e s [ l i n e n u m b [ l ] ] [1], linenumb[14] = l i n e n u m b [ 0 ] ; linenumb[15] - l i n e n u m b [ l ] ;  stdprn); /* s c r o l l up t h e  line  numbers */ for  (i=0; i<14; i++) l i n e n u m b [ i ] — 1inenumb[i+2];  }  ) for  (i=0; i<12; i+=2){ f p u t c (13, s t d p r n ) ; /* C a r r i a g e R e t u r n */ f p u t c (10, s t d p r n ) ; /* L i n e Feed */ i f ( i < 6 && ( 2 - t r a c n u m b / s k i p t r a c ) < i / 2 ) f p r i n t f ( s t d p r n , "%3u", s k i p t r a c * ( ( ( k - 1) / s k i p t r a c ) + i / 2 2)); else /* p r i n t t h e t r a c e number */ f p r i n t f (stdprn, f o r (j=0; j<=4; j++)  "  "); /* p r e p a r e t o p l o t a l i n e  */  fputc (newline[j], stdprn); f o r ( l = s k i p l e n g ; K e n d l e n g + 1 ; 1++) /* p l o t t h e f i r s t h a l f l i n e */ fputc (lines[linenumb[i]][1], stdprn); f p u t c (13, s t d p r n ) ; /* C a r r i a g e R e t u r n */ f p u t c (10, s t d p r n ) ; /* L i n e Feed */ f p r i n t f (stdprn, " "); f o r (j=0; j<=4; j++) /* p r e p a r e t o p l o t a l i n e */ fputc (newline[j], stdprn); f o r ( l = s k i p l e n g ; K e n d l e n g + 1 ; 1++) /* p l o t t h e second h a l f l i n e */ fputc (lines[linenumb[i+1]][1], stdprn);  ) f p u t c (13, s t d p r n ) ; C a r r i a g e R e t u r n */ f p u t c (12, s t d p r n ) ; Form  }  /*  Feed */  fputc reinitialize fputc */  /*  (27, s t d p r n ) ; */ (64, s t d p r n ) ;  /* /*  the p r i n t e r  * ecko.asm *  ******************************************************  *  *  * * *  ECKO waveform g e n e r a t i o n f u n c t i o n by G a r f i e l d Mellema September 28, 1988  * * *  * * ****************************************************** * * * * * * * * * * * * * *  T h i s program w i l l r e a d d a t a v a l u e s from a s p e c i f i e d a r r a y and send t h o s e v a l u e s t o t h e DAC on t h e Computerscope c a r d i n s t a l l e d i n computer. The program w i l l a l s o i n i t i a l i z e , t r i g g e r t h e aforementioned card t o begin c o l l e c t i n g d a t a as s p e c i f i e d by t h e c a l l i n g program. The c a l l i n g program must c a l l t h i s f u n c t i o n with both a f a r p o i n t e r t o the f i r s t i n t e g e r i n t h e a r r a y , and t h e number o f v a l u e s t o be s e n t s e q u e n t i a l l y from t h e a r r a y t o t h e DAC.  * * * * * * * * * * * *  ****************************************************** ECKO_TEXT assume _ecko push mov push push push push mov mov mov mov out mov cii wordout: mov out inc inc dec jnz sti pop pop pop pop pop ret _ecko public  segment byte cs:ECKO TEXT proc far bp bp. sp ds bx cx dx ds. word p t r bx, word p t r cx. word p t r dx, 781 dx. ax dx. 769  ax. tbx] dx. ax bx bx cx wordout dx cx bx ds bp endp _ecko  ECKO_TEXT ends end  public  'CODE'  ;save t h e o r i g i n a l l o c a t i o n o f t h e s t a c k ;pointer t o r e t r i e v e the c a l l i n g data ;save t h e o r i g i n a l c o n t e n t s o f r e g i s t e r s ;which may be a l t e r e d d u r i n g t h e f u n c t i o n [bp+8] [bp+6] [bp+10]  ; s e t t h e d a t a segment t o t h e a r r a y segment / l o c a t i o n o f s o u r c e waveform d a t a a r r a y ;number o f p o i n t s i n t h e a r r a y / t r i g g e r d a t a a c q u i s i t i o n system ;DAC p o r t a d d r e s s .•disable t h e i n t e r r u p t s w h i l e ; s e n d i n g out t h e source waveform ;get a number (two b y t e s ) from ;the a r r a y and send i t t o t h e DAC ;increment t h e a r r a y i n d e x f o r each b y t e /decrement t h e number o f b y t e s l e f t t o send / c o n t i n u e s e n d i n g numbers i f any remain ;re-enable t h e i n t e r r u p t s /return a l t e r e d registers /to t h e i r o r i g i n a l values  83 /* f l o t u i n t . c */ /*************************************************/ /* /* /*  a program t o c o n v e r t a s e t o f b i n a r y FLOaTing p o i n t data t o  /* /* /*  T h i s program w i l r e a d a f i l e o f f l o a t i n g p o i n t d a t a i n b i n a r y format and r e w r i t e  /*  it  /* /* /*  s o u r c e f i l e s p e c i f i e d i n t h e command l i n e i s assumed t o be 125 s e t s o f 1860 values. T h i s program was w r i t t e n f o r  /*  use w i t h t h e S y n t h e s e i s a c o u s t i c imaging system.  */ */  */ U n s i g n e d INTeger d a t a /* */ by G a r f i e l d Mellema (November 22, 1988) /* */ /* */ /*************************************************/  i n unsigned  i n t e g e r format.  The  V V */ */ */ */ */ */ */  /* /* */ /*************************************************/ /* */ max - minimum v a l u e o f t h e source d a t a /* */ min - maximum v a l u e o f t h e source d a t a /* */ s c a l e - s c a l e f a c t o r used t o f i t t h e /* */. d a t a i n t o t h e range 0 t o 65535 /* */ zero - median v a l u e o f t h e s o u r c e d a t a /* */ /* */ /*************************************************/ • i n c l u d e <stdio.h> float dataflot[1860]; unsigned i n t datauint[1860]; v o i d main int  (argc,  argv)  argc;  char  *argv[];  { double  max,  int i , j ; FILE * f i b , if  min,  scale;  *fob;  (argc < 3){ p r i n t f ("\nThe command l i n e format i s : \ n \ n " ) ; p r i n t f ("flotuint sourcefilename destinationfilename\n\n"); exit(0);  } printf printf  ("Source f i l e name i s % s \ n " , a r g v f l ] ) ; ( " D e s t i n a t i o n f i l e name i s %s\n", a r g v [ 2 ] ) ;  f i b = fopen ( a r g v [ l ] , " r b " ) ; fob = fopen ( a r g v [ 2 ] , "wb"); i f ( f i b •== NULL | | f o b == NULL) { p r i n t f ("*********** f i l e a c c e s s e r r r o r  **********••);  e x i t (0); } max  = -3.4e38;  /* determine  t h e range o f t h e s o u r c e d a t a */  84 min = 3.4e38; f o r (i=0; i<125; i++){ f r e a d ( d a t a f l o t , s i z e o f ( f l o a t ) , 1860, f i b ) ; f o r (j=0; j<1860; j++){ max = ( m a x > d a t a f l o t [ j ] ) ? max : d a t a f l o t [ j ] ; min *» ( m i n < d a t a f l o t [ j ] ) ? min : d a t a f l o t [ j ] ; } printf putch  ("Trace number %3d t e s t e d " , i ) ; (13);  } rewind ( f i b ) ; /* rewind t h e s o u r c e f i l e and s c a l e = 65535 / (max - min); /* determine a s c a l i n g f a c t o r p r i n t f ("\nFinished s c a l i n g " ) ; /* t o f i t t h e d a t a i n range p r i n t f ("\nmax i s %8g min i s %8g", max, min); p r i n t f ("\nscale i s %8g\n", s c a l e ) ; f o r (i=0; i<125; i++){ /* w r i t e a new d a t a f i l e f r e a d ( d a t a f l o t , s i z e o f ( f l o a t ) , 1860, f i b ) ; f o r (j=0; j<1860; j++){ d a t a u i n t [ j ] — (unsigned i n t ) ( ( d a t a f l o t [ j ] - min) * s c a l e ) ;  ) i f (fwrite(datauint, s i z e o f ( u n s i g n e d i n t ) , 1860, fob) != p r i n t f (<'\ ********** b i n a r y w r i t e e r r o r * * * * * * * * * * • • ) ; p r i n t f ("Trace number %3d c o n v e r t e d " , i ) ; p u t c h (13); n  }  fclose fclose  (fib); (fob);  1860)  */ */ */  */  85 /* l a s r p l o t . c */ /* /* /* /*  */ LASeR p r i n t e r P L O T t i n g program w r i t t e n by G a r f i e l d Mellema A p r i l 1, 1989  (.uib)  */ */  */ /* */ /************************************************/ /* /* /* /* /* /* /* /* /* /*  */ T h i s program w i l l p l o t S y n t h e s e i s d a t a on any P o s t s c r i p t p r i n t e r . I t asks a number o f q u e s t i o n s , w i t h r e s p e c t t o t h e d e s i r e d p l o t parameters, o f t h e u s e r and uses t h e responses t o generate t h e desired plot. The u s e r choose t o answer the questions i n t e r a c t i v e l y , or store the responses, i n order, i n a f i l e .  */ */ */ */ */ */  */ /***************************************************/ /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /*  base clip endpoint endscale *fid *fps gain globemax globemin globzero gloscale inipoint iniscale  -  */ - data t o p l o t o f f s e t value maximum t r a c e o v e r l a p c u t o f f the last plotted point i n a trace g l o b a l s c a l i n g end p o i n t p o i n t e r t o the source data f i l e pointer to postfile maximum c a l c u l a t e d t r a c e o v e r l a p maximum s o u r c e d a t a v a l u e minimum s o u r c e d a t a v a l u e mean s o u r c e d a t a v a l u e u s e g l o b a l s c a l i n g (Y/N) plotting start point global scaling start point  */ */ */ */ */ */ */ */ */ */ */ */  maxamp - maximum trace data value minamp - minimum t r a c e d a t a v a l u e numbtrac - number o f t r a c e s t o be p l o t t e d point - p r e s e n t d a t a p o i n t (x v a l u e ) shade - shade t e c h n i q u e ( p o s / n e g / a l l / w i g ) */ p o s t f i l e - d e s t i n a t i o n p o s t s c r i p t filename scale - data t o p l o t scale f a c t o r skiptrac - trace skip i n t e r v a l s o u r f i l e - source data f i l e title - the plot t i t l e t r a c l e n g - number o f p o i n t s i n each t r a c e x a x t i t l e - the x - axis t i t l e xmax - upper x l i m i t o f t h e p l o t page xmin - lower x l i m i t o f t h e p l o t page x s c a l e - x a x i s s c a l e f a c t o r (times 1/72") x s p a c e - s p a c i n g between a d j a c e n t x e v e n t s */ y a x t i t l e - the y - axis t i t l e ymax  - upper y l i m i t o f t h e p l o t page  */ */ */ */ */ */ */ */ */ */ */ */  86 /* /* /* /* /*  - lower y l i m i t o f t h e p l o t page y a x i s s c a l e f a c t o r (times 1/72") */ s p a c i n g between a d j a c e n t y e v e n t s */ - mean v a l u e o f the p r e s e n t t r a c e * /  ymin yscale yspace zero  */  /********************* •include  <stdio.h>  unsigned i n t sourdata[1860]; v o i d main () { c h a r g l o s c a l e [ 1 0 ] , shade[10], p o s t f i l e [ 8 0 ] , s o u r f i l e [ 8 0 ] ; char t i t l e [ 2 0 0 ] , x a x t i t l e [ 2 0 0 ] , y a x t i t l e [ 2 0 0 ] ; FILE * f i d , *fps; f l o a t base, globemax, globemin, g l o b z e r o , maxamp, minamp; f l o a t p o i n t , s c a l e , xscale, y s c a l e , zero; i n t i , j , k, c l i p , c o p i e s , e n d p o i n t , e n d s c a l e , g a i n , i n i s c a l e , i n i p o i n t ; i n t numbtrac, s k i p t r a c , t r a c l e n g , xmax, xmin, xspace, ymax, ymin, y s p a c e ; printf printf printf  ("\n\nLASeR p r i n t e r P L O T t i n g program f o r use w i t h t h e " ) ; ("\nSyntheseis a c o u s t i c imaging system"); ( " W r i t t e n by G a r f i e l d Mellema (March 31, 1989)");  printf ("\n\nThis program w i l l r e a d d a t a from a . u i b f i l e and"); p r i n t f ("\nprepare a P o s t s c r i p t f i l e t o p l o t i t on a l a s e r p r i n t e r " ) ; p r i n t f ("\nEnter t h e name o f t h e source d a t a f i l e A n " ) ; s c a n f ("%s", s o u r f i l e ) ; p r i n t f ("Enter t h e name o f t h e d e s t i n a t i o n p o s t s c r i p t f i l e . X n " ) ; s c a n f ("%s", p o s t f i l e ) ; p r i n t f ("How many p o i n t s a r e i n e a c h t r a c e (maximum 1860)?\n"); s c a n f ("%d", S t r a c l e n g ) ; i f ( t r a c l e n g > 1860 || t r a c l e n g < 1){ tracleng 1860; printf  ("\nA  trace length  o f 1860  points  was  assumed\n");  } p r i n t f ("The f i r s t p o i n t r e a d w i l l be number 0\n"); p r i n t f ("Start p l o t t i n g a t p o i n t number?\n"); s c a n f ("%d", S i n i p o i n t ) ; i f ( i n i p o i n t > t r a c l e n g || i n i p o i n t < 0){ i n i p o i n t = 0; p r i n t f ( " \ n P l o t t t i n g w i l l s t a r t a t p o i n t 0\n");  ) p r i n t f ("Plot up t o , and i n c l u d e , p o i n t number?\n"); s c a n f ("%d", S e n d p o i n t ) ; i f (endpoint > 1859 || e n d p o i n t < i n i p o i n t ) { e n d p o i n t - 1859; printf  ( " P l o t t i n g w i l l end  at p o i n t  1859\n");  } p r i n t f ("How many t r a c e s a r e i n t h e f i l e ? \ n " ) ; s c a n f ("%d", Snumbtrac); p r i n t f ("Skip e v e r y 'n'th t r a c e . What i s 'n'?\n">; s c a n f ("%d", S s k i p t r a c ) ; p r i n t f ("Would you l i k e p o s i t i v e s h a d i n g , n e g a t i v e s h a d i n g , " ) ; p r i n t f ("\nabsolute s h a d i n g o r w i g g l e t r a c e s ? (P/N/A/W)\n"); s c a n f ("%s", shade);  87 p r i n t f ("What i s t h e maximum t r a c e o v e r l a p s c a n f ("%d", S g a i n ) ;  (gain)?\n");  p r i n t f ("At what o v e r l a p s h o u l d t h e t r a c e s be c l i p p e d ? \ n " ) ; s c a n f ("%d", S c l i p ) ; i f ( c l i p > g a i n || c l i p < 1) c l i p = gain; p r i n t f ("Enter t h e p l o t t i t l e \ n " ) ; gets (title); gets (title); p r i n t f ("Enter t h e x - a x i s gets ( x a x t i t l e ) ;  legend\n");  p r i n t f ("Enter t h e y - a x i s legendNn"); gets ( y a x t i t l e ) ; p r i n t f ("How many c o p i e s o f t h i s p l o t would you l i k e ? \ n " ) ; s c a n f ("%d", S c o p i e s ) ; p r i n t f ("Each t r a c e w i l l be i n d i v i d u a l l y s c a l e d . \ n " ) ; p r i n t f ("Would you p r e f e r g l o b a l s c a l i n g ? (Y/N)\n">; s c a n f ("%s", g l o s c a l e ) ; globemax - 0; d a t a v a l u e s */ g l o b e m i n - 65535;  /* s e t t h e maximum and minimum /* j u s t o u t s i d e t h e  a l l o w a b l e range */ f i d » fopen ( s o u r f i l e , " r b " ) ; f p s - fopen ( p o s t f i l e , "w"); if  ( f i d — NULL || f p s — NULL){ p r i n t f ("\ ********** f i l e opening e r r o r **********») e x i t (0); /* i f g l o b a l s c a l i n g i s s e l e c t e d , */ n  •)  ;  /* g l o b a l l y s c a l e t h e s o u r c e d a t a s e t */ i f (gloscale[0] 'y* || g l o s c a l e [ 0 ] -= 'Y'){ p r i n t f ("Begin s c a l i n g a t , and i n c l u d e , p o i n t number\n"); s c a n f ("%d", S i n i s c a l e ) ; p r i n t f ("End s c a l i n g a t , and i n c l u d e , p o i n t number\n"); s c a n f ("%d", Sendscale) ; p r i n t f ("Begin s c a l i n g t h e source d a t a \ n " ) ; k - 0; g l o b z e r o - 0; f o r ( i = l ; i<=numbtrac; i++){ f r e a d (sourdata, s i z e o f ( u n s i g n e d i n t ) , t r a c l e n g , f i d ) ; i f ( i % s k i p t r a c -= 0){ p r i n t f ( " S c a l i n g t r a c e number %d", i ) ; p u t c h (13); k ++; for  (j«=inipoint; j<=endpoint; j++) {  sourdata[j],  globemax •» (globemax>sourdata[j]) ? globemax  sourdata[j],  globemin = ( g l o b e m i n < s o u r d a t a [ j ] ) ? globemin globzero  += s o u r d a t a [ j ] ;  ) } g l o b z e r o /= k * ( f l o a t ) ( e n d p o i n t - i n i p o i n t + 1 ) ; rewind ( f i d ) ; p r i n t f ("Xnglobemin i s % f " , g l o b e m i n ) ; p r i n t f ("\nglobemax i s % f " , globemax);  88 printf  ("\nglobzero i s % f \ n " ,  globzero);  }  /* b o u n d a r i e s o f t h e p l o t t i n g  a r e a i n 1/72" s c a l e */ xmin = 90; xmax = 738; ymin = 108 ymax = 522 /* r o t a t e t h e page coordinates /*  so t h e x and y */  a x i s c o i n c i d e w i t h t h e p l o t a x i s */ fprintf fprintf  ( f p s , "\n612 0 t r a n s l a t e 90 r o t a t e " ) ; (fps, " \ n l s e t l i n e w i d t h " ) ;  fprintf fprintf  /* draw t h e page o u t l i n e */ ( f p s , "\nnewpath 90 108 moveto 90 522 l i n e t o 738 522 l i n e t o " ) ; ( f p s , "\n738 108 l i n e t o c l o s e p a t h s t r o k e " ) ;  /* add a t e x t c e n t e r i n g p r o c e d u r e */ f p r i n t f (fps, "\n/centertext {dup s t r i n g w i d t h " ) ; f p r i n t f ( f p s , "pop -2 d i v 0 rmoveto show} d e f " ) ; /* add t h e p l o t t i t l e and fprintf fprintf fprintf fprintf fprintf fprintf  t h e a x i s l e g e n d s */ ( f p s , "\n/Times-Roman f i n d f o n t 16 s c a l e f o n t s e t f o n t " ) ; ( f p s , "\n396 54 moveto (%s) c e n t e r t e x t " , t i t l e ) ; ( f p s , "\n/Times-Roman f i n d f o n t 12 s c a l e f o n t s e t f o n t " ) ; ( f p s , "\n414 75 moveto (%s) c e n t e r t e x t " , x a x t i t l e ) ; ( f p s , "\n66 315 moveto 90 r o t a t e " ) ; ( f p s , " (%s) c e n t e r t e x t -90 r o t a t e " , y a x t i t l e ) ; /* move t h e o r i g i n t o t h e lower l e f t  corner o f the p l o t t i n g area  */ f p r i n t f ( f p s , "\n%d % d t r a n s l a t e " , xmin, ymin); xmax -= xmin; ymax -= ymin; /* change t h e page s c a l i n g t o b e s t f i t t h e p l o t s i z e */ x s c a l e - 0 . 0 1 * xmax / (numbtrac + 2 * c l i p ) ; y s c a l e = ymax / (1.0 * t r a c l e n g ) ; /* c a l c u l a t e t h e new p l o t t i n g a r e a b o u n d a r i e s */ xmax /= x s c a l e ; ymax /= y s c a l e ; f p r i n t f ( f p s , "\n%6f % 6 f s c a l e " , x s c a l e ,  yscale);  /* add number c e n t e r i n g p r o c e d u r e s */ f p r i n t f ( f p s , "\n/Times-Roman f i n d f o n t 10 s c a l e f o n t s e t f o n t " ) ; f p r i n t f ( f p s , "\n/xcenternumber {gsave % 6 f % 6 f ", 1 / x s c a l e , 1 / y s c a l e ) ; fprintf fprintf fprintf fprintf fprintf  (fps, (fps, (fps, (fps, (fps,  " s c a l e dup s t r i n g w i d t h pop -2 d i v 0 rmoveto " ) ; "show g r e s t o r e ) d e f " ) ; "\n/ycenternumber {gsave % 6 f % 6 f ", 1 / y s c a l e , 1 / x s c a l e ) ; " s c a l e d u p . s t r i n g w i d t h pop -2 d i v 0 rmoveto " ) ; "show g r e s t o r e } d e f " ) ;  89 /* add t h e hashmarks and p o s i t i o n numbers on t h e x a x i s */ f o r ( i = 100 * c l i p + 50; i < 100 * (numbtrac + c l i p ) ; i += 500){ f p r i n t f ( f p s , "\n%d 0 moveto 0 %d r l i n e t o s t r o k e " , i , ( i n t ) ( - 5 / y s c a l e ) ) ; f p r i n t f ( f p s , "\n%d % d moveto ", i , ( i n t ) ( - 1 5 / y s c a l e ) ) ; fprintf  ( f p s , "(%d)  xcenternumber",  ( i - 100 * c l i p  - 50) / 5 0 ) ;  ) /* add t h e hashmarks and p o s i t i o n numbers on t h e y a x i s */ f o r ( i - 1860; i > 0; i — 29){ i f (( (1889-i) % 116) •= 0){ f p r i n t f ( f p s , "\n0 %d moveto %d 0 ", i , ( i n t ) ( - 3 / x s c a l e ) ) ; f p r i n t f (fps, " r l i n e t o s t r o k e " ) ; } else { f p r i n t f ( f p s , "\n0 %d moveto %d 0 r l i n e t o ", i , ( i n t ) ( - 6 / x s c a l e ) ) ; f p r i n t f ( f p s , " s t r o k e \n%d %d moveto ", ( i n t ) ( - 8 / x s c a l e ) , i ) ; f p r i n t f ( f p s , "90 r o t a t e (%d) ", ( i n t ) ( 1 0 * ( 1 8 8 9 - i ) / 1 1 6 ) ) ; f p r i n t f ( f p s , "ycenternumber -90 r o t a t e " ) ;  ) >  minamp «• g l o b e m i n ;  /* u s e t h e g l o b a l s c a l i n g  limits  */ maxamp = globemax; zero — globzero; i f ((maxamp - zero) > (zero - minamp)) minamp = 2 * zero - maxamp; else maxamp — 2 * z e r o - minamp; /* add t h e p o s i t i v e s h a p i n g fprintf fprintf  r o u t i n e */  ( f p s , "\n/posshade {dup 3 index g t (pop pop pop) ( f p s , "(1 i n d e x l i n e t o l i n e t o } i f e l s e ) d e f " ) ;  ");  /* a d d t h e n e g a t i v e s h a p i n g r o u t i n e */ f p r i n t f ( f p s , "\n/negshade {dup 3 index l t (pop pop pop) " ) ; f p r i n t f ( f p s , "{1 i n d e x l i n e t o l i n e t o ) i f e l s e ) d e f " ) ; /* p l o t t h e d a t a */ for ( i = l ; i<=numbtrac; i++){ p r i n t f ("Reading t r a c e number %d", i ) ; p u t c h (13); f r e a d (sourdata, s i z e o f ( u n s i g n e d i n t ) , t r a c l e n g , f i d ) ; i f ( i % s k i p t r a c =- 0){ /* o r d e t e r m i n e t h e l o c a l s c a l i n g l i m i t s */ if  ( g l o s c a l e [ 0 J != 'Y' && g l o s c a l e [ 0 ] != 'y'){ zero = 0 ; f o r ( j = i n i p o i n t ; j<=endpoint; j++){ maxamp = (maxamp > s o u r d a t a [ j ] ) ? maxamp :  sourdata[j] minamp = (minamp < s o u r d a t a [ j ] ) sourdata[j] z e r o += s o u r d a t a [ j ] ; } z e r o /«• (endpoint - i n i p o i n t + 1) ; i f ((maxamp - zero) > (zero - minamp))  ? minamp :  90 minamp = 2 * z e r o - maxamp; else maxamp = 2 * z e r o - minamp; the  for /*  /*  } d a t a t o p l o t s c a l e f a c t o r */ s c a l e = g a i n * 100.0 / (maxamp - minamp); base = 100 * ( i + c l i p ) - 50;  s c a l e each d a t a p o i n t  /* i t i s w i t h i n  (j<=inipoint;  calculate  j<=endpoint; j++) {  and ensure */  t h e c l i p p i n g range */ p o i n t = ( s o u r d a t a [ j ] - zero) * s c a l e ; p o i n t = ( p o i n t < ( c l i p * 100)) ? p o i n t : ( c l i p * 100); p o i n t = ( p o i n t > ( - c l i p * 100)) ? p o i n t : ( - c l i p * 100); p o i n t += base;  /* p u t i t on t h e p o s t s c r i p t s t a c k */ if  ( ( j - i n i p o i n t ) % 400 != 0 || j == i n i p o i n t ) { i f ( ( j - i n i p o i n t ) % 10 »= 0) fprintf  (fps, " \ n % l d " ,  fprintf  (fps, " % l d " ,  (long)point);  else (long)point);  }  else{ /* p l o t t h e d a t a on t h e s t a c k */ fprintf inipoint); fprintf inipoint-400);  ( f p s , " \ n % l d %d moveto",  (long)point, j -  ( f p s , "\n%d -1 %d ", j - i n i p o i n t - 1 ,  j-  /* p o s i t i v e s h a d i n g */ i f (shade[0] — 'P' || shade[0] — 'p'H f p r i n t f ( f p s , "{2 copy l i n e t o % l d ", (long)base) fprintf  ( f p s , "posshade) f o r s t r o k e " ) ;  /* n e g a t i v e s h a d i n g */ ) e l s e i f (shade[0] ~ 'N' || shade[0] == 'n'H f p r i n t f ( f p s , "{2 copy l i n e t o % l d ", (long)base), fprintf  ( f p s , "negshade) f o r s t r o k e " ) ;  /* a b s o l u t e s h a d i n g */ ) e l s e i f (shade[0] — 'A' || shade[0] — 'a'){ f p r i n t f ( f p s , "(2 copy l i n e t o % l d ", (long)base), fprintf  ( f p s , "1 i n d e x l i n e t o l i n e t o ) f o r  stroke"); ) else /* no s h a d i n g */ f p r i n t f (fps, " ( l i n e t o ) f o r s t r o k e " ) ; f p r i n t f (fps, " \ n % l d " , ( l o n g ) p o i n t ) ; }  } c l e a n up a n y t h i n g l e f t on t h e s t a c k */ f p r i n t f ( f p s , " % d moveto", j - i n i p o i n t - 1 ) ;  /*  91  if  f p r i n t f ( f p s , "\n%d -1 ", j - i n i p o i n t - 2 ) ; f p r i n t f ( f p s , "%d ", ( j - i n i p o i n t - ( ( j - i n i p o i n t ) % 4 0 0 ) ) ) ; (shade[0] =- 'P' || shade[0] == 'p'H f p r i n t f ( f p s , "(2 copy l i n e t o % l d posshade) f p r i n t f (fps, " f o r stroke"); } e l s e i f (shade[0] ~ 'N' || shade[0] >=>= 'n*){  } else  fprintf fprintf i f (shade[0]  }  )  ",  (long)base);  ( f p s , "{2 copy l i n e t o % l d negshade} ", (fps, " f o r stroke"); 'A' || shade[0] == 'a'){  (long)base);  fprintf fprintf  ( f p s , "(2 copy l i n e t o % l d 1 i n d e x ", (fps, " l i n e t o l i n e t o ) f o r stroke");  fprintf  (fps, " ( l i n e t o )  else stroke");  )  /* wrap up t h e p l o t and t h e program */ i f ( c o p i e s > 1) f p r i n t f ( f p s , "\n/#copies %d d e f " , f p r i n t f ( f p s , "\nshowpage\n"); fclose (fid); fclose (fps);  )  for  copies);  (long)base);  92 /* median3.c */ /********************************************************** /*  '*/  /*  a program t o 3 - p o i n t  /*  i n t e g e r data  space MEDIAN f i l t e r  a s e t o f b i n a r y unsigned  */ */  /*  */  /*  by G a r f i e l d Mellema  (January  11, 1989)  */  /* /*****************************************************  */  /*  */  /*  T h i s program w i l l file  examine t h r e e t r a c e s o f d a t a a t a t i m e f r o m  /*  the f i r s t  /*  median v a l u e , a t each p o i n t , o f t h e d a t a .  s p e c i f i e d i n t h e command l i n e and d e t e r m i n e t h e This value  i s then  /*  s u b t r a c t e d from t h e c e n t e r t r a c e i n an attempt t o remove  /*  horizontally recurring artifacts  /*  file.  /*  t h e image w i l l be t h e same as t h o s e  /*  and s e c o n d l a s t  /*  be s t o r e d i n t h e second f i l e  /*  program assumes t h a t t h e f i l e b e i n g  The v a l u e s  respectively.  image f i l e ,  */  and l a s t t r a c e s o f  s u b t r a c t e d from t h e second  The r e s u l t s o f t h i s p r o c e s s i s a standard  t h a t i s 125 t r a c e s o f 1860 p o i n t s .  */ */ */  will  s p e c i f i e d i n t h e command l i n e . filtered  */ */  f r o m t h e image s t o r e d i n t h e  s u b t r a c t e d from t h e f i r s t  */  This size  */ */ */  /*  Syntheseis  They  */  /*  a r e r e a d one a t a t i m e and a r e r o t a t e d i n t h e a r r a y d a t a u i n t by  */  /*  successive s h i f t s of the array indices stored i n the array i s l i n e .  */  /* /******************************************^  */  /*  */  /*  d a t a u i n t [ ] [ ] - unsigned  i n t e g e r raw d a t a  */  /*  filtered[]  ~ f i l t e r e d v e r s i o n o f the present  /*  i s l i n e []  - d a t a u i n t a r r a y p r e s e n t l y a c t i n g as t h e p r e s e n t  trace  */  /*  median[]  - median o f p r e s e n t  /*  temp  - median f i l t e r e d v a l u e o f t h e p r e s e n t  /*  value[]  - present  /*  zero  - t h e average v a l u e o f t h e image b e i n g  and i m m e d i a t e l y a d j a c e n t  trace  traces  point  and i m m e d i a t e l y space a d j a c e n t  v o i d main int  */ */  f i l t e r e d [ 1 8 6 0 ] , median[1860];  ( a r g c , argv)  argc;  char  *argv[] ;  { unsigned int  float FILE if  i n t value[3], extra;  i , j , k, 1, zero, *fib,  isline[4];  temp; *fob;  (argc < 3){ printf printf  ("\nThe command l i n e format ("median3  sourcefilename.uib  is:\n\n"); destinationfilename.uib\n\n");  exit(0); ) printf  ("Source f i l e  name i s % s \ n " ,  printf  ("Destination  file  fib  = fopen  (argv[l],  argv[l]);  name i s %s\n",  "rb");  argv[2]);  */  filtered  • i n c l u d e <stdio.h> i n t datauint[3][1860],  */  points  /* /******************************************************  unsigned  */  */  93 f o b = fopen if  (fib =  ( a r g v [ 2 ] , "wb"); NULL | | f o b •== NOLL) {  printf  ("*********** f i l e a c c e s s  errror **********••);  e x i t (0); } for  (i=0; i<125; i++){ f r e a d ( d a t a u i n t , s i z e o f ( u n s i g n e d i n t ) , 1860, f o r (j=0; j<1860; j++) z e r o += ( f l o a t ) d a t a u i n t [ 0 ] [ j ] ; p r i n t f ("Trace number %3d c o n s i d e r e d " , i ) ; p u t c h (13);  fib);  } z e r o /= 232500; p r i n t f ("\nzero i s % f \ n " ,  zero);  rewind ( f i b ) ; f o r (i=0; i<1860; i++) median[i] = zero; f o r (i=0; i<3; i++) isline[i] - i ; f r e a d ( S d a t a u i n t [ 0 ] [ 0 ] , s i z e o f ( u n s i g n e d i n t ) , 1860, f r e a d ( & d a t a u i n t [ 1 ] [ 0 ] , s i z e o f ( u n s i g n e d i n t ) , 1860, for  fib); fib);  (i=0; i<125; i++){ /* f o r each t r a c e */ i f (i==0){ f r e a d ( & d a t a u i n t [ i s l i n e [ 2 ] ] [ 0 ] , s i z e o f ( u n s i g n e d i n t ) , 1860, f i b ) ; f o r (j=0; j<1860; j++){ /* f o r each p o i n t o f each t r a c e */ /* l o a d s i m i l a r p o i n t v a l u e s */ value[0] - d a t a u i n t [ i s l i n e [ 0 ] J [ j ] ; value[l] = datauint[isline[1]J[j]; value[2] = d a t a u i n t [ i s l i n e [ 2 ] ] [ j ] ; i f ( v a l u e [1] > v a l u e [0]){ e x t r a «• v a l u e [ 1 ] ; v a l u e [1] = v a l u e [ 0 ] ; v a l u e [0] = e x t r a ; }  if  } if  ( v a l u e [2] > v a l u e [ 1 ] ) ( extra - value [2]; v a l u e [2] = v a l u e [ 1 ] ; v a l u e [1] = e x t r a ; ( v a l u e [1] > v a l u e [0]){ e x t r a = v a l u e [1 ] ; v a l u e [1] = v a l u e [ 0 ] ; v a l u e [0] = e x t r a ;  } median[j] — v a l u e [ 1 ] ; temp = ( f l o a t ) d a t a u i n t [ i s l i n e [ 0 ] ] [ j ] - ( f l o a t ) v a l u e [ 1 ] + ( f l o a t ) z e r o ; i f (temp < 0 ) ( p r i n t f ( " \ n f i l t e r e d v a l u e i s t o o s m a l l % 6 f ", temp); p r i n t f ("at % d %d", i , j ) ; temp — 0; ) e l s e i f (temp > 65535){ p r i n t f ( " \ n f i l t e r e d v a l u e i s t o o l a r g e % f ", temp); p r i n t f ("at % d %d", i , temp = 65535;  j);  } filtered[j]  = (unsigned  i n t ) temp;  94 } if  (i==l){ f o r (j-=0; j<1860; j++) {  /* f o r each p o i n t o f each t r a c e */ /* l o a d s i m i l a r p o i n t v a l u e s */ temp = ( f l o a t ) d a t a u i n t [ i s l i n e [ 1 ] ] [ j ] - ( f l o a t ) m e d i a n [ j ] + ( f l o a t ) z e r o ; i f (temp < 0){ p r i n t f ( " \ n f i l t e r e d v a l u e i s t o o s m a l l % f ", temp); p r i n t f ("at % d %d", i , j ) ; temp - 0; ) e l s e i f (temp > 65535){ p r i n t f ( " \ n f i l t e r e d v a l u e i s t o o l a r g e % f ", temp); p r i n t f ("at % d %d", i , j ) ; temp = 65535;  ) filtered!j]  •= (unsigned i n t ) temp;  } } e l s e i f (i==123){ f r e a d ( S d a t a u i n t [ i s l i n e [ 2 ] ] [ 0 ] , s i z e o f ( u n s i g n e d i n t ) , 1860, f i b ) ; f o r (j=0; j<1860; j++){ /* f o r each p o i n t o f each t r a c e */ v a l u e [ 0 ] *» d a t a u i n t [ i s l i n e [ 0 ] ] [ j ] ; value[l] - datauint[isline[1]][j]; value[2] = d a t a u i n t [ i s l i n e [ 2 ] ] [ j ] ; i f ( v a l u e [1] > v a l u e [0]){ extra - value [1]; v a l u e [1] •» v a l u e [0]; v a l u e [0] = e x t r a ; } if  ( v a l u e [2] > v a l u e [1]){ e x t r a «= v a l u e [2] ; v a l u e [2] •= v a l u e [ 1 ] ; v a l u e [1] = e x t r a ;  }  if  '  •  ( v a l u e [1] > v a l u e [0]){ extra — value [1]; v a l u e [1] - v a l u e [0]; v a l u e [0] «• e x t r a ;  }  median[j] — v a l u e [ 1 ] ; temp = ( f l o a t ) d a t a u i n t [ i s l i n e [ 1 ] ] [ j ]  if  -(float)value[1] +(float)zero;  (temp < 0){  printf printf temp = ) else i f printf printf temp «•  ( " \ n f i l t e r e d value ("at %d %d", i , j 0; (temp > 65535){ ( " \ n f i l t e r e d value ("at %d %d", i , j 65535;  i s too small );  % f ", temp);  i s t o o l a r g e % f ", temp); );  >  filteredfj]  -  (unsigned i n t ) temp;  >  ) e l s e i f (i==124){ f o r (j=0; j<1860; j++){  /* f o r each p o i n t o f each t r a c e */ /* l o a d s i m i l a r p o i n t v a l u e s */ temp = ( f l o a t ) d a t a u i n t [ i s l i n e [ 2 ] ] [ j ] - ( f l o a t ) m e d i a n [ j ] + ( f l o a t ) z e r o ; i f (temp < 0){ printf printf  ( " \ n f i l t e r e d value i s too small ("at %d %d", i , j) ;  % f ", temp);  temp — 0; } e l s e i f (temp > 65535){ p r i n t f ( " \ n f i l t e r e d v a l u e i s t o o l a r g e % f ", temp); p r i n t f ("at % d %d", i , j ) ; temp = 65535;  ) filtered!j]  ™ (unsigned i n t ) temp;  } ) else{ f r e a d ( S d a t a u i n t [ i s l i n e [ 2 ] ] [ 0 ] , s i z e o f ( u n s i g n e d i n t ) , 1860, f i b ) ; f o r (j=0; j<1860; j++){ /* f o r each p o i n t o f each t r a c e value[0] — d a t a u i n t [ i s l i n e [ 0 ] ] [ j ] ; value[l] = datauint[isline[1]][j]; v a l u e [ 2 ] = d a t a u i n t [ i s l i n e [ 2 ] ] [j] ; i f ( v a l u e [1] > v a l u e [0]){ e x t r a >= v a l u e [ 1 ] ; v a l u e [1] = v a l u e [ 0 ] ; v a l u e [0] «» e x t r a ; } if  ( v a l u e [2] > v a l u e [1]){ extra - value [2]; v a l u e [2] = v a l u e [ 1 ] ; v a l u e [1] = e x t r a ;  >  if  ( v a l u e [1] > v a l u e [0]){ extra = value [1]; v a l u e [1] = v a l u e [ 0 ] ; v a l u e [0] — e x t r a ;  } temp = ( f l o a t ) d a t a u i n t [ i s l i n e [ 1 ] ] [ j ] - ( f l o a t ) v a l u e [ 1 ] + ( f l o a t ) z e r o ; i f (temp < 0){ p r i n t f ( " \ n f i l t e r e d v a l u e i s t o o s m a l l % f ", temp); p r i n t f ("at % d %d", i , j ) ; temp •» 0; } e l s e i f (temp > 65535){ printf printf  ( " \ n f i l t e r e d v a l u e i s t o o l a r g e % f ", temp); ("at % d %d", i , j ) ; temp •» 65535;  >  filtered[j]  = (unsigned  i n t ) temp;  ) ) if  ( i != 0 && i != 123)[ i s l i n e [3] = i s l i n e [ 0 ) ; i s l i n e [0] = i s l i n e [ 1 ] ; i s l i n e [1] = i s l i n e [ 2 ] ; i s l i n e [2] = i s l i n e [ 3 ] ;  } if  ( f w r i t e ( f i l t e r e d , s i z e o f ( u n s i g n e d i n t ) , 1860, f o b ) != 1860) p r i n t f ("\ ********** b i n a r y w r i t e e r r o r * * * * * * * * * * • • ) ; p r i n t f ("Trace number %3d f i l t e r e d " , i ) ; p u t c h (13); n  ) fclose fclose  (fib); (fob);  96 /* m u l t r a c e . c */ /******************************************** /* /* /* /*  M U L t i p l e TRACE d a t a a c q u i s i t i o n program by G a r f i e l d Mellema F e b r u a r y 16, 1989  */ */ */ */  /* /**************************************************  */  /*  */  /* /*  T h i s program w i l l r e a d d a t a v a l u e s from a s p e c i f i e d f i l e and send t h o s e v a l u e s t o t h e  */ */  /* /*  DAC on t h e Computerscope c a r d i n s t a l l e d i n computer. The program w i l l a l s o i n i t i a l i z e ,  */ */  /* /*  t r i g g e r , and c o l l e c t d a t a from t h e m u l t i p l e x e d ADC on t h e a f o r e m e n t i o n e d c a r d . The s e n d i n g  */ */  /* /* /* /* /* /* /* /* /* /* /* /* /* /* /*  out o f t h e f i l e d a t a and t h e c o l l e c t i o n o f t h e r e s u l t a n t d a t a i s r e p e a t e d 16 t i m e s and summed e a c h time f o r t h e r e d u c t i o n o f n o i s e i n t h e r e c e i v e d d a t a . The 16384 p o i n t s o f summed r e c e i v e d data are then c r o s s c o r r e l a t e d i n the f r e q u e n c y domain w i t h a p r e v i o u s l y made r e c o r d i n g o f the source u s i n g a F a s t F o u r i e r T r a n s f o r m t a k e n from t h e book N u m e r i c a l R e c i p e s i n C by P r e s e t . a l . The r e s u l t a n t waveform i s windowed and s t o r e d i n t h e f i l e s p e c i f i e d i n t h e program command l i n e . T h i s program makes use o f t h e f i l e s i n w a v e . b i n and r e f w a v e . u i b which s t o r e t h e s o u r c e and c o r r e l a t i o n r e f e r e n c e waveforms respectively.  */ */ */ */ */ */ */ */ */ */ */ */ */ */ */  /* */ /******************************************************/ /*  /* /* /* /* /* /* /* /* /* /* /* /*  . . . ••  SAMPRATE ARASIZE refwave[] datasumU finwave[] autox[] xetra[] dataout[] datain offset start stop  */  -  - ADC s a m p l i n g r a t e i n microseconds - c o l l e c t e d dataset size - c o r r e l a t i o n r e f e r e n c e waveform the stacked r e c e i v e d data - datasum[] c e n t e r e d around z e r o - the c r o s s c o r r e l a t e d data ~ an e x t r a c r o s s c o r r e l a t i o n a r r a y - t h e s o u r c e s i g n a l as DAC v a l u e s - p o i n t e r t o t h e ADC d a t a b u f f e r - t h e average v a l u e o f datasum[] - time s t r u c t u r e s t o - c o n t r o l t r o l l e y movement  */ */ */ */ */ */ */ */ */ */ */ */  /* */ /******************************************************/  • i n c l u d e <stdio.h> • i n c l u d e <math.h> • i n c l u d e <dos.h> • i n c l u d e <time.h> • d e f i n e SAMPRATE 5 • d e f i n e ARASIZE 16384  /* d a t a sampling r a t e i n microseconds /* ARASIZE i s t h e i n p u t d a t a s e t s i z e /* 16384 i s t h e maximum a l l o w a b l e s i z e  */ */ */  97 f l o a t refwave[ARASIZE], finwave[ARASIZE], e x t e r n v o i d e c k o ( i n t *, i n t ) ; u n s i g n e d i n t datasum[ARASIZE] ; i n t dataout[23000]; v o i d main int  autox[2*ARASIZE],  xetra[2*ARASIZE];  ( a r g c , argv)  argc;  char  *argv[];  { unsigned char *datain; u n s i g n e d i n t i , j , k, 1; double o f f s e t ; v o i d c o r r e l ( ) , f o u r l () ; time_t s t a r t , stop; FILE * f i a , * f i b , *fob; /* s e t a p o i n t e r t o t h e s t a r t o f t h e d a t a c a r d memory */ datain =  ( u n s i g n e d c h a r *)OxAOOOOOOO; /* check t h a t t h e d e s t i n a t i o n f i l e n a m e has been s u p p l i e d  if  */  ( a r g c < 2){ p r i n t f ("\nThe command l i n e format i s : \ n \ n " ) ; p r i n t f ("multrace d e s t i n a t i o n f i l e n a m e \ n \ n " ) ; exit(0);  } printf  ("\nThe d e s t i n a t i o n f i l e n a m e i s % s " , a r g v [ l ] ) ; /* open t h e n e c e s s a r y f i l e s and r e a d i n t h e s o u r c e wavelet  */  f i a = fopen("\\synseis\\inwave.bin", "rb"); f i b = fopen("\\synseis\\refwave.flb", "rb"); f o b - f o p e n ( a r g v [ 1 ] , "wb"); if  ( f i a — NULL || f i b == NULL || f o b — NULL){ p r i n t f ("\ *********** F i l e o p e n i n g e r r o r * * * * * * * * * * • • ) ; exit(0); n  ) p r i n t f ( " \ n r e a d i n g s o u r c e wavelet from f i l e \ n " ) ; f r e a d (dataout, s i z e o f ( i n t ) , 23000, f i a ) ; p r i n t f ( " \ n F i n i s h e d t a k i n g i n source waveform"); /* s e t up t h e d a t a a c q u i s i t i o n c a r d t o c o l l e c t t h e r e t u r n i n g waveform */ o u t p (779, 0 ) ; f o r (i=0; i<16; i++) o u t p (784, 7 ) ; o u t p (785, 0 ) ; o u t p (776, 0) ; o u t p (775, 116); o u t p (773, (SAMPRATE % 2 5 6 ) ) ; o u t p (773, (SAMPRATE / 2 5 6 ) ) ; o u t p (775, 50) ; outp outp  (772, 1) ; (772, 0 ) ;  /* d i s a b l e d a t a a c q u i s i t i o n /* t a k e d a t a from c h a n n e l 8 /* c h a n n e l 8 i s t h e microphone /* use t h e t i m e r on t h e d a t a c a r d /* t r i g g e r d a t a sampling from s o f t w a r e /* use mode 2 o f t h e i n t e r n a l t i m e r /* sample e v e r y (LSB) /* SAMPRATE m i c r o s e c o n d s (MSB) /* t a k e 1 sample a t a t i m e  */ */ */ */ */ */ */ */ */  98 outp outp outp  (775, (774, (774,  /* s e t t h e p o s t - t r i g g e r i n g */ /* d e l a y t o 16384 words */ /* i . e . t a k e 16384 d a t a p o i n t s */  178); 0); 64);  /* r e a d t h e c r o s s c o r e l a t i o n r e f e r e n c e waveform from r e f w a v e . u i b , c o n v e r t /* i t t o f l o a t i n g p o i n t , and s u b t r a c t i t s mean t o c e n t e r i t around z e r o  */ */  f r e a d (datasum, s i z e o f ( u n s i g n e d i n t ) , ARASIZE, f i b ) ; o f f s e t •= 0.0; /* f i n d t h e mean o f t h e waveform */ f o r (i=0; K A R A S I Z E ; i++) o f f s e t +•= ( f l o a t ) d a t a s u m f i ] ; o f f s e t /= ARASIZE; for  (i=0; i<ARASIZE;  i++)  /* s u b t r a c t i t from t h e waveform  */  /* t h e f o l l o w i n g i s t h e major d a t a c o l l e c t i o n l o o p /* i t c y c l e s once p e r t r a c e ( t r o l l e y p o s i t i o n )  */ */  r e f w a v e f i ] = datasum[i]  for  - offset;  (k=0; k<125; k++){ f o r (j=0; j<ARASIZE; j++) /* e r a s e t h e r e c e i v e d d a t a a r r a y */ datasum[j] — 0; p r i n t f ("\nReady t o t a k e d a t a p o s i t i o n %u", k ) ; /* t h e f o l l o w i n g l o o p causes t h e s o u r c e waveform t o be t r a n s m i t t e d */ /* and c o l l e c t s t h e r e t u r n i n g waveform from t h e d a t a a c q u i s i t i o n c a r d */ for  (j=0; j<16; j++){ o u t p (789, 0 ) ;  /* manually s e l e c t d a t a bank B •/* i . e . s t o r e d a t a p o i n t s i n b u f f e r A p r i n t f ("\nAbout t o c a l l e c k o " ) ; outp (795, 06); /* s e t sample b u f f e r A t o 16384 words ecko (dataout, 23000); /* send out t h e s o u r c e waveform /* and i n i t i a t e d a t a a c q u i s i t i o n p r i n t f ("\nReturned from e c k o " ) ; f o r (i=0; i<SAMPRATE*2; i++) p r i n t f ( " \ n f i n i s h t a k i n g data b l o c k %3d p o s i t i o n %3d", j , k ) ;  */ */ */ */ */  o u t p (788, 0 ) ; /* r e a d t h e a c q u i r e d d a t a from bank A */ p r i n t f ("\nsumming data b l o c k " ) ; f o r (i»0; K A R A S I Z E ; i++) /* r e t r i e v e t h e a c q u i r e d d a t a */ /* note t h a t i t i s s t o r e d i n r e v e r s e d b y t e o r d e r d a t a s u m f i ] +•= d a t a i n [ 2 * i ] + 256 * d a t a i n [ 2 * i + l ] ;  ) /* t h i s s e c t i o n moves t h e t r o l l e y 20 mm t o t h e n e x t t r a c e p o s i t i o n */ /* t h e t r o l l e y moves , u s i n g a synchronous motor, a t 2.5 sec/mm */ for  (i=0; i<25; i++) o u t p (794, 64); time ( S s t a r t ) ; p r i n t f ("\nMoving t r o l l e y . . " ) ; do time ( S s t o p ) ; w h i l e ( d i f f t i m e ( s t o p , s t a r t ) < 48.0); f o r (i=0; i<25; i++)  /* use d i g i t a 1 s w i t c h #1 */ /* t o move t h e t r o l l e y WEST */  /* 0.416 mm / second /* 20 / 0.416 -= 48 seconds  */ */  */  99 outp trolley  (794, 00);  /* s t o p  */  printf  ("\nStopping  trolley....");  /* t h e mean o f t h e s t a c k e d r e c e i v e d d a t a i s d e t e r m i n e d and */ /* s u b t r a c t e d t o y i e l d a f l o a t i n g p o i n t a r r a y c e n t e r e d around z e r o */ o f f s e t =0.0; for (i=0; K A R A S I Z E ; i++) o f f s e t += d a t a s u m [ i ] ; o f f s e t /•= ARASIZE; p r i n t f ("\nThe o f f s e t i s % f " , o f f s e t ) ; for (i=0; K A R A S I Z E ; i++) f i n w a v e [ i ] = datasum[i] - o f f s e t ;  /* f i n d t h e average v a l u e o f */ /* t h e s t a c k e d r e c e i v e d d a t a */  /* attempt t o z e r o t h e d a t a  */  /* t h e t r o l l e y i s g i v e n t i m e t o come t o a complete */ /* s t o p d u r i n g t h e f o l l o w i n g c r o s s c o r r e l a t i o n */ correl  (refwave-1, finwave-1,  (long)ARASIZE, autox-1,  xetra-1);  /* w r i t e t h e u s e f u l c r o s s c o r r e l a t e d d a t a t o a f i l e /* t h e r e l e v a n t p o r t i o n s o f t h e c r o s s c o r r e l a t e d d a t a a r e */ /* w r i t t e n t o t h e f i l e s p e c i f i e d i n t h e program command l i n e */ p r i n t f ("\nwriting c r o s s c o r r e l a t e d data t o f i l e " ) ; i f (fwrite(autox+ARASIZE/2+6800, s i z e o f ( f l o a t ) , 1392, fob) != 1392) p r i n t f (»\ri********** b i n a r y w r i t e e r r o r * * * * * * * * * * • • ) ; i f ( f w r i t e ( a u t o x , s i z e o f ( f l o a t ) , 468, fob) != 468) p r i n t f ("\n********** b i n a r y w r i t e e r r o r * * * * * * * * * * • • ) ;  } fclose fclose fclose  (fia); (fib); (fob);  ) /********************************************** /* /* /*  /*  The f o l l o w i n g program s e c t i o n s were t a k e n from N u m e r i c a l R e c i p e s i n C i n C. No attempt i s made t o document them as t h e a f o r e m e n t i o n e d book does a superb job o f t h i s r a t h e r complex t a s k .  /* /********************************************* void correl(datal,data2,n,ans,fft) float  datal[],data2[],ans[],fft[];  l o n g n; { long no2,i; f l o a t dum; void twofft(),realft() ; p r i n t f ("\nDo a f o r w a r d F F T " ) ; twofft(datal,data2,fft,ans,n); no2=n/2; for  (i=2;K=n+2;i+=2) { ans[i-l]=(fft[i-1]*(dum=ans[i-1])+fft[i]*ans[i])/no2; ans[i]=(fft[i]*dum-fft[i-l]*ans[i])/no2;  */ */ */ */ */  */  }  ans[2]=ans[n+l]; p r i n t f ("\nDo an i n v e r s e r e a l f t (ans, no2, -1) ;  FFT");  } void  twofft(datal,data2,fftl,fft2,n)  float  datal[],data2[],fftl[],fft2[] ;  l o n g n; { long nn3,nn2,jj,j; f l o a t rep,rem,aip,aim; void fourl(); nn3=l+(nn2=2+n+n); f o r (j=l,jj=2;j<=n;j++,jj+=2) { fftltjj-l]-datal[j]; fftl[jj]=data2[j];  } fourl(fftl,n,1); fft2[l]-fftl[2]; fftl[2]=fft2[2]=0.0; f o r (j=3;j<=n+l;j+-2) { rep=0.5* ( f f t l [ j ] + f f t l [ n n 2 - j ] ) ; rem=0.5*(fftl[j]-fftl[nn2-j]); aip=0.5* ( f f t l [ j + l ] + f f t l [ n n 3 - j ] ) aim=0.5*(fftl[j+l]-fftl[nn3-j]) fftl[j]=rep; f f t l [ j+l]-=aim; fftl[nn2-j]=rep; f f t l [ n n 3 - j ] = -aim; fft2[j]=aip; f f t 2 [ j + l ] = -rem; fft2[nn2-j]-aip; fft2[nn3-j]=rem; } }  void  realft(data,n,isign)  float int  data[];  isign;  l o n g n; {  long i , i l , i 2 , i 3 , i 4 , n 2 p 3 ; float cl=0.5,c2,hlr,hli,h2r,h2i; d o u b l e wr,wi,wpr,wpi,vrt.emp,theta; void fourl(); theta=3.141592653589793/(double) if  ( i s i g n —> 1) { c2 0.5; fourl(data,n,l); } else { c2=0.5; theta =  -theta;  } wtemp=sin(0.5*theta);  n;  wpr = -2.0*wtemp*wtemp; wpi=sin(theta) ; wr=l.O+wpr; wi=wpi; n2p3=2*n+3; f o r (i=2;i<=n/2;i++) { i4=l+(i3=n2p3-(i2-l+(il=i+i-l))); hlr=cl*(data[il]+data[i3]); hli=cl*(data[i2)-data[i4]); h2r = - c 2 * ( d a t a [ i 2 ] + d a t a [ i 4 ] ) ; h2i=c2*(data[il]-data[i3]); data[il]=hlr+wr*h2r-wi*h2i; data[i2]=hli+wr*h2i+wi*h2r; data[i3]=hlr-wr*h2r+wi*h2i; d a t a [ i 4 ] «• -hli+wr*h2i+wi*h2r; wr=(wtemp=wr)*wpr-wi*wpi+wr; wi=wi*wpr+wtemp*wpi+wi;  ) if  ( i s i g n == 1) { d a t a f l ] = (hlr=data[1])+data[2] ; data[2] = h l r - d a t a [ 2 ] ; } else { data[l]-cl*((hlr=data[l])+data[2]) data[2]=cl*(hlr-data[2]) ; fourl(data,n,-1);  } ) • d e f i n e SWAP (a, b) tempr= (a) ; (a) •= (b) ; (b) =tempr void fourl(data,nn,isign) float data[]; int isign; l o n g nn;  { l o n g n,mmax,m,j,istep,i; d o u b l e wtemp,wr,wpr,wpi,wi,theta; f l o a t tempr,tempi; rr-nr.  1;  «  j - i ;  for  (i=l;i<n;i+=2) if  {  (j > i ) { SWAP(data[j],data[i]);  )  SWAP(data[j+l],data[i+1J);  m=n » 1; w h i l e ' ( m >= 2 && j > m) { j -= m; m »•= 1; } j += m;  ) mmax=2; w h i l e (n > mmax) { istep=2*mmax; theta=6.28318530717959/(isign*mmax  102 wtemp=sin(0.5*theta); wpr — -2.0*wtemp*wtemp; wpi=sin(theta); wr=l.0; wi=0.0; p r i n t f (" %d",mmax); f o r (m=l;m<mmax;m+=2) { f o r (i=m;i<=n;i+=istep) { j=i+mmax; tempr=wr*data[j]-wi*data t j+l] ; tempi=wr*data[j+l]+wi*data[j]; data[j]=data[i]-tempr; data[j+l]=data[i+1]-tempi; d a t a f i ] += tempr; d a t a [i+1] +•» tempi; } wr=(wtemp=wr)*wpr-wi*wpi+wr; wi=wi*wpr+wtemp*wpi+wi; } mmax=istep; } } #undef SWAP  103  /* s o u r t r a n . c */ /******************************************************/  /*  */  /* /* /*  SOURCE d a t a a c q u i s i t i o n program by G a r f i e l d Mellema O c t o b e r 21, 1988  */ */ */  /* /*******************************************  */  /* /* /* /* /* /* /* /* /*  T h i s program w i l l r e a d d a t a v a l u e s from a s p e c i f i e d f i l e and send t h o s e v a l u e s t o t h e DAC on t h e Computerscope c a r d i n s t a l l e d i n computer. The program w i l l a l s o i n i t i a l i z e , t r i g g e r , and c o l l e c t d a t a from t h e m u l t i p l e x e d ADC on t h e a f o r e m e n t i o n e d c a r d . The s e n d i n g o u t o f t h e f i l e d a t a and t h e c o l l e c t i o n o f t h e r e s u l t a n t d a t a i s r e p e a t e d 16 t i m e s and summed  */ */ */ */ */ */ */ */ */  /*  e a c h time f o r t h e r e d u c t i o n o f n o i s e i n t h e  */  /* /* /*  received data. The summed r e c e i v e d d a t a i s then s t o r e d i n a s p e c i f i e d f i l e . A speaker i s c o n n e c t e d t o t h e DAC and a microphone i s  */ */ */  /*  connected  */  /* /*  The i n t e n t o f t h i s program i s t o a i d i n f i n d i n g */ t h e t r a n s f o r m f u n c t i o n o f t h e speaker, */  /* /* /* /*  microphone, and a m p l i f i e r s setup. The o r i g i n a l d a t a f i l e i s r e a d once. The f u n c t i o n 'ecko' i s w r i t t e n i n assembly l a n g u a g e as t h e f i l e 'ecko.asm'.  t o t h e ADC, b o t h v i a a m p l i f i e r s .  */ */ */ */  /* */ /******************************************************/ /* /* /* /* /* /* /* /* /*  datain  - a p o i n t e r t o the beginning of t h e d a t a a c q u i s i t i o n c a r d memory samprate - t h e s a m p l i n g r a t e t o be u s e d by the data a c q u i s i t i o n card datasumt] - s t a c k e d d a t a sampled by t h e data a c q u i s i t i o n card d a t a o u t [ ] - c a l c u l a t e d s o u r c e s i g n a l t o be s e n t t h e d a t a a c q u i s i t i o n v i a Ecko  ./* /*********************************************  • i n c l u d e <stdio.h> • i n c l u d e <math.h> • i n c l u d e <dos.h> • d e f i n e MOD 0  main()  { unsigned char *datain; l o n g samprate;  */  /* use an o f f s e t o f 128 f o r t h e m o d i f i e d d a t a c a r d */ /* use an o f f s e t o f 0 f o r t h e u n m o d i f i e d d a t a c a r d */  e x t e r n v o i d e c k o ( i n t *, i n t ) ; u n s i g n e d i n t datasum[16384]; i n t dataout[23000]; void  */ */ */ */ */ */ */ */ */  104 u n s i g n e d i n t i , j , k; FILE * f i , * f i b , *fo, *fob;  d a t a i n = ( u n s i g n e d c h a r *)OxAOOOOOOO; /* s e t a p o i n t e r t o t h e s t a r t o f t h e d a t a c a r d memory */ /* use OxDOOOOOOO f o r t h e u n m o d i f i e d d a t a c a r d */ /* use OxAOOOOOOO f o r t h e m o d i f i e d d a t a c a r d */ samprate = 5 ; /* sampling r a t e i n m i c r o s e c o n d s */ f i = fopen("\\data\\inwave.prn", "w"); f i b = fopen("\\data\\inwave.bin", " r b " ) ; f o = f o p e n ("WdataWoutwave.prn", "w"); f o b = fopen ("\\dataWoutwave.bin", "wb"); i f ( f i b —= NULL | | f o == NULL | | f o b — NULL){ printf  ("\ *********** F i l e o p e n i n g e r r o r n  I * * * * * * * * * * " ) ;  exit(0); } p r i n t f ( " \ n r e a d i n g wavelet from f i l e \ n " ) ; f r e a d (dataout, s i z e o f ( i n t ) , 23000, f i b ) ; p r i n t f ( " \ n F i n i s h e d t a k i n g i n s o u r c e waveform"); o u t p (779 + MOD, 0); /* d i s a b l e d a t a a c q u i s i t i o n */ f o r (i=0; i<16; i++) /* t a k e d a t a from c h a n n e l 8 */ o u t p (784 + MOD, 7); /* c h a n n e l 8 i s t h e microphone */ /* use t h e t i m e r on t h e d a t a c a r d */ outp (785 + MOD, 0); t r i g g e r d a t a sampling from s o f t w a r e */ o u t p (776 + MOD, /* 0); 116); /* use mode 2 o f t h e i n t e r n a l t i m e r */ outp (775 + MOD, /* sample e v e r y (LSB) */ (samprate % 2 5 6 ) ) ; outp (773 + MOD, (samprate / 2 5 6 ) ) ; /* samprate m i c r o s e c o n d s (MSB) */ outp (773 + MOD, /* t a k e 1 sample a t a t i m e */ o u t p (775 + MOD, 50); o u t p (772 + MOD, l); o u t p (772 + MOD, 0); 178) ; /* s e t t h e p o s t - t r i g g e r i n g */ o u t p (775 + MOD, /* d e l a y t o 16384 words */ o u t p (774 + MOD, 0); /* i . e . t a k e 16384 d a t a p o i n t s */ o u t p (774 + MOD, 64); f o r (j=0; j<8192; j++) d a t a s u m f j ] - 0; p r i n t f ("\nReady t o t a k e d a t a b l o c k s " ) ; f o r (j=0; j<16; j++){ o u t p (789 + MOD, 0); /* manually s e l e c t d a t a bank B */ /* i . e . s t o r e d a t a p o i n t s i n b u f f e r A */ p r i n t f ("\nAbout t o c a l l e c k o " ) ; o u t p (795 + MOD, 06); /* s e t sample b u f f e r A t o 16384 words */ ecko  (dataout, 23000);  /* send out t h e s o u r c e waveform */ /* and i n i t i a t e d a t a a c q u i s i t i o n */  p r i n t f ("XnReturned from e c k o " ) ; f o r (i=0; i<2*samprate; i++) p r i n t f ( " \ n f i n i s h t a k i n g d a t a b l o c k %3d", j ) ; o u t p (788 + MOD, 0); /* r e a d t h e a c q u i r e d d a t a from bank A */ p r i n t f ("\nsumming d a t a b l o c k " ) ; f o r (k=0; k<16384; k++) /•* r e t r i e v e t h e a c q u i r e d d a t a */ /* n o t e t h a t i t i s s t o r e d i n r e v e r s e d b y t e o r d e r */ datasum[k] +«= d a t a i n [2*k] + 256 * d a t a i n [ 2 * k + l ] ; ) /* w r i t e t h e c o l l e c t e d d a t a t o a f i l e /* time(usee) printf  ("\nwriting source data t o a f i l e " ) ;  i n t h e format */  microphone p o i n t */  105 for  (i=0; i<23000; i+=4)  f p r i n t f {fi,"\n%101u %6u", ( i * s a m p r a t e ) , d a t a o u t [ i ] ) ; p r i n t f ( " \ n w r i t i n g summed d a t a b l o c k s t o f i l e " ) ; f o r (i=0; i<16384; i+=2) fprintf  (fo,"\n%101u %6u", ( i * s a m p r a t e ) ,  datasum[i]);  /* w r i t e t h e d a t a i n b i n a r y f o r f u r t h e r p r o c e s s i n g */ ( f w r i t e ( d a t a s u m , s i z e o f ( u n s i g n e d i n t ) , 16384, fob) != 16384) p r i n t f ("\n********** b i n a r y w r i t e e r r o r * * * * * * * * * * • ' ) ; fclose ( f i ) ; fclose (fib); fclose (fo); f c l o s e (fob); if  106 /* u i n t a s c i . c */  /*************************************************/ /* /* /* /*  */ */ */ */  a program t o c o n v e r t a f i l e o f b i n a r y Unsigned INTeger d a t a t o A S C I i format b y G a r f i e l d Mellema (December 1, 1988)  /* /*************************************************/  */  /* /* /* /* /* /* /* /* /*  */ */ */ */ */ */ */ */ */  T h i s program w i l r e a d a f i l e o f u n s i g n e d i n t e g e r d a t a i n b i n a r y format and r e w r i t e i t i n s i g n e d ASCII format. The s o u r c e f i l e s p e c i f i e d i n t h e command l i n e i s assumed t o be 125 s e t s o f 1860 v a l u e s . T h i s program was w r i t t e n f o r u s e w i t h t h e S y n t h e s e i s a c o u s t i c imaging system.  /it************************************************/ /* */ /* /* /* /*  max min zero  - minimum v a l u e o f t h e source d a t a - maximum v a l u e o f t h e s o u r c e d a t a - median v a l u e o f t h e s o u r c e d a t a  /*************************************************/  */ */ */ */  • i n c l u d e <stdio.h> unsigned v o i d main int  i n t datauint[1860]; (argc,  argv)  argc;  char  *argv[];  { u n s i g n e d i n t max, min; i n t i , j , k; f l o a t zero; FILE * f i b , * f o ; if  (argc < 3){ p r i n t f ("\nThe command l i n e format i s : \ n \ n " ) ; p r i n t f ("intasci sourcefilename destinationfilename\n\n"); exit(0);  } p r i n t f ("Source f i l e name i s % s \ n " , a r g v [ l ] ) ; p r i n t f ( " D e s t i n a t i o n f i l e name i s % s \ n " , a r g v [ 2 ] ) ; f i b = fopen ( a r g v [ l ] , " r b " ) ; f o = f o p e n ( a r g v [ 2 ] , "w"); i f ( f i b — NULL II f o -•» NULL) { p r i n t f ("*********** f i l e a c c e s s e r r r o r * * * * * * * * * * • • ) ; e x i t (0); ) zero = 0 ; max = 0; min — 65535; f o r (i=0; i<125; i++){ fread (datauint, sizeof(unsigned i n t ) ,  /* determine t h e parameters t o */ /* be used t o s c a l e t h e d a t a */  1860,  fib);  107 for  (j=0; j<1860; j++){ max = (max>datauint[j]) ? max min = ( m i n < d a t a u i n t [ j ] ) ? min z e r o += d a t a u i n t [ j ] ;  : datauint[j]; : datauint[j];  } p r i n t f ("Trace number %3d t e s t e d " , i ) ; p u t c h (13); ) /* rewind t h e s o u r c e f i l e and */ rewind (fib) ; /.* c a l c u l a t e t h e z e r o p o i n t */ z e r o /= 232500; /* 125 * 1860 = 232500 */ p r i n t f ("\nzero i s %8g\n", z e r o ) ; f o r (i=0; i<125; i++){ f r e a d ( d a t a u i n t , s i z e o f ( u n s i g n e d i n t ) , 1860, f i b ) ; f o r (j=1859; j>=0; j-=5){ f p r i n t f (fo, "\n"); /* w r i t e t h e new f i l e */ f o r (k=j; k>j-5; k — ) f p r i n t f ( f o , "%7.0f ", ( d a t a u i n t [ k ] - z e r o ) ) ; >  p r i n t f ("Trace number %3d c o n v e r t e d " , i ) ; p u t c h (13); ) }  108 /* wavegen.c */ /******************************************************/ /*  */  /*  swept f r e q u e n c y WAVEform GENeration  /*  by G a r f i e l d Mellema  program  */ */  /* November 1, 1988 */ /* */ /******************************************************/ /* */ /* T h i s program w i l l compute t h e v a l u e s t o be */ /* s e n t t o t h e DAC on t h e RC Computerscope d a t a */ /* a c q u i s i t i o n t o p r o d u c e a swept f r e q u e n c y */ /* sinewave. T h i s waveform i s n o r m a l l y sent t o */ /* t h e s p e a k e r on t h e t r o l l e y t o g e n e r a t e */ /* r e f l e c t i o n and d i f f r a c t i o n d a t a . Some s o u r c e */ /* p a r a m e t e r s a r e s p e c i f i e d as c o n s t a n t s , o t h e r */ /* a r e embedded i n t h e program. The i n s t a n t a e o u s */ /* frequency o f t h e s i g n a l i s c a l c u l a t e d along */ /* w i t h t h e s h a p i n g f a c t o r t o be u s e d a t each */ /* p o i n t a n d t h e y a r e combined t o produce one */ /* o f t h e stream o f v a l u e s o f t h e s o u r c e s i g n a l . */ /* */ /******************************************************/  /* /* /* /* /* /* /* /* /* /* •/* /* /*  - t h e amplitude f a c t o r o f t h e present source s i g n a l p o i n t frequency - t h e instanteous frequency o f the present source s i g n a l p o i n t - t h e phase a n g l e o f t h e p r e s e n t angle source s i g n a l p o i n t - t h e p o i n t number a t which t o end starttap the s t a r t i n g taper - t h e p o i n t number a t which t o b e g i n endtaper the ending t a p e r - a temporary v a r i a b l e spare  amplitud  */ */ */ */ */ */ */ */ */ */ */ */ */  /******************************************************/ • d e f i n e P I 3.1415926536 • d e f i n e ARASIZE 23000 •define Fstart  1.0  • d e f i n e F s t a p e r 1.2 • d e f i n e F e t a p e r 14.8 • d e f i n e F e n d 15.0 • d e f i n e VOLUME 1024  • d e f i n e SAMPRATE 333  • i n c l u d e <stdio.h>  k  t h e s i z e o f t h e waveform f i l e r e q u i r e d */ /* SOURTRAN.C r e q u i r e s 25000 p o i n t s */ /* t h e s t a r t f r e q u e n c y ( i n KHz) o f */ /* t h e swept f r e q u e n c y waveform */ /* t h e end f r e q u e n c y ( i n KHz) o f t h e */ /* t a p e r a t t h e s t a r t o f t h e waveform */ /* t h e s t a r t f r e q u e n c y ( i n KHz) o f */ /* t h e t a p e r a t t h e end o f t h e waveform */ /* t h e end f r e q u e n c y ( i n KHz) o f */ /* t h e swept f r e q u e n c y waveform */ /* t h e a m p l i t u d e o f t h e g e n e r a t e d */  /* waveform from 0 t o 2 * VOLUME /* t h e number o f samples p e r m i l l i s e c o n d /* o f t h e g e n e r a t e d waveform /* t h e ECKO.ASM r o u t i n e u s e d by SOURTRAN.C /* r e q u i r e s 333 p o i n t s p e r m i l l i s e c o n d  */ */ */ */ */  109 • i n c l u d e <math.h> • i n c l u d e <dos.h> int  point[ARASIZE];  v o i d main() { long i ; d o u b l e a m p l i t u d , f r e q u e n c y , a n g l e , s t a r t t a p , endtaper, FILE *fob;  spare;  p r i n t f ("\nswept f r e q u e n c y WAVEform G E N e r a t i o n program"); p r i n t f ("\nWritten by G a r f i e l d Mellema (November 1, 1988)"); fob = f o p e n ("d: W d a t a W i n w a v e . b i n " , "wb"); p r i n t f ( " \ n \ n \ n % 4 . 2 f t o %4.2f KHz swept f r e q u e n c y sinewave\n", F s t a r t , s t a r t t a p = ARASIZE * ( F s t a p e r - F s t a r t ) / (Fend - F s t a r t ) ; endtaper printf  = ARASIZE * (1 - (Fend - F e t a p e r )  ( " \ n s t a r t t a p i s %6.0f, e n d t a p e r  Fend);  / (Fend - F s t a r t ) ) ;  i s %6.0f\n",  starttap,  endtaper);  a n g l e = 0.0; for (i=0; K A R A S I Z E ; i++) { /* shape t h e waveform e n v e l o p e */ /*  a m p l i t u d = 1.00 - 1.0 * f a b s  ( ( i * 1.0 / ARASIZE) - 0.75);  */  s p a r e - 1.0 - f a b s ( ( i * 1.0 / ARASIZE) - 0 . 7 ) ; amplitud = spare * spare; /* a p p l y a c o s i n e t a p e r t o t h e s t a r t o f t h e waveform */ i f ( i < starttap) a m p l i t u d *= 0.5 * (1 - c o s (PI * i / s t a r t t a p ) ) ; /* a p p l y a c o s i n e t a p e r t o t h e end o f t h e waveform */ e l s e i f (i>endtaper) a m p l i t u d *•= 0.5*(1- c o s (PI * (ARASIZE - i ) / (ARASIZE - e n d t a p e r ) ) ) ; /* i n s t a n t a n e o u s f r e q u e n c y i n kHz */ f r e q u e n c y = F s t a r t + ( F e n d - F s t a r t ) * ( i * 1.0 / ARASIZE); i f ( f r e q u e n c y > 5.5 && f r e q u e n c y < 9.5) a m p l i t u d *= 1.0 + 0.1 * (9.5 - f r e q u e n c y ) ; a n g l e += f r e q u e n c y * PI * 2.0 / SAMPRATE; p o i n t [ i ] = ( a m p l i t u d * s i n (angle) + 1) * VOLUME;  ) printf  ("\nFiling points\n"); /* w r i t e t h e waveform d a t a i n b i n a r y f o r t h e waveform o u t p u t i f ( f w r i t e ( p o i n t , 2, ARASIZE, fob) != ARASIZE) p r i n t f (»\ ********** b i n a r y w r i t e e r r o r * * * * * * * * * * • • ) ;  r o u t i n e */  n  /* i f t h e g e n e r a t e d f i l e i s n o t a t l e a s t as b i g as t h e maximum */ /* SOURTRAN.C r e s u l t a n t f i l e , pad i t w i t h z e r o e s u n t i l i t i s */ if  (ARASIZE < 23000){ for (i=0; KARASIZE; i++) p o i n t [ i ] - VOLUME; for (i=ARASIZE; K 2 3 0 0 0 ; i+=ARASIZE) if  ( f w r i t e ( p o i n t , 2, ARASIZE, fob) !•= ARASIZE) p r i n t f (>'\ ********** b i n a r y w r i t e e r r o r n  } >  **********••);  

Cite

Citation Scheme:

    

Usage Statistics

Country Views Downloads
United States 8 1
Russia 5 0
China 4 5
United Kingdom 2 0
France 2 0
City Views Downloads
Unknown 8 4
Ashburn 4 0
Shenzhen 2 5
Saint Petersburg 2 0
Mountain View 2 0
Beijing 2 0
Buffalo 1 0

{[{ mDataHeader[type] }]} {[{ month[type] }]} {[{ tData[type] }]}
Download Stats

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0065444/manifest

Comment

Related Items