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 thesis in partial fulfilment of the requirements for an advanced degree at the University of British Columbia, I agree that the Library shall make it freely available for reference and study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the head of my department or by his or her representatives. It is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission. Department of E l e c t r i c a l Engineering The University of British Columbia Vancouver, Canada Date February 9, 1990 DE-6 (2/88) ABSTRACT ii 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 AT- compatible 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 scatter- mapping 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 s i g n a l , 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.1 Acoustic Imaging of Scattering 1 1.2 The Purpose of This Acoustic Imaging System 3 1.3 Previous Work on This System .4 1.4 Thesis Outline .4 2 THE SYSTEM SIGNAL PATH 6 2.1 The System Signal Path 6 2.2 Source Signal Calculation 6 2.3 Source Signal Generation 8 2.4 Translating Between Electrical and Acoustic Signals 9 2.5 Characteristics of an Acoustic Signal in Air 14 2.6 Scattering Due to Structures in the Target Region 16 2.7 The Relevance of Translation Characteristics 18 3 OTHER ASPECTS OF THE IMAGING SYSTEM 19 3.1 Repositioning the Transducers 19 3.2 Plotting of Acquired Data 22 3.3 Further Processing of Data 23 4 DEVELOPMENT OF A SUITABLE SOURCE SIGNAL 25 4.1 Characteristics of a Good Source Signal 25 4.2 Selection of a Usable Source Signal 26 4.3 Swept-Frequency Source Signal Description 29 4.4 Selection of a Suitable Swept-Frequency Source Signal 33 5 EVALUATION OF THE SYSTEM ON SOME SIMPLE MODELS 39 5.1 Target Region Description 39 5.2 The Vacant Target Region , „ , 39 5.3 A Half Plane 47 5.4 A 13 cm Step 47 5.5 A Plane Ending in a Rounded Edge of Constant Radius 53 5.6 A Small Edge 61 6 CONCLUSIONS 65 6.1 Summary 65 6.2 Areas for Future Development 65 REFERENCES 68 BIBLIOGRAPHY 70 APPENDIX A Software Used by This System 72 iv TABLE 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 ACKNOWLEDGEMENTS vi 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 I N T R O D U C T I O N 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 non- smooth 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 r e a l g e o p h y s i c a l s c a t t e r i n g reqnfred substantial s k i l l and r e s o u r c e s i n t h e c o n s t r u c t i o n 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 the time and 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 data- acquisition 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 sixteen times to 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 acoustic- imaging 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, f o l l o w e d in Chapter 5 b y s e v e r a l examples of scatter-mappings acquired from simple models. Chapter 6 discusses the relevance of the project and suggests some avenues for future improvements. 2 THE SYSTEM SIGNAL PATH 6 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 minimum time step 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 Source Signal Generation j Data Acquisition Card Sampling Received Signal Processing and Plotting Power Amplifier Bandpass Filter Amplifier 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 time- series 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 KHz, 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 V ; " >3£V V »>~ *̂  .'•.' * i »>.'-*10 •> • -Vt--: • *•* * C-'f- i v : -. •- v. : — -/ - v-'-.io - •* *i * H i .. ...;;,1000_ Fig. 2.3 Sound Pressure Level versus Frequency Response for the Loudspeaker LO 1 C C . T A l tt • • I V. \ V. c me ••FIE .0 1 1 f 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 0 5" 60! Pi ft" -> _ r T t 1 IV (fl 1 100 1000 10000 20000 Frequency H i 100 1000 10000 20000 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 the frequency of 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 vs is she velocity of the signal, y is the ratio of specific heats of air (1.402), p is die air pressure in kilopascals, and p is the density of air, which varies as P = 1.276 x 10"5p 1 + 0.00367 T (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 the time the 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 C 0.002 0.001 0.0005 0.0002 0.005 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 _ 2 * * / W e - ^ _ zRf(p)Je_^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 source- receiver 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 then- existence 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 data from each 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 the filed window 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 the finished data. The entire set of collected data was not filed due 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, a file could 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 median filter examines 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, the filter restricts the rate at which data may change in line with the filter. A time-median filter restricts the frequency components of a set of data. A space-median filter restricts 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-similar data points, three at a time, 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 in time of 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 signal time window. 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 I I I I I I I I I 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 I I I I 0 2000 4000 6000 8000 1 0 0 0 0 Time (microseconds) Fig. 4.1 A Calculated Pulse Source Signal 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 0 2000 4000 6000 8000 1 0 0 0 0 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 pre- distorted. 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 swept- frequency 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(t0) + ad(r) u(t-2r/v) (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 t0 is the time required for the signal to leave 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) = g(t) ® u(t0) + ad(r)g(t) ® u(t-2r/v). (4-2) Or, in the frequency domain, 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 (t0) + ad (r) 6{t- 2r/v) (4.4) 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 as(t) is the amplitude function, typically as(0 = A[u(ti) - u(f2)] (4.6) 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 i i 6{t) = ~ + 2ix J [cx + c 2 ( r - tx)) dr (4.7) 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) = a3 (t) cos [9 (t)} + ad (r) as (t - 2r/v) cos [9 (t - 2r/v)] ( 4-8) 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 Rgh{t) = J 9{r + t) h(r) dr (4.9) in the time domain. In the frequency domain, this is expressed as [14] (4.10) ngh = G(f)H*(f). Substituting in equation 4.3 makes the situation much clearer Tl9h = G(f)G*(f)K(f) (4.1D 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 swept- frequency 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(t0) + V] ad (rr) u(t - 2rr/v). 32 i—r I ' M 20000 i—i—i—i—i—i—|—i—i—r 40000 l—i—i—i—i—|—r 60000 T ime ( m i c r o s e c o n d s ) Fig. 4.3 A Calculated Swept-Frequency Source Signal | 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 0 20000 40000 60000 80000 T ime ( m i c r o s e c o n d s ) 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 I T 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.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(ta) = 52 ad(rr) u(t - 2rr/v)+^2 <*d(rd) u(t + 6d/u - 2rd/v) r=o 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 time- shifted 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, the final step 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 sweep time [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 (KHz) 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 16.0 20.0 Frequency (KHz) Fig. 4.7 Spectral Density of the Generated Waveform 38 100 i—i—i—|—i—r -4500 - 3 0 0 0 1—|—i—i—i—i—|—i—r - 1 5 0 0 0 I i i i r 1500 3000 4500 Time (microseconds) 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 - 2 5 0 - 2 0 0 - 1 5 0 - 1 0 0 - 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, scatter- mappings 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 reflection from the 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, appears from (0, 150) to (26, 163). Reflections from the east and west walls are expected from (0, 53) to (110, 163) and from (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 diffraction from the 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 reflection from the 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 g- 1/5 O O . 6 g £ 2- 8- o m- O •<t- o o VO- • v . . B!l! H I " v.-, """•Mr 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.4 Acoustic Scatter Mapping of the Vacant Target Region 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 the floor, 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] s o o c o_ o . o . ro O . -3- o . in O . Q 0_ O o £ 2 J 8- o m- O o O - v e - rt 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.8 Acoustic Scatter Mapping of the Half Plane Model o . o . CO O . o . o . S °- Vi O O H O N " __ O 13 o - 2 £ 2.1 8- o co- co o >/->- o V O - 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.9 Median Filtered Acoustic Scatter Mapping of the Half Plane Model 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 S - I—I 00 in a u o. 6 <=* S§- > rt 2 „ H 2 - 8- o C O - 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 g - C/5 0> o H 2. 3- o ro- O o in- O von 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 H o r i z o n t a l Transducer Offset F r o m Reference (cm) (g=7, c=3, s=a) Fig. 5.13 Median Filtered Acoustic Scatter Mapping of the 13 cm Step E o_ SZ Q . CD o 57 72 polished aluminum surface over a wood frame i I ..— .„.,,. .__ 4 5 ° / 147 190 Horizontal Tranducer Offset (cm) Fig. 5.14 Diagram of the Creeping Wave Test Model 58 CO - - C 3 cn - - C 3 - -CD CO Fig. 5.15 Expected Scattering Mapping of the Creeping Wave Test Model [19] 6 o. CN O . cn o. o. 8- 6 * £ o 13 o- cd £ 2 J o m- O .o </->- o - V O - ID 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.16 Acoustic Scatter Mapping of the Creeping Wave Test Model 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) 244 Fig. 5.18 Diagram of the Small Edge Model o . CN o . C O O . o. in fi o ci - o. Q s - cd U o t o « 2" t5 2 H 2"" o co- O O O 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.19 Acoustic Scatter Mapping of the Small Edge Model o . CN O . C O O . o . 8 8- o . 00 Q O . 00 oo a U o > ~ 2 H 2- 8- o C O - CO o m- o V O - 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.20 Median Filtered Acoustic Scatter Mapping of the Small Edge Model 65 6 C O N C L U S I O N S 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 scatter- mappings, in less than five hours, with sufficient accuracy to distinguish between diffraction- reflection 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 scatter- mapping within the given constraints of time, 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 n- phase 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 data from models 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 R E F E R E N C E S [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," Semi- annual 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. 1121- 1126, 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. ni l A.W. Trorey, "A Simple Theory for Seismic Diffractions," Geophysics, vol 35, pp. 762- 784, 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. 745- 762,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 Sub- Bottom 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: Addison- Wesley, 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 matrix PLOTting routines */ /* by G a r f i e l d Mellema */ /* November 16, 1988 */ /* */ /****************************************************/ /* */ /* This program w i l l , a f t e r asking the user a */ /* few relevant questions, p r i n t data read from */ /* a s p e c i f i e d f i l e . The data i n the f i l e must */ /* be arranged i n consecutive blocks of equal, */ /* s p e c i f i e d length. The blocks are p r i n t e d as */ /* a s e r i e s of l i n e graphs, each block a new */ /* l i n e . The l i n e graph lengths are scaled, as */ /* much as p o s s i b l e , to f i l l a p r i n t e r l i n e . */ /* T i t l e s may be included between the blocks */ /* and w i l l be p r i n t e d on the screen as the */ /* block i s being read. A t i t l e may be p r i n t e d */ /* at the top of the graphs. Portions of the */ /* data blocks may be skipped over, as well as */ /* groups of data blocks. The graphs are */ /* 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 amplitude i s s p e c i f i e d */ /* */ /****************************************************/ •in c l u d e <stdio.h> •in c l u d e <math.h> unsigned char l i n e s [14][16384]; unsigned i n t newdata[16384]; unsigned 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, scal e ; i n t i , j , k, 1, linenumb[16], t r a c l e n g , tracnumb, traceamp; i n t newline[5], skipleng, endleng, s k i p t r a c , base, bscale, escale; 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 ; p r i n t f ("\nMultiple t r a c e p l o t t i n g software"); p r i n t f ("\nwritten by G a r f i e l d Mellema (November 16, 1988)"); p r i n t f ("\n\nThis program w i l l read unsigned integer data (0-65535) from " ) ; p r i n t f ("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 the data as a s e r i e s of " ) ; p r i n t f ("adjacent traces on a\nRoland PR-1112 (or equivalent) p r i n t e r . " ) ; p r i n t f ("\n\nEnter the name of the source data f i l e \ n " ) ; scanf ("%s", filename); p r i n t f ("How many points are i n each t r a c e (maximum i s 16384)?\n"); scanf ("%d", Stracleng); i f (tracleng > 16384) t r a c l e n g = 16384; p r i n t f ("The f i r s t point read w i l l be number 0."); p r i n t f (" Begin p l o t t i n g at point number?\n"); scanf ("%d", Sskipleng); i f (skipleng > t r a c l e n g - 1 || skipleng < 0) skipl e n g = 0; p r i n t f ("Stop p l o t t i n g at point number?\n"); scanf ("%d", Sendleng); i f (endleng > t r a c l e n g - 1 || endleng < skipleng) endleng = t r a c l e n g - 1; p r i n t f ("How many tra c e s are i n the f i l e ? \ n " ) ; scanf ("%d", Stracnumb) ; p r i n t f ("Print every 'n'th t r a c e . What i s 'n'?\n"); scanf ("%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 traces should the maximum p o s i t i v e v a l u e " ) ; p r i n t f ("\nof each tra c e overlap? The maximum number i s 3.\n"); scanf ("%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 shading? (Y/N)\n"); scanf ("%s", g l o s c a l e ) ; i f (gloscale[0] !•=> 'Y' && gloscale[0] != 'y'){ f o r (i=0; i<=8; i++) twopow[0][i] = twopow[l][i]; } fputc (27, stdprn); /* i n i t i a l i z e */ fputc (64, stdprn); /* the p r i n t e r */ fputc (27, stdprn); /* set i t f o r */ fputc (77, stdprn); /* e l i t e type */ p r i n t f ("Do you wish to p r i n t a t i t l e above the p l o t ? (Y/N)\n"); scanf ("%s", g l o s c a l e ) ; i f (gloscale[0] «== 'Y' II gloscale[0] == 'y'){ p r i n t f ("Enter the t i t l e as you want i t p r i n t e d . To stop 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 with A . \ n " ) ; gets ( t i t l e ) ; f putc (27, stdprn); /* set the p r i n t e r f o r */ fputc (97, stdprn); /* centered p r i n t i n g */ fputc (1, stdprn); do { gets ( t i t l e ) ; i f ( t i t l e [0] !=• "") f p r i n t f (stdprn, "%s\n", t i t l e ) ; ) while ( t i t l e [ 0 ] != , A ' ) ; fputc (27, stdprn); /* set the p r i n t e r to begin */ fputc (97, stdprn); /* p r i n t i n g at the l e f t margin */ fputc (0, stdprn); } p r i n t f ("Do you want to p r i n t a scale above the p l o t ? (Y/N)\n"); scanf ("%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 normalized. Do you p r e f e r g l o b a l " ) ; p r i n t f ("scaling? (Y/N)\n">; scanf ("%s", g l o s c a l e ) ; globemax = -1; globemin = 65536; f i •= fopen (filename, "rb") ; i f ( f i == NULL){ p r i n t f ("\n*********** f i l e opening e r r o r * * * * * * * * * * * * * * * * * * * " ) ; 76 e x i t (0); } i f (gloscale[0] — ' Y' II gloscale[0] ~ 'y'){ p r i n t f ("Begin s c a l i n g at point number?\n"); scanf ("%d", Sbscale); p r i n t f ("End s c a l i n g at point number? \n"); scanf ("%d", Sescale); 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 ("Scaling t r a c e number %6d", i ) ; putch (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 ) ; /* read i n the data from the s p e c i f i e d f i l e and f i n d i t s minimum */ f o r (j="bscale; j o e s c a l e ; j++) { /* and maximum */ globemax — (globemax>newdata[j]) ? globemax : newdata[j]; globemin = (globemin<newdata[j]) ? globemin : newdata[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", globemin); } f p r i n t f (stdprn, "\n"); f o r (i=0; i<14; i++){ /* erase the t r a c e p l o t t i n g array */ f o r (j=0; j<16384; j++) l i n e s [ i ] [ j ] ~ 0; } f o r (i=0; i<16; i++) linenumbfi] - i ; fputc (27, stdprn); /* set paper feed to n/216 i n c h */ fputc (51, stdprn); fputc (24, stdprn); /* where n = 24 */ newline[0] •= 27; /* B i t image mode */ newline[1] =42; /* c a l i b r a t e d f o r 5 usee sampling at 331 m/s */ f p r i n t f (stdprn, "\n%41s DISTANCE (mm)\n", " " ) ; i f (endleng - skipleng < 464){ /* standard density graphics */ p r i n t f ("\n465 dpi graphics\n"); i f ( i f s c a l e t O ] — 'Y' II i f s c a l e [ 0 ] •== 'y'){ /* p r i n t a scale above */ " ) ; 372\n"); per l i n e */ f p r i n t f (stdprn,"\n 0 41 83 124 166 f p r i n t f (stdprn," 207 248 290 331 } newline[2] = 0; /* maximum 465 dots newline[3]=(endleng-skipleng+1) % 256; /* set the number of dots */ newline[4]=(endleng-skipleng+1) / 256; /* p r i n t e d per l i n e t o /* endleng - skipleng + 1 */ 77 */ " ) ; 745\n") e l s e i f (endleng-skipleng < 929){ p r i n t f ("\n930 dpi graphics\n"); i f ( i f s c a l e [ 0 ] — ' Y' II i f s c a l e f O ] f p r i n t f (stdprn,"\n 0 f p r i n t f (stdprn," 414 } /* double density graphics */ = 'y'){ /* p r i n t a scale above 83 166 248 331 497 579 662 /* newline[2] = 1; maximum 930 dots per l i n e */ newline[3] = (endleng-skipleng+1) % 256; /* set the number of dots */ newline[4]=(endleng-skipleng+1) / 256; /* p r i n t e d per l i n e t o */ } /* endleng - skipleng + 1 */ else{ graphics */ above */ " ) ; 1490\n"); } p r i n t f ("\nl860 dpi g r a p h i c s W ) ; i f ( i f s c a l e t O ) -= 'Y' II i f s c a l e [ 0 ) — 'y'){ f p r i n t f (stdprn,"\n 0 166 f p r i n t f (stdprn," 828 993 /* quad density /* p r i n t a scale 331 497 662 1159 1324 /* newline[2] =3; maximum 1860 dots per l i n e */ i f (endleng - skipleng > 1859) endleng «• skipleng + 1859; newline[3]=(endleng-skipleng+1) % 256; /* set the number of dots */ newline[4]=(endleng-skipleng+1) / 256; /* p r i n t e d per l i n e t o the */ ) /* the l e s s e r of 1872 and endleng-skipleng+1 */ i f ( i f s c a l e [ 0 ] | i f s c a l e [ 0 ] ~ *y'){ /* p r i n t a scale above */ fputc ( 27, stdprn); /* the p l o t , i f d e s i r e d */ fputc ( 42, stdprn); the p r i n t e r f o r double */ fputc ( 1, stdprn); density bit-mapped graphics */ fputc (192, stdprn); dots per l i n e */ fputc ( 3, stdprn); f o r (i=0; i<2 9; i++) fputc (0, stdprn); f o r (i=0; i<18; i++){ fputc (255, stdprn); f o r (j=0; j<4; j++){ f o r (k=0; k<4; k++) fputc ( 1, stdprn); fputc (15, stdprn); ) f o r (k=0; k<4; k++) fputc ( 1, stdprn); fputc (63, stdprn); f o r (j=0; j<4; j++){ f o r (k=0; k<4; k++) fputc ( 1, stdprn); •/* set /* /* 960 p r i n t a scale */ 78 fputc (15, stdprn); } f o r (k=0; k<4; k++) fputc ( 1, stdprn); } fputc (255, stdprn); f o r (j=0; j<4; j++){ f o r (k=0; k<4; k++) fputc ( 1, stdprn); fputc (15, stdprn); } f o r (k=0; k<4; k++) fputc ( 1, stdprn); fputc (63, stdprn); f o r (k=0; k<4; k++) fputc ( 1, stdprn); fputc (15, stdprn); } f o r (k=l; k<=tracnumb; k++){ tra c e s */ p r i n t f ("Reading tra c e number %6d putch (13); fre a d (newdata, sizeof(unsigned i n t ) , t r a c l e n g , f i ) ; i f (k % s k i p t r a c == 0){ f o r (i=0; i<16384; i++) { new bottom l i n e s */ lines[linenumb[12]][i] = 0; lines[linenumb[13]][i] = 0; } minamp = globemin; /* reset the minimum and */ maxamp = globemax; •/* maximum data values */ zero «• 0; f o r (j=skipleng; j<=endleng; j++){ and */ values */ /* s t a r t reading , k); /* read i n the data */ /* erase the /* f i n d the maximum /* minimum data maxamp •> (maxamp>newdata[j]) ? maxamp : newdata[j]; minamp = (minamp<newdata[j]) ? minamp : newdata[j]; zero += newdata[j]; data value */ } zero /= endleng - skipleng; i f (maxamp - zero > zero -.minamp) minamp = 2 * zero - maxamp; /* f i n d the average /* and scal e the data t o */ e l s e /* center on that value */ maxamp = 2 * zero - minamp; /* scale the data to f i t the des i r e d bounds */ scale " (16 + 32 * traceamp) * 0.995 / (1.0 + maxamp - minamp); /* center the sca l e d data i n the bounds */ base = 16 * (3 - traceamp); f o r (i=skipleng; i<=endleng; i++){ 79 /* scale the data t f i l l the a v a i l a b l e area */ newdata[i]=(unsigned int)((newdata[i]-minamp)*scale+base); } /* f o r (i=skipleng; i O e n d l e n g ; i++) { i f (newdata[i] > 103){ t h i s i s the zeroeth l i n e */ lines [ l i n e n u m b [ 0 ] ] [ i ] |= twopow[0][(int)(newdata[i] 104)]; the f i r s t l i n e */ 96) ]; the second l i n e */ 88) ] ; the t h i r d l i n e */ 80) ] ; the f o u r t h l i n e */ 72) ]; the f i f t h l i n e */ 64) ]; lines[linenumb[l] [i] |= twopow[0] [8]; lines[linenumb[2] [i] I= twopow[0] [8]; lines[linenumb[3] [i] I — twopow[0] [8]; 1ines[1inenumb[4] [i] | •» twopow [ 0 ] [8]; lines[linenumb[5] [i] | «• twopow [ 0 ] [8]; lines[linenumb[6] [i] I= twopow[0] [ 8 ] ; } e l s e i f (newdata[i] > 95 1ines[1inenumb[1] lines[linenumb[2] [i] |•= twopow[0] [ 8 ] ; lines[linenumb[3] [i] I= twopow[0] [8]; lines[1inenumb[4] ti ] |= twopow[0] [8]; lines[linenumb[5] ti ] |= twopow[0] [ 8 ] ; lines[1inenumb[6] [i] |— twopow[0] [8]; } e l s e i f (newdata[i] > 87 lines[linenumb[2] lines[linenumb[3] lines[linenumb[4] 1ines[1inenumb[5] lines[linenumb[6] ) e l s e i f (newdata[i] > 79 lines[linenumb[3] lines[1inenumb[4] l i n e s [linenumb[5] lines[1inenumb[6] ) e l s e i f (newdata[i] > 71 lines[linenumb[4] 1ines[1inenumb[5] lines[linenumb[6] e l s e i f (newdata[i] > 63 lines[linenumb[5] 1ines[1inenumb[6] ) { /* t h i s i s [i] |= twopow[0][ (int) (newdata[i] /* t h i s i s [i] |~ twopow[0][(int)(newdata[i] [i] |- twopow[0][8] t i ] I- twopow[0][8] [i] |° twopow[0][8] [i] |= twopowfO][8] { [i] /* t h i s i s twopow[0][ (int) (newdata[i] [i] |= twopow[0][8] [i] |= twopow[0][8] [i] |= twopow[0][8] { /* t h i s i s [i] |- twopow[0] [ (int) (newdata[i] [i] |= twopow[0][8]; [i] |= twopowfO][8]; { /* t h i s i s [i] |= twopow[0][ (int) (newdata[i] [i] |= twopow[0][8]; the s i x t h l i n e */ 56) ]; the seventh l i n e */ 48) ]; the eighth l i n e */ 40)]; the nineth l i n e */ 32)]; the tenth l i n e */ - 24)]; eleventh l i n e */ - 16)]; t w e l f t h l i n e */ - 8 ) ] ; 80 e l s e i f (newdata[i] > 55) /* t h i s i s line s [ l i n e n u m b [ 6 ] ] [ i ] |= twopow[0][ (int) (newdata[i] - e l s e i f (newdata[i] > 47) /* t h i s i s lines [ l i n e n u m b [ 7 ] ] [ i ] |= twopow[l][(int)(newdatafi] - e l s e i f (newdata[i] > 39) /* t h i s i s lines [ l i n e n u m b [ 8 ] ] [ i ] |= twopow[1][(int)(newdata[i] - e l s e i f (newdata[i] > 31) /* t h i s i s lines [ l i n e n u m b [ 9 ] ] [ i ] |= twopow[1][(int)(newdata[i] - e l s e i f (newdata[i] > 23) /* t h i s i s l i n e s [ l i n e n u m b f l O ] ] [ i ] |= twopow[l][(int)(newdata[i] e l s e i f (newdata[i] > 15) /* t h i s i s the lines[linenumb[11]][i] |= twopow[l] [(i n t ) (newdata[i] e l s e i f (newdata[i] > 7) /* t h i s i s the lines[linenumb[12]][i] |= twopow[l][(int)(newdata[i] e l s e /* t h i s i s the t h i r t e e n t h l i n e */ lines[linenumb[13]] [i] = twopow[1][(int)newdata[i]] , } /* p l o t the next data t r a c e */ fputc (13, stdprn); Carriage Return */ fputc (10, stdprn); Line Feed */ i f (k > (3 * skiptrac)) p r i n t the t r a c e number */ f p r i n t f (stdprn, "%3u", ( k - 3 * s k i p t r a c ) ) ; e l s e f p r i n t f (stdprn, " " ) ; f o r (j=0; j<-4; j++) /* prepare to p r i n t the f i r s t */ fputc (newline[j], stdprn); of the p l o t */ f o r (l=skipleng; Kendleng+1; 1++) fputc (lines[linenumb[0]][1], stdprn); fputc (13, stdprn); Carriage Return */ fputc (10, stdprn); Line Feed */ f p r i n t f (stdprn, " " ) ; f o r (j=0; j<=4; j++) /* prepare t o p r i n t the second */ /* /* /* /* h a l f l i n e /* /* 81 of the p l o t */ numbers */ fputc (newline[j], stdprn); /* h a l f l i n e f o r (l=skipleng; Kendleng+1; 1++) fputc (lines[linenumb[l]] [1], stdprn); linenumb[14] = linenumb[0]; linenumb[15] - linenumb[l]; /* s c r o l l up the l i n e f o r (i=0; i<14; i++) linenumb[i] — 1inenumb[i+2]; } ) f o r (i=0; i<12; i+=2){ fputc (13, stdprn); /* Carriage Return */ fputc (10, stdprn); /* Line Feed */ i f ( i < 6 && (2-tracnumb/skiptrac) < i/2 ) f p r i n t f (stdprn, "%3u", s k i p t r a c * (((k - 1) / skiptrac) + i/2 - 2 ) ) ; e l s e /* p r i n t the t r a c e number */ f p r i n t f (stdprn, " " ) ; f o r (j=0; j<=4; j++) /* prepare to p l o t a l i n e */ fputc (newline[j], stdprn); f o r (l=skipleng; Kendleng+1; 1++) /* p l o t the f i r s t h a l f l i n e */ fputc ( l i n e s [ l i n e n u m b [ i ] ] [ 1 ] , stdprn); fputc (13, stdprn); /* Carriage Return */ fputc (10, stdprn); /* Line Feed */ f p r i n t f (stdprn, " " ) ; f o r (j=0; j<=4; j++) /* prepare to p l o t a l i n e */ fputc (newline[j], stdprn); f o r (l=skipleng; Kendleng+1; 1++) /* p l o t the second h a l f l i n e */ fputc (lines[linenumb[i+1]][1], stdprn); ) fputc (13, stdprn); /* Carriage Return */ fputc (12, stdprn); /* F o r m Feed */ fputc (27, stdprn); /* r e i n i t i a l i z e */ fputc (64, stdprn); /* the p r i n t e r */ } * ecko.asm * ****************************************************** * * * ECKO waveform generation function * * by G a r f i e l d Mellema * * September 28, 1988 * * * ****************************************************** * * This program w i l l read data values from a * s p e c i f i e d array and send those values t o the * DAC on the Computerscope card 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 the aforementioned card t o begin * c o l l e c t i n g data as s p e c i f i e d by the 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 po i n t e r to the f i r s t * i n t e g e r i n the array, and the number of values * t o be sent s e q u e n t i a l l y from the array to the * DAC. * ****************************************************** ECKO_TEXT segment byte p u b l i c 'CODE' assume cs:ECKO TEXT _ecko proc f a r push bp ;save the o r i g i n a l l o c a t i o n of the stack mov bp. sp ;pointer t o r e t r i e v e the c a l l i n g data push ds push bx ;save the o r i g i n a l contents of r e g i s t e r s push cx ;which may be a l t e r e d during the fu n c t i o n push dx mov ds. word p t r [bp+8] ;set the data segment t o the array segment mov bx, word p t r [bp+6] / l o c a t i o n of source waveform data array mov cx. word p t r [bp+10] ;number of points i n the array mov dx, 781 / t r i g g e r data a c q u i s i t i o n system out dx. ax mov dx. 769 ;DAC port address c i i .•disable the i n t e r r u p t s while wordout: ;sending out the source waveform mov ax. tbx] ;get a number (two bytes) from out dx. ax ;the array and send i t t o the DAC i n c bx ;increment the array index f o r each byte i n c bx dec cx /decrement the number of bytes l e f t to send jnz wordout /continue sending numbers i f any remain s t i ;re-enable the i n t e r r u p t s pop dx pop cx /return a l t e r e d r e g i s t e r s pop bx /to t h e i r o r i g i n a l values pop ds pop bp r e t _ecko endp p u b l i c _ecko ECKO_TEXT ends end * * * * * * * * * * * * * 83 /* f l o t u i n t . c */ /*************************************************/ /* */ /* a program to convert a set of binary */ /* FLOaTing point data t o */ /* Unsigned INTeger data */ /* by G a r f i e l d Mellema (November 22, 1988) */ /* */ /*************************************************/ /* V /* This program w i l read a f i l e of f l o a t i n g V /* point data i n binary format and rewrite */ /* i t i n unsigned integer format. The */ /* source f i l e s p e c i f i e d i n the command */ /* l i n e i s assumed to be 125 sets of 1860 */ /* values. This program was written f o r */ /* use with the Syntheseis acoustic */ /* imaging system. */ /* */ /*************************************************/ /* */ /* max - minimum value of the source data */ /* min - maximum value of the source data */ /* sc a l e - scale f a c t o r used to f i t the */. /* data i n t o the range 0 to 65535 */ /* zero - median value of the source data */ /* */ /*************************************************/ •in c l u d e <stdio.h> f l o a t d ataflot[1860]; unsigned i n t datauint[1860]; v o i d main (argc, argv) i n t argc; char *argv[]; { double max, min, scale; i n t i , j ; FILE * f i b , *fob; i f (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 ( " f l o t u i n t sourcefilename destinationfilename\n\n"); e x i t ( 0 ) ; } p r i n t f ("Source f i l e name i s %s\n", a r g v f l ] ) ; p r i n t f ("Destination f i l e name i s %s\n", argv[2]); f i b = fopen ( a r g v [ l ] , " r b " ) ; fob = fopen (argv[2], "wb"); i f ( f i b •== NULL | | fob == NULL) { p r i n t f ("*********** f i l e access e r r r o r * * * * * * * * * * • • ) ; e x i t (0); } max = -3.4e38; /* determine the range of the source data */ 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 = (max>dataflot[j]) ? max : d a t a f l o t [ j ] ; min *» (min<dataflot[j]) ? min : d a t a f l o t [ j ] ; } p r i n t f ("Trace number %3d tested", i ) ; putch (13); } rewind ( f i b ) ; /* rewind the source f i l e and */ sc 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 " ) ; /* to f i t the data 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++){ /* write a new data f i l e */ fr 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, sizeof(unsigned i n t ) , 1860, fob) != 1860) p r i n t f (<'\n********** binary write e r r o r * * * * * * * * * * • • ) ; p r i n t f ("Trace number %3d converted", i ) ; putch (13); } f c l o s e ( f i b ) ; f c l o s e (fob); 85 /* l a s r p l o t . c */ /* */ /* LASeR p r i n t e r PLOTting program (.uib) /* w r i t t e n by G a r f i e l d Mellema /* A p r i l 1, 1989 */ /* */ /************************************************/ /* */ This program w i l l p l o t Syntheseis data on any P o s t s c r i p t p r i n t e r . I t asks a number of questions, with respect t o the de s i r e d p l o t parameters, of the user and uses the responses t o generate the d e s i r e d p l o t . The user choose to 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 - data to p l o t o f f s e t value c l i p - maximum t r a c e overlap c u t o f f endpoint - the l a s t p l o t t e d point i n a t r a c e endscale - gl o b a l s c a l i n g end point * f i d - po i n t e r to the source data f i l e *fps - po i n t e r to p o s t f i l e gain - maximum c a l c u l a t e d t r a c e overlap globemax - maximum source data value globemin - minimum source data value globzero - mean source data value g l o s c a l e - use gl o b a l s c a l i n g (Y/N) i n i p o i n t - p l o t t i n g s t a r t point i n i s c a l e - g l o b a l s c a l i n g s t a r t point maxamp - maximum trace data value minamp - minimum t r a c e data value numbtrac - number of traces t o be p l o t t e d point - present data point (x value) shade - shade technique (pos/neg/all/wig) */ 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 s c a l e - data to p l o t scale f a c t o r s k i p t r a c - t r a c e skip i n t e r v a l s o u r f i l e - source data f i l e t i t l e - the p l o t t i t l e t r a c l e n g - number of points i n each tr 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 of the p l o t page xmin - lower x l i m i t of the p l o t page xsc a l e - x axis scale f a c t o r (times 1/72") xspace - spacing between adjacent x events */ y a x t i t l e - the y - axis t i t l e ymax - upper y l i m i t of the p l o t page */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ 86 /* /* /* /* /* ymin y s c a l e yspace - lower y l i m i t of the p l o t page */ zero y axis scale f a c t o r (times 1/72") */ spacing between adjacent y events */ - mean value of the present t r a c e * / /********************* •inc l u d e <stdio.h> unsigned i n t sourdata[1860]; v o i d main () { char 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, globzero, maxamp, minamp; f l o a t point, scale, xscale, yscale, zero; i n t i , j , k, c l i p , copies, endpoint, endscale, gain, 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, yspace; p r i n t f ("\n\nLASeR p r i n t e r PLOTting program f o r use with the"); p r i n t f ("\nSyntheseis acoustic imaging system"); p r i n t f ( " W r i t t e n by G a r f i e l d Mellema (March 31, 1989)"); p r i n t f ("\n\nThis program w i l l read data from a .uib 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 to 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 the name of the source data f i l e A n " ) ; scanf ("%s", s o u r f i l e ) ; p r i n t f ("Enter the name of the 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 " ) ; scanf ("%s", p o s t f i l e ) ; p r i n t f ("How many points are i n each t r a c e (maximum 1860)?\n"); scanf ("%d", Stracleng); i f (tracleng > 1860 || t r a c l e n g < 1){ t r a c l e n g - 1860; p r i n t f ("\nA t r a c e length of 1860 points was assumed\n"); } p r i n t f ("The f i r s t point read w i l l be number 0\n"); p r i n t f ("Start p l o t t i n g at point number?\n"); scanf ("%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 ("\nPlottting w i l l s t a r t at point 0\n"); ) p r i n t f ("Plot up to, and include, point number?\n"); scanf ("%d", Sendpoint); i f (endpoint > 1859 || endpoint < i n i p o i n t ) { endpoint - 1859; p r i n t f ("Plotting w i l l end at point 1859\n"); } p r i n t f ("How many traces are i n the f i l e ? \ n " ) ; scanf ("%d", Snumbtrac); p r i n t f ("Skip every 'n'th t r a c e . What i s 'n'?\n">; scanf ("%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 shading, negative shading,"); p r i n t f ("\nabsolute shading or wiggle traces? (P/N/A/W)\n"); scanf ("%s", shade); 87 p r i n t f ("What i s the maximum t r a c e overlap (gain)?\n"); scanf ("%d", Sgain); p r i n t f ("At what overlap should the traces be clipped?\n"); scanf ("%d", S c l i p ) ; i f ( c l i p > gain || c l i p < 1) c l i p = gain; p r i n t f ("Enter the p l o t t i t l e \ n " ) ; gets ( t i t l e ) ; gets ( t i t l e ) ; p r i n t f ("Enter the x - axis legend\n"); gets ( x a x t i t l e ) ; p r i n t f ("Enter the y - axis legendNn"); gets ( y a x t i t l e ) ; p r i n t f ("How many copies of t h i s p l o t would you l i k e ? \ n " ) ; scanf ("%d", Scopies); 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 scaled.\n"); p r i n t f ("Would you p r e f e r g l o b a l scaling? (Y/N)\n">; scanf ("%s", g l o s c a l e ) ; globemax - 0; /* set the maximum and minimum data values */ globemin - 65535; /* just outside the allowable range */ f i d » fopen ( s o u r f i l e , " r b " ) ; fps - fopen ( p o s t f i l e , "w"); i f ( f i d — NULL || fps — NULL){ p r i n t f ("\n********** 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 selected, */ /* g l o b a l l y scale the source data set */ i f (gloscale[0] 'y* || gloscale[0] -= 'Y'){ p r i n t f ("Begin s c a l i n g at, and include, point number\n"); scanf ("%d", S i n i s c a l e ) ; p r i n t f ("End s c a l i n g at, and include, point number\n"); scanf ("%d", Sendscale) ; p r i n t f ("Begin s c a l i n g the source data\n"); k - 0; globzero - 0; f o r ( i = l ; i<=numbtrac; i++){ fread (sourdata, sizeof(unsigned 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 ("Scaling t r a c e number %d", i ) ; putch (13); k ++; sourdata[j], sourdata[j], f o r (j«=inipoint; j<=endpoint; j++) { globemax •» (globemax>sourdata[j]) ? globemax globemin =(globemin<sourdata[j]) ? globemin globzero += sourdata[j]; ) } globzero /= k * (float) (endpoint-inipoint+1) ; rewind ( f i d ) ; p r i n t f ("Xnglobemin i s % f " , globemin); p r i n t f ("\nglobemax i s % f " , globemax); 88 p r i n t f ("\nglobzero i s % f \ n " , globzero); } /* boundaries of the p l o t t i n g area i n 1/72" scale */ xmin = 90; xmax = 738; ymin = 108 ymax = 522 coordinates so the x and y */ /* rotate the page /* a x i s c o i n c i d e with the p l o t axis */ f p r i n t f (fps, "\n612 0 t r a n s l a t e 90 r o t a t e " ) ; f p r i n t f (fps, " \ n l s e t l i n e w i d t h " ) ; /* draw the page o u t l i n e */ f p r i n t f (fps, "\nnewpath 90 108 moveto 90 522 l i n e t o 738 522 l i n e t o " ) ; f p r i n t f (fps, "\n738 108 l i n e t o closepath stroke"); /* add a text centering procedure */ f p r i n t f (fps, "\n/centertext {dup stringwidth " ) ; f p r i n t f (fps, "pop -2 d i v 0 rmoveto show} d e f " ) ; /* add the p l o t t i t l e and the axis legends */ f p r i n t f (fps, "\n/Times-Roman f i n d f o n t 16 scalefont s e t f o n t " ) ; f p r i n t f (fps, "\n396 54 moveto (%s) centertext", t i t l e ) ; f p r i n t f (fps, "\n/Times-Roman f i n d f o n t 12 scalefont s e t f o n t " ) ; f p r i n t f (fps, "\n414 75 moveto (%s) centertext", x a x t i t l e ) ; f p r i n t f (fps, "\n66 315 moveto 90 rota t e " ) ; f p r i n t f (fps, " (%s) centertext -90 rotate", y a x t i t l e ) ; /* move the o r i g i n to the lower l e f t corner of the p l o t t i n g area */ f p r i n t f (fps, "\n%d %d t r a n s l a t e " , xmin, ymin); xmax -= xmin; ymax -= ymin; /* change the page s c a l i n g t o best f i t the p l o t s i z e */ xscale - 0 .01 * 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 the new p l o t t i n g area boundaries */ xmax /= xscale; ymax /= ys c a l e ; f p r i n t f (fps, "\n%6f %6f scale", xscale, y s c a l e ) ; /* add number centering procedures */ f p r i n t f (fps, "\n/Times-Roman f i n d f o n t 10 scalefont s e t f o n t " ) ; f p r i n t f (fps, "\n/xcenternumber {gsave %6f %6f ", 1/xscale, 1/yscale); f p r i n t f (fps, " s c a l e dup stringwidth pop -2 d i v 0 rmoveto " ) ; f p r i n t f (fps, "show grestore) d e f " ) ; f p r i n t f (fps, "\n/ycenternumber {gsave %6f %6f ", 1/yscale, 1/xscale); f p r i n t f (fps, " s c a l e dup.stringwidth pop -2 d i v 0 rmoveto " ) ; f p r i n t f (fps, "show grestore} d e f " ) ; 89 /* add the hashmarks and p o s i t i o n numbers on the 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 (fps, "\n%d 0 moveto 0 %d r l i n e t o stroke", i , ( i n t ) ( - 5 / y s c a l e ) ) ; f p r i n t f (fps, "\n%d %d moveto ", i , ( i n t ) ( - 1 5 / y s c a l e ) ) ; f p r i n t f (fps, "(%d) xcenternumber", ( i - 100 * c l i p - 50) / 50); ) /* add the hashmarks and p o s i t i o n numbers on the y ax i s */ f o r ( i - 1860; i > 0; i — 29){ i f (( (1889-i) % 116) •= 0){ f p r i n t f (fps, "\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 stroke"); } e l s e { f p r i n t f (fps, "\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 (fps, "stroke \n%d %d moveto ", (int) (-8/xscale), i ) ; f p r i n t f (fps, "90 rotate (%d) ", (int)(10*(1889-i)/116)); f p r i n t f (fps, "ycenternumber -90 r o t a t e " ) ; ) > minamp «• globemin; /* use the gl o b a l s c a l i n g l i m i t s */ maxamp = globemax; zero — globzero; i f ((maxamp - zero) > (zero - minamp)) minamp = 2 * zero - maxamp; e l s e maxamp — 2 * zero - minamp; /* add the p o s i t i v e shaping routine */ f p r i n t f (fps, "\n/posshade {dup 3 index gt (pop pop pop) " ) ; f p r i n t f (fps, "(1 index l i n e t o lineto} i f e l s e ) def " ) ; /* add the negative shaping routine */ f p r i n t f (fps, "\n/negshade {dup 3 index l t (pop pop pop) " ) ; f p r i n t f (fps, "{1 index l i n e t o l i n e t o ) i f e l s e ) def " ) ; /* p l o t the data */ for ( i = l ; i<=numbtrac; i++){ p r i n t f ("Reading t r a c e number %d", i ) ; putch (13); f r e a d (sourdata, sizeof(unsigned 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){ /* or determine the l o c a l s c a l i n g l i m i t s */ i f (gloscale[0J != 'Y' && gloscale[0] != 'y'){ zero =0; f o r ( j = inipoint; j<=endpoint; j++){ maxamp = (maxamp > sourdata[j]) ? maxamp : sourdata[j] sourdata[j] minamp = (minamp < sourdata[j]) ? minamp : zero += sour d a t a [ j ] ; } zero /«• (endpoint - i n i p o i n t + 1) ; i f ((maxamp - zero) > (zero - minamp)) 90 e l s e minamp = 2 * zero - maxamp; maxamp = 2 * zero - minamp; } /* c a l c u l a t e the data to p l o t s c a l e f a c t o r */ scal e = gain * 100.0 / (maxamp - minamp); base = 100 * ( i + c l i p ) - 50; f o r (j<=inipoint; j<=endpoint; j++) { /* s c a l e each data point and ensure */ /* i t i s within the c l i p p i n g range */ point = (sourdata[j] - zero) * scal e ; point = (point < ( c l i p * 100)) ? point : ( c l i p * 100); point = (point > (- c l i p * 100)) ? point : (- c l i p * 100); point += base; /* put i t on the p o s t s c r i p t stack */ i f ( ( 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) f p r i n t f (fps, " \ n % l d " , (long)point); e l s e f p r i n t f (fps, " % l d " , (long)point); } else{ /* p l o t the data on the stack */ f p r i n t f (fps, " \ n % l d %d moveto", (long)point, j - i n i p o i n t ) ; i n i p o i n t - 4 0 0 ) ; f p r i n t f (fps, "\n%d -1 %d ", j - i n i p o i n t - 1 , j - (long)base) (long)base), /* p o s i t i v e shading */ i f (shade[0] — 'P' || shade[0] — 'p'H f p r i n t f (fps, "{2 copy l i n e t o % l d ", f p r i n t f (fps, "posshade) f o r str o k e " ) ; /* negative shading */ ) e l s e i f (shade[0] ~ 'N' || shade[0] == 'n'H f p r i n t f (fps, "{2 copy l i n e t o % l d ", f p r i n t f (fps, "negshade) f o r str o k e " ) ; (long)base), s t r o k e " ) ; /* absolute shading */ ) e l s e i f (shade[0] — 'A' || shade[0] — 'a'){ f p r i n t f (fps, "(2 copy l i n e t o % l d ", f p r i n t f (fps, "1 index l i n e t o l i n e t o ) f o r ) e l s e /* no shading */ f p r i n t f (fps, " ( l i n e t o ) f o r stroke"); f p r i n t f (fps, " \ n % l d " , (long)point); } } /* clean up anything l e f t on the stack */ f p r i n t f (fps, " %d moveto", j - i n i p o i n t - 1 ) ; 91 f p r i n t f (fps, "\n%d -1 ", j - i n i p o i n t - 2 ) ; f p r i n t f (fps, "%d ", ( j - i n i p o i n t - ( ( j - i n i p o i n t ) % 400))); i f (shade[0] =- 'P' || shade[0] == 'p'H f p r i n t f (fps, "(2 copy l i n e t o % l d posshade) ", (long)base); f p r i n t f (fps, " f o r stroke"); } e l s e i f (shade[0] ~ 'N' || shade[0] >=>= 'n*){ f p r i n t f (fps, "{2 copy l i n e t o % l d negshade} ", (long)base); f p r i n t f (fps, " f o r stroke"); } e l s e i f (shade[0] 'A' || shade[0] == 'a'){ f p r i n t f (fps, "(2 copy l i n e t o % l d 1 index ", (long)base); f p r i n t f (fps, " l i n e t o l i n e t o ) f o r st r o k e " ) ; } e l s e f p r i n t f (fps, " ( l i n e t o ) f o r stroke"); ) ) /* wrap up the p l o t and the program */ i f (copies > 1) f p r i n t f (fps, "\n/#copies %d def", copies); f p r i n t f (fps, "\nshowpage\n"); f c l o s e ( f i d ) ; f c l o s e (fps); ) 92 /* median3.c */ /********************************************************** /* '*/ /* a program t o 3-point space MEDIAN f i l t e r a set of binary unsigned */ /* i n t e g e r data */ /* */ /* by G a r f i e l d Mellema (January 11, 1989) */ /* */ /***************************************************** /* */ /* This program w i l l examine three traces of data at a time from */ /* the f i r s t f i l e s p e c i f i e d i n the command l i n e and determine the */ /* median value, at each point, of the data. This value i s then */ /* subtracted from the center t r a c e i n an attempt to remove */ /* h o r i z o n t a l l y r e c u r r i n g a r t i f a c t s from the image stored i n the */ /* f i l e . The values subtracted from the f i r s t and l a s t traces of */ /* the image w i l l be the same as those subtracted from the second */ /* and second l a s t r e s p e c t i v e l y . The r e s u l t s of t h i s process w i l l */ /* be stored i n the second f i l e s p e c i f i e d i n the command l i n e . This */ /* program assumes that the f i l e being f i l t e r e d i s a standard s i z e */ /* Syntheseis image f i l e , that i s 125 traces of 1860 poi n t s . They */ /* are read one at a time and are rotated i n the array datauint by */ /* successive s h i f t s of the array i n d i c e s stored i n the array i s l i n e . */ /* */ /******************************************^ /* */ /* d a t a u i n t [ ] [ ] - unsigned integer raw data */ /* f i l t e r e d [ ] ~ f i l t e r e d v e r s ion of the present t r a c e */ /* i s l i n e [] - datauint array presently a c t i n g as the present t r a c e */ /* median[] - median of present and immediately adjacent t r a c e s */ /* temp - median f i l t e r e d value of the present point */ /* value[] - present and immediately space adjacent points */ /* zero - the average value of the image being f i l t e r e d */ / * * / /****************************************************** •include <stdio.h> unsigned i n t datauint[3][1860], f i l t e r e d [ 1 8 6 0 ] , median[1860]; v o i d main (argc, argv) i n t argc; char *argv[] ; { unsigned i n t value[3], extra; i n t i , j , k, 1, i s l i n e [ 4 ] ; f l o a t zero, temp; FILE * f i b , *fob; i f (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 ("median3 sourcefilename.uib destinationfilename.uib\n\n"); e x i t ( 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 ("Destination f i l e name i s %s\n", argv[2]); f i b = fopen ( a r g v [ l ] , " r b " ) ; 93 fob = fopen (argv[2], "wb"); i f ( f i b = NULL | | fob •== NOLL) { p r i n t f ("*********** f i l e access e r r r o r * * * * * * * * * * • • ) ; e x i t (0); } f o r (i=0; i<125; i++){ fr e a d (datauint, sizeof(unsigned i n t ) , 1860, f i b ) ; f o r (j=0; j<1860; j++) zero += ( f l o a t ) d a t a u i n t [ 0 ] [ j ] ; p r i n t f ("Trace number %3d considered", i ) ; putch (13); } zero /= 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++) i s l i n e [ i ] - i ; f r e a d (Sdatauint[0][0], sizeof(unsigned i n t ) , 1860, f i b ) ; f r e a d (&datauint[1][0], sizeof(unsigned i n t ) , 1860, f i b ) ; f o r (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 ] , sizeof(unsigned i n t ) , 1860, f i b ) ; f o r (j=0; j<1860; j++){ /* f o r each point of each t r a c e */ /* load s i m i l a r point values */ value[0] - d a t a u i n t [ i s l i n e [ 0 ] J [ j ] ; v a l u e [ l ] = d a t a u i n t [ i s l i n e [ 1 ] J [ j ] ; value[2] = d a t a u i n t [ i s l i n e [ 2 ] ] [ j ] ; i f (value [1] > value [0]){ extra «• value [1]; value [1] = value [0]; value [0] = extra; } i f (value [2] > value [1])( extra - value [2]; value [2] = value [1]; value [1] = extra; } i f (value [1] > value [0]){ extra = value [1 ] ; value [1] = value [0]; value [0] = extra; } median[j] — value[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 value i s too small %6f ", 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 value i s too large % f ", temp); p r i n t f ("at %d %d", i , j ) ; temp = 65535; } f i l t e r e d [ j ] = (unsigned int) temp; 94 } i f (i==l){ f o r (j-=0; j<1860; j++) { /* f o r each point of each tra c e */ /* load s i m i l a r point values */ temp = ( f l o a t ) d a t a u i n t [ i s l i n e [ 1 ] ] [ j ] -(float)median[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 value i s too small % 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 value i s too large % f ", temp); p r i n t f ("at %d %d", i , j ) ; temp = 65535; ) f i l t e r e d ! j ] •= (unsigned int) temp; } } e l s e i f (i==123){ fr e a d ( S d a t a u i n t [ i s l i n e [ 2 ] ] [ 0 ] , sizeof(unsigned i n t ) , 1860, f i b ) ; f o r (j=0; j<1860; j++){ /* f o r each point of each t r a c e */ value[0] *» d a t a u i n t [ i s l i n e [ 0 ] ] [ j ] ; v a l u e [ l ] - d a t a u i n t [ i s l i n e [ 1 ] ] [ j ] ; value[2] = d a t a u i n t [ i s l i n e [ 2 ] ] [ j ] ; i f (value [1] > value [0]){ extra - value [1]; value [1] •» value [0]; value [0] = extra; } i f (value [2] > value [1]){ extra «= value [2] ; value [2] •= value [1]; value [1] = extra; } ' • i f (value [1] > value [0]){ extra — value [1]; value [1] - value [0]; value [0] «• extra; } median[j] — value[1]; 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 value i s too small % 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 value i s too large % f ", temp); p r i n t f ("at %d %d", i , j ) ; temp «• 65535; > f i l t e r e d f j ] - (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 point of each trace */ /* load s i m i l a r point values */ temp = ( f l o a t ) d a t a u i n t [ i s l i n e [ 2 ] ] [ j ] -(float)median[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 value i s too small % 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 value i s too large % f ", temp); p r i n t f ("at %d %d", i , j ) ; temp = 65535; ) f i l t e r e d ! 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 ] , sizeof(unsigned i n t ) , 1860, f i b ) ; f o r (j=0; j<1860; j++){ /* f o r each point of each tr a c e value[0] — d a t a u i n t [ i s l i n e [ 0 ] ] [ j ] ; v a l u e [ l ] = d a t a u i n t [ i s l i n e [ 1 ] ] [ j ] ; value[2] = d a t a u i n t [ i s l i n e [ 2 ] ] [j] ; i f (value [1] > value [0]){ extra >= value [1]; value [1] = value [0]; value [0] «» extra; } i f (value [2] > value [1]){ extra - value [2]; value [2] = value [1]; value [1] = extra; > i f (value [1] > value [0]){ extra = value [1]; value [1] = value [0]; value [0] — extra; } 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 value i s too small % 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 value i s too large % f ", temp); p r i n t f ("at %d %d", i , j ) ; temp •» 65535; > f i l t e r e d [ j ] = (unsigned int) temp; ) ) i f ( 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]; } i f ( f w r i t e ( f i l t e r e d , sizeof(unsigned i n t ) , 1860, fob) != 1860) p r i n t f ("\n********** binary write e r r o r * * * * * * * * * * • • ) ; p r i n t f ("Trace number %3d f i l t e r e d " , i ) ; putch (13); ) f c l o s e ( f i b ) ; f c l o s e (fob); 9 6 /* multrace.c */ /******************************************** /* */ /* MULtiple TRACE data a c q u i s i t i o n program */ /* by G a r f i e l d Mellema */ /* February 16, 1989 */ /* */ /************************************************** /* */ /* T h i s program w i l l read data values from a */ /* s p e c i f i e d f i l e and send those values to the */ /* DAC on the Computerscope card 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 data from the multiplexed */ /* ADC on the aforementioned card. The sending */ /* out of the f i l e data and the c o l l e c t i o n of the */ /* r e s u l t a n t data i s repeated 16 times and summed */ /* each time f o r the reduction of noise i n the */ /* r e c e i v e d data. The 16384 points of 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 */ /* frequency domain with a p r e v i o u s l y made */ /* recording of the source using a Fast F o u r i e r */ /* Transform taken from the book Numerical Recipes */ /* i n C by Pres et. a l . The r e s u l t a n t waveform i s */ /* windowed and stored i n the f i l e s p e c i f i e d i n */ /* the program command l i n e . */ /* This program makes use of the f i l e s */ /* inwave.bin and refwave.uib which store the */ /* source and c o r r e l a t i o n reference waveforms */ /* r e s p e c t i v e l y . */ /* */ /******************************************************/ / * . . . •• * / /* SAMPRATE - ADC sampling rate i n microseconds */ /* ARASIZE - c o l l e c t e d dataset s i z e */ /* refwave[] - c o r r e l a t i o n reference waveform */ /* datasumU - the stacked received data */ /* finwave[] - datasum[] centered around zero */ /* autox[] - the c r o s s c o r r e l a t e d data */ /* xetra[] ~ an e x t r a c r o s s c o r r e l a t i o n array */ /* dataout[] - the source s i g n a l as DAC values */ /* d a t a i n - p o i n t e r t o the ADC data b u f f e r */ /* o f f s e t - the average value of datasum[] */ /* s t a r t - time structures t o */ /* stop - 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> •inc l u d e <dos.h> •inc l u d e <time.h> •define SAMPRATE 5 •define ARASIZE 16384 /* data sampling rate i n microseconds */ /* ARASIZE i s the input dataset s i z e */ /* 16384 i s the maximum allowable s i z e */ 97 f l o a t refwave[ARASIZE], finwave[ARASIZE], autox[2*ARASIZE], xetra[2*ARASIZE]; extern v o i d e c k o ( i n t *, i n t ) ; unsigned i n t datasum[ARASIZE] ; i n t dataout[23000]; v o i d main (argc, argv) i n t argc; char * a r g v [ ] ; { unsigned char *datain; unsigned 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; /* set a p o i n t e r t o the s t a r t of the datacard memory */ datain = (unsigned char *)OxAOOOOOOO; /* check that the d e s t i n a t i o n filename has been supplied */ i f (argc < 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 destinationfilename\n\n"); e x i t ( 0 ) ; } p r i n t f ("\nThe d e s t i n a t i o n filename i s %s", a r g v [ l ] ) ; /* open the necessary f i l e s and read i n the source wavelet */ f i a = fopen("\\synseis\\inwave.bin", " r b " ) ; f i b = fopen("\\synseis\\refwave.flb", " r b " ) ; fob - fopen(argv[1], "wb"); i f ( f i a — NULL || f i b == NULL || fob — NULL){ p r i n t f ("\n*********** F i l e opening e r r o r * * * * * * * * * * • • ) ; e x i t ( 0 ) ; ) p r i n t f ( " \ n r e a d i n g source 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 ("\nFinished taking i n source waveform"); /* set up the data a c q u i s i t i o n card to c o l l e c t the returning waveform */ outp (779, 0); f o r (i=0; i<16; i++) outp (784, 7); outp (785, 0); outp outp outp outp outp (776, (775, (773, (773, (775, outp (772, outp (772, 0) ; 116); (SAMPRATE % 256)); (SAMPRATE / 256)); 50) ; 1) ; 0); /* d i s a b l e data a c q u i s i t i o n */ /* take data from channel 8 */ /* channel 8 i s the microphone */ /* use the timer on the data card */ /* t r i g g e r data sampling from software */ /* use mode 2 of the i n t e r n a l timer */ /* sample every (LSB) */ /* SAMPRATE microseconds (MSB) */ /* take 1 sample at a time */ 98 outp (775, 178); outp (774, 0); outp (774, 64); /* read the c r o s s c o r e l a t i o n reference /* i t to f l o a t i n g point, and subtract f r e a d (datasum, sizeof(unsigned i n t ) , o f f s e t •= 0.0; f o r (i=0; KARASIZE; i++) o f f s e t +•= ( f l o a t ) datasumfi] ; o f f s e t /= ARASIZE; f o r (i=0; i<ARASIZE; i++) refwavefi] = datasum[i] - o f f s e t ; /* set the p o s t - t r i g g e r i n g */ /* delay to 16384 words */ /* i . e . take 16384 data points */ waveform from refwave.uib, convert */ i t s mean to center i t around zero */ ARASIZE, f i b ) ; /* f i n d the mean of the waveform */ /* subtract i t from the waveform */ /* the f o l l o w i n g i s the major data c o l l e c t i o n loop */ /* i t cycles once per t r a c e ( t r o l l e y p o s i t i o n ) */ f o r (k=0; k<125; k++){ f o r (j=0; j<ARASIZE; j++) /* erase the received data array */ datasum[j] — 0; p r i n t f ("\nReady to take data p o s i t i o n %u", k); /* the f o l l o w i n g loop causes the source waveform to be transmitted */ /* and c o l l e c t s the returning waveform from the data a c q u i s i t i o n card */ f o r (j=0; j<16; j++){ outp (789, 0); /* manually s e l e c t data bank B */ •/* i . e . store data points i n b u f f e r A */ p r i n t f ("\nAbout to c a l l ecko"); outp (795, 06); /* set sample b u f f e r A to 16384 words */ ecko (dataout, 23000); /* send out the source waveform */ /* and i n i t i a t e data a c q u i s i t i o n */ p r i n t f ("\nReturned from ecko"); f o r (i=0; i<SAMPRATE*2; i++) p r i n t f ("\nfinish taking data block %3d p o s i t i o n %3d", j , k); outp (788, 0); /* read the acquired data from bank A */ p r i n t f ("\nsumming data b l o c k " ) ; f o r (i»0; KARASIZE; i++) /* r e t r i e v e the acquired data */ /* note that i t i s stored i n reversed byte order */ datasumfi] +•= datain[2*i] + 256 * datain [2*i+l] ; ) /* t h i s s e c t i o n moves the t r o l l e y 20 mm to the next t r a c e p o s i t i o n */ /* the t r o l l e y moves ,using a synchronous motor, at 2.5 sec/mm */ f o r (i=0; i<25; i++) /* use d i g i t a 1 switch #1 */ outp (794, 64); /* t o move the t r o l l e y WEST */ time ( S s t a r t ) ; p r i n t f ("\nMoving t r o l l e y . . " ) ; do time (Sstop); /* 0.416 mm / second */ while ( d i f f t i m e (stop, s t a r t ) < 48.0); /* 20 / 0.416 -= 48 seconds */ f o r (i=0; i<25; i++) 99 outp (794, 00); /* stop t r o l l e y */ p r i n t f ("\nStopping t r o l l e y . . . . " ) ; /* the mean of the stacked received data i s determined and */ /* subtracted t o y i e l d a f l o a t i n g point array centered around zero */ o f f s e t =0.0; f o r (i=0; KARASIZE; i++) o f f s e t += datasum[i]; /* f i n d the average value of */ o f f s e t /•= ARASIZE; /* the stacked received data */ p r i n t f ("\nThe o f f s e t i s % f " , o f f s e t ) ; f o r (i=0; KARASIZE; i++) finwave[i] = datasum[i] - o f f s e t ; /* attempt to zero the data */ /* the t r o l l e y i s given time t o come t o a complete */ /* stop during the fo l l o w i n g c r o s s c o r r e l a t i o n */ c o r r e l (refwave-1, finwave-1, (long)ARASIZE, autox-1, xetra-1); /* write the u s e f u l c r o s s c o r r e l a t e d data to a f i l e */ /* the relevant portions of the c r o s s c o r r e l a t e d data are */ /* written t o the f i l e s p e c i f i e d i n the 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********** binary write e r r o r * * * * * * * * * * • • ) ; i f (fwrite(autox, s i z e o f ( f l o a t ) , 468, fob) != 468) p r i n t f ("\n********** binary write e r r o r * * * * * * * * * * • • ) ; } f c l o s e ( f i a ) ; f c l o s e ( f i b ) ; f c l o s e (fob); ) /********************************************** /* */ /* The f o l l o w i n g program sections were taken from Numerical Recipes i n C */ /* i n C. No attempt i s made to document them as the aforementioned */ /* book does a superb job of t h i s rather complex task. */ /* */ /********************************************* v o i d c o r r e l ( d a t a l , d a t a 2 , n , a n s , f f t ) f l o a t d a t a l [ ] , d a t a 2 [ ] , a n s [ ] , f f t [ ] ; long n; { long no2,i; f l o a t dum; v o i d t w o f f t ( ) , r e a l f t ( ) ; p r i n t f ("\nDo a forward FFT"); t w o f f t ( d a t a l , d a t a 2 , f f t , a n s , n ) ; no2=n/2; f o r (i=2;K=n+2;i+=2) { a n s [ i - l ] = ( f f t [ i - 1 ] * ( d u m = a n s [ i - 1 ] ) + f f t [ i ] * a n s [ i ] ) / n o 2 ; a n s [ i ] = ( f f t [ i ] * d u m - f f t [ i - l ] * a n s [ i ] ) / n o 2 ; } ans[2]=ans[n+l]; p r i n t f ("\nDo an inverse FFT"); r e a l f t (ans, no2, -1) ; } v o i d t w o f f t ( d a t a l , d a t a 2 , f f t l , f f t 2 , n ) f l o a t d a t a l [ ] , d a t a 2 [ ] , f f t l [ ] , f f t 2 [ ] ; long n; { long nn3,nn2,jj,j; f l o a t rep,rem,aip,aim; v o i d f o u r l ( ) ; nn3=l+(nn2=2+n+n); f o r (j=l,jj=2;j<=n;j++,jj+=2) { f f t l t j j - l ] - d a t a l [ j ] ; f f t l [ j j ] = d a t a 2 [ j ] ; } f o u r l ( f f t l , n , 1 ) ; f f t 2 [ l ] - f f t l [ 2 ] ; f f t l [ 2 ] = f f t 2 [ 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 ] ) ; r e m = 0 . 5 * ( f f t l [ j ] - f f t l [ n n 2 - j ] ) ; aip=0.5* ( f f t l [ j + l ] + f f t l [ n n 3 - j ] ) a i m = 0 . 5 * ( f f t l [ j + l ] - f f t l [ n n 3 - j ] ) f f t l [ j ] = r e p ; f f t l [ j+l]-=aim; f f t l [ n n 2 - j ] = r e p ; f f t l [ n n 3 - j ] = -aim; f f t 2 [ j ] = a i p ; f f t 2 [ j + l ] = -rem; f f t 2 [ n n 2 - j ] - a i p ; fft2[nn3-j]=rem; } } v o i d r e a l f t ( d a t a , n , i s i g n ) f l o a t d a t a [ ] ; i n t i s i g n ; long n; { long i , i l , i 2 , i 3 , i 4 , n 2 p 3 ; f l o a t c l = 0 . 5 , c 2 , h l r , h l i , h 2 r , h 2 i ; double wr,wi,wpr,wpi,vrt.emp,theta; v o i d f o u r l ( ) ; theta=3.141592653589793/(double) n; i f ( i s i g n —> 1) { c2 0.5; f o u r l ( d a t a , n , l ) ; } e l s e { c2=0.5; t h e t a = -theta; } wtemp=sin(0.5*theta); 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 + ( i 3 = n 2 p 3 - ( i 2 - l + ( i l = i + i - l ) ) ) ; h l r = c l * ( d a t a [ i l ] + d a t a [ i 3 ] ) ; h l i = c l * ( d a t a [ i 2 ) - d a t a [ i 4 ] ) ; h2r = -c2*(data[i2]+data[i4]); h 2 i = c 2 * ( d a t a [ i l ] - d a t a [ i 3 ] ) ; data[il]=hlr+wr*h2r-wi*h2i; data[i2]=hli+wr*h2i+wi*h2r; data[i3]=hlr-wr*h2r+wi*h2i; data[i4] «• -hli+wr*h2i+wi*h2r; wr=(wtemp=wr)*wpr-wi*wpi+wr; wi=wi*wpr+wtemp*wpi+wi; ) i f ( 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 ] ; } e l s e { da t a [ l ] - c l * ( ( h l r = d a t a [ l ] ) + d a t a [ 2 ] ) data[2]=cl*(hlr-data[2]) ; fourl(data,n,-1); } ) • define SWAP (a, b) tempr= (a) ; (a) •= (b) ; (b) =tempr v o i d f o u r l ( d a t a , n n , i s i g n ) f l o a t d a ta[]; i n t i s i g n ; long nn; { long n,mmax,m,j,istep,i; double wtemp,wr,wpr,wpi,wi,theta; f l o a t tempr,tempi; r r - n r . « 1; j - i ; f o r (i=l;i<n;i+=2) { i f (j > i ) { SWAP(data[j],data[i]); SWAP(data[j+l],data[i+1J); ) m=n » 1; while'(m >= 2 && j > m) { j -= m; m »•= 1; } j += m; ) mmax=2; while (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; data [i+1] +•» tempi; } wr=(wtemp=wr)*wpr-wi*wpi+wr; wi=wi*wpr+wtemp*wpi+wi; } mmax=istep; } } #undef SWAP 103 /* sourtran.c */ /******************************************************/ /* */ /* SOURCE data a c q u i s i t i o n program */ /* by G a r f i e l d Mellema */ /* October 21, 1988 */ /* */ /******************************************* /* */ /* This program w i l l read data values from a */ /* s p e c i f i e d f i l e and send those values to the */ /* DAC on the Computerscope card 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 data from the multiplexed */ /* ADC on the aforementioned card. The sending */ /* out of the f i l e data and the c o l l e c t i o n of the */ /* r e s u l t a n t data i s repeated 16 times and summed */ /* each time f o r the reduction of noise i n the */ /* re c e i v e d data. The summed received data i s */ /* then stored i n a s p e c i f i e d f i l e . A speaker */ /* i s connected t o the DAC and a microphone i s */ /* connected t o the ADC, both v i a a m p l i f i e r s . */ /* The i n t e n t of t h i s program i s to a i d i n f i n d i n g */ /* the transform f u n c t i o n of the speaker, */ /* microphone, and a m p l i f i e r s setup. */ /* The o r i g i n a l data f i l e i s read once. */ /* The fu n c t i o n 'ecko' i s written i n assembly */ /* language as the f i l e 'ecko.asm'. */ /* */ /******************************************************/ /* */ /* da t a i n - a p o i n t e r t o the beginning of */ /* the data a c q u i s i t i o n card memory */ /* samprate - the sampling rate to be used by */ /* the data a c q u i s i t i o n card */ /* datasumt] - stacked data sampled by the */ /* data a c q u i s i t i o n card */ /* dataout[] - c a l c u l a t e d source s i g n a l to be */ /* sent the data a c q u i s i t i o n v i a Ecko */ ./* * / /********************************************* •include <stdio.h> •include <math.h> •include <dos.h> •define MOD 0 /* use an o f f s e t of 128 f o r the modified datacard */ /* use an o f f s e t of 0 f o r the unmodified datacard */ extern v o i d e c k o ( i n t *, i n t ) ; unsigned i n t datasum[16384]; i n t dataout[23000]; v o i d main() { unsigned char *datain; long samprate; 104 unsigned i n t i , j , k; FILE * f i , * f i b , *fo, *fob; datain = (unsigned char *)OxAOOOOOOO; /* set a poin t e r t o the s t a r t of the datacard memory */ /* use OxDOOOOOOO f o r the unmodified datacard */ /* use OxAOOOOOOO f o r the modified datacard */ samprate =5; /* sampling rate i n microseconds */ f i = fopen("\\data\\inwave.prn", "w"); f i b = fopen("\\data\\inwave.bin", " r b " ) ; fo = fopen ("WdataWoutwave.prn", "w"); fob = fopen ("\\dataWoutwave.bin", "wb"); i f ( f i b —= NULL | | fo == NULL | | fob — NULL){ p r i n t f ("\n*********** F i l e opening e r r o r I * * * * * * * * * * " ) ; e x i t ( 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 ("\nFinished taking i n source waveform"); outp (779 + MOD, 0); /* d i s a b l e data a c q u i s i t i o n */ fo r (i=0; i<16; i++) /* take data from channel 8 */ outp (784 + MOD, 7); /* channel 8 i s the microphone */ outp (785 + MOD, 0); /* use the timer on the data card */ outp (776 + MOD, 0); /* t r i g g e r data sampling from software */ outp (775 + MOD, 116); /* use mode 2 of the i n t e r n a l timer */ outp (773 + MOD, (samprate % 256)); /* sample every (LSB) */ outp (773 + MOD, (samprate / 256)); /* samprate microseconds (MSB) */ outp (775 + MOD, 50); /* take 1 sample at a time */ outp (772 + MOD, l ) ; outp (772 + MOD, 0); outp (775 + MOD, 178) ; /* set the p o s t - t r i g g e r i n g */ outp (774 + MOD, 0); /* delay to 16384 words */ outp (774 + MOD, 64); /* i . e . take 16384 data points */ f o r (j=0; j<8192; j++) datasumfj] - 0; p r i n t f ("\nReady to take data b l o c k s " ) ; f o r (j=0; j<16; j++){ outp (789 + MOD, 0); /* manually s e l e c t data bank B */ /* i . e . store data points i n b u f f e r A */ p r i n t f ("\nAbout t o c a l l ecko"); outp (795 + MOD, 06); /* set sample b u f f e r A to 16384 words */ ecko (dataout, 23000); /* send out the source waveform */ /* and i n i t i a t e data a c q u i s i t i o n */ p r i n t f ("XnReturned from ecko"); f o r (i=0; i<2*samprate; i++) p r i n t f ("\nfinish taking data block %3d", j ) ; outp (788 + MOD, 0); /* read the acquired data from bank A */ p r i n t f ("\nsumming data b l o c k " ) ; f o r (k=0; k<16384; k++) /•* r e t r i e v e the acquired data */ /* note that i t i s stored i n reversed byte order */ datasum[k] +«= datain [2*k] + 256 * datain[2*k+l]; ) /* write the c o l l e c t e d data to a f i l e i n the format */ /* time(usee) microphone point */ p r i n t f ("\nwriting source data to a f i l e " ) ; 105 f o r (i=0; i<23000; i+=4) f p r i n t f {fi,"\n%101u %6u", (i*samprate), d a t a o u t [ i ] ) ; p r i n t f ("\nwriting summed data blocks to f i l e " ) ; f o r (i=0; i<16384; i+=2) f p r i n t f (fo,"\n%101u %6u", (i*samprate), datasum[i]); /* write the data i n binary f o r f u r t h e r processing */ i f (fwrite(datasum, sizeof(unsigned i n t ) , 16384, fob) != 16384) p r i n t f ("\n********** binary write e r r o r * * * * * * * * * * • ' ) ; f c l o s e ( f i ) ; f c l o s e ( f i b ) ; f c l o s e ( f o ) ; f c l o s e (fob); 106 /* u i n t a s c i . c */ /*************************************************/ /* */ /* a program t o convert a f i l e of binary */ /* Unsigned INTeger data to ASCIi format */ /* by G a r f i e l d Mellema (December 1, 1988) */ /* */ /*************************************************/ /* */ /* This program w i l read a f i l e of unsigned */ /* i n t e g e r data i n binary format and rewrite */ /* i t i n signed ASCII format. The source */ /* f i l e s p e c i f i e d i n the command l i n e i s */ /* assumed t o be 125 sets of 1860 values. */ /* This program was wri t t e n f o r use with */ /* the Syntheseis acoustic imaging system. */ /* */ /it************************************************/ /* */ /* max - minimum value of the source data */ /* min - maximum value of the source data */ /* zero - median value of the source data */ /* */ /*************************************************/ • i n c l u d e <stdio.h> unsigned i n t datauint[1860]; v o i d main (argc, argv) i n t argc; char *argv[]; { unsigned i n t max, min; i n t i , j , k; f l o a t zero; FILE * f i b , * f o ; i f (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 ( " i n t a s c i sourcefilename destinationfilename\n\n"); e x i t ( 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 ("Destination f i l e name i s %s\n", argv[2]); f i b = fopen ( a r g v [ l ] , " r b " ) ; fo = fopen (argv[2], "w"); i f ( f i b — NULL II fo -•» NULL) { p r i n t f ("*********** f i l e access e r r r o r * * * * * * * * * * • • ) ; e x i t (0); ) zero =0; /* determine the parameters to */ max = 0; /* be used t o scale the data */ min — 65535; f o r (i=0; i<125; i++){ fr e a d (datauint, sizeof(unsigned i n t ) , 1860, f i b ) ; 107 f o r (j=0; j<1860; j++){ max = (max>datauint[j]) ? max : d a t a u i n t [ j ] ; min = (min<datauint[j]) ? min : d a t a u i n t [ j ] ; zero += d a t a u i n t [ j ] ; } p r i n t f ("Trace number %3d tested", i ) ; putch (13); ) /* rewind the source f i l e and */ rewind (fib) ; /.* c a l c u l a t e the zero point */ zero /= 232500; /* 125 * 1860 = 232500 */ p r i n t f ("\nzero i s %8g\n", zero); f o r (i=0; i<125; i++){ f r e a d (datauint, sizeof(unsigned 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"); /* write the new f i l e */ f o r (k=j; k>j-5; k — ) f p r i n t f (fo, "%7.0f ", (datauint[k]-zero)); > p r i n t f ("Trace number %3d converted", i ) ; putch (13); ) } 108 /* wavegen.c */ /******************************************************/ /* */ /* swept frequency WAVEform GENeration program */ /* by G a r f i e l d Mellema */ /* November 1, 1988 */ /* */ /******************************************************/ /* /* /* /* /* /* /* /* /* /* /* /* /* /* This program w i l l compute the values to be sent t o the DAC on the RC Computerscope data a c q u i s i t i o n t o produce a swept frequency sinewave. This waveform i s normally sent t o the speaker on the t r o l l e y to generate r e f l e c t i o n and d i f f r a c t i o n data. Some source parameters are s p e c i f i e d as constants, other are embedded i n the program. The instantaeous frequency of the s i g n a l i s c a l c u l a t e d along with the shaping f a c t o r t o be used at each point and they are combined t o produce one of the stream of values of the source s i g n a l . */ */ */ */ */ */ */ */ */ */ */ */ */ */ /******************************************************/ /* */ /* amplitud - the amplitude f a c t o r of the */ /* present source s i g n a l point */ /* frequency - the instanteous frequency of the */ /* present source s i g n a l point */ /* angle - the phase angle of the present */ /* source s i g n a l point */ /* s t a r t t a p - the point number at which t o end */ /* the s t a r t i n g taper */ /* endtaper - the point number at which t o begin */ •/* the ending taper */ /* spare - a temporary v a r i a b l e */ /* */ /******************************************************/ •define PI 3.1415926536 •define ARASIZE 23000 •define F s t a r t 1.0 •define Fstaper 1.2 •define Fetaper 14.8 •define Fend 15.0 •define VOLUME 1024 */ */ */ */ */ k the s i z e of the waveform f i l e required /* SOURTRAN.C requires 25000 points /* the s t a r t frequency (in KHz) of /* the swept frequency waveform /* the end frequency (in KHz) of the /* taper at the s t a r t of the waveform */ /* the s t a r t frequency (in KHz) of */ /* the taper at the end of the waveform */ /* the end frequency (in KHz) of */ /* the swept frequency waveform */ /* the amplitude of the generated */ •define SAMPRATE 333 •incl u d e <stdio.h> /* waveform from 0 t o 2 * VOLUME */ /* the number of samples per m i l l i s e c o n d */ /* of the generated waveform */ /* the ECKO.ASM routine used by SOURTRAN.C */ /* requires 333 points per m i l l i s e c o n d */ 109 •include <math.h> •include <dos.h> i n t point[ARASIZE]; v o i d main() { long i ; double amplitud, frequency, angle, s t a r t t a p , endtaper, spare; FILE *fob; p r i n t f ("\nswept frequency WAVEform GENeration program"); p r i n t f ("\nWritten by G a r f i e l d Mellema (November 1, 1988)"); fob = fopen ("d: WdataWinwave.bin", "wb"); printf("\n\n\n%4.2f to %4.2f KHz swept frequency sinewave\n", F s t a r t , Fend); s t a r t t a p = ARASIZE * (Fstaper - Fs t a r t ) / (Fend - F s t a r t ) ; endtaper = ARASIZE * (1 - (Fend - Fetaper) / (Fend - F s t a r t ) ) ; p r i n t f ("\nstarttap i s %6.0f, endtaper i s %6.0f\n", s t a r t t a p , endtaper); angle = 0.0; fo r (i=0; KARASIZE; i++) { /* shape the waveform envelope */ /* amplitud = 1.00 - 1.0 * fabs ( ( i * 1.0 / ARASIZE) - 0.75); */ spare - 1.0 - fabs ( ( i * 1.0 / ARASIZE) - 0 . 7 ) ; amplitud = spare * spare; /* apply a cosine taper to the s t a r t of the waveform */ i f ( i < starttap) amplitud *= 0.5 * (1 - cos (PI * i / s t a r t t a p ) ) ; /* apply a cosine taper to the end of the waveform */ e l s e i f (i>endtaper) amplitud *•= 0.5*(1- cos (PI * (ARASIZE - i ) / (ARASIZE - endtaper))); /* instantaneous frequency i n kHz */ frequency = F s t a r t + (Fend-Fstart) * ( i * 1.0 / ARASIZE); i f (frequency > 5.5 && frequency < 9.5) amplitud *= 1.0 + 0.1 * (9.5 - frequency); angle += frequency * PI * 2.0 / SAMPRATE; p o i n t [ i ] = (amplitud * s i n (angle) + 1) * VOLUME; ) p r i n t f ( " \ n F i l i n g points\n"); /* write the waveform data i n binary f o r the waveform output routine */ i f ( f w r i t e ( p o i n t , 2, ARASIZE, fob) != ARASIZE) p r i n t f (»\ n********** binary write e r r o r * * * * * * * * * * • • ) ; /* i f the generated f i l e i s not at l e a s t as b i g as the maximum */ /* SOURTRAN.C re s u l t a n t f i l e , pad i t with zeroes u n t i l i t i s */ i f (ARASIZE < 23000){ f o r (i=0; KARASIZE; i++) p o i n t [ i ] - VOLUME; f o r (i=ARASIZE; K23000; i+=ARASIZE) i f (fwrite (point, 2, ARASIZE, fob) !•= ARASIZE) p r i n t f (>'\n********** binary write e r r o r * * * * * * * * * * • • ) ; } >

Cite

Citation Scheme:

    

Usage Statistics

Country Views Downloads
United States 7 0
Russia 3 0
France 2 0
China 2 2
City Views Downloads
Unknown 6 3
Ashburn 3 0
Beijing 2 0
Mountain View 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