Wavelet Signal Analysis Of Cockpit Voice Recorder Data Wavelet Determination of Crashes: Paul Bauman David Hughling Chris Moore Sponsor: Dr. Ronald Stearman Wavelet Signal Analysis Of Cockpit Voice Recorder Data WDC Aeronautics: Paul Bauman David Hughling Chris Moore Sponsor: Dr. Ronald Stearman The University of Texas at Austin August 16, 2002 Report No. ASE463Q-FP1 ASE-EM Department The University of Texas at Austin Austin, TX 78712 MEMORANDUM WDC Aeronautics August 16, 2002 To: Dr. Ronald Stearman From: Paul Bauman pbauman@mail.utexas.edu David Hughling davidhughling@alumni.utexas.net Chris Moore sentinel@mail.utexas.edu Subject: Midterm Report This memorandum serves to introduce the attached final report entitled “Wavelet Signal Analysis of Cockpit Voice Recorder Data.” The following report is intended to inform the reader of WDC Aerospace’s efforts to explore the feasibility of wavelet analysis to investigate signals contained on the data tracks of a cockpit voice recorder. Due to the infancy of this project, a great deal of preliminary work has been required to prepare both the previously recorded data and the current wavelet computer codes to suit the needs of this project. The report that follows this memorandum records the details of our efforts. Should any questions arise, feel free to contact any of the team members via the above email addresses. Acknowledgements WDC Aeronautics would like to express our gratitude to the University of Texas School of Music for their efforts to make available their audio recording laboratory resources for our use. We would also like to thank Mr. Pete Moss of the University of Texas Music School for his services in transferring recordings of the cockpit voice recorder data to computer format. Additionally, our thanks go to Mr. Christopher Garland and Javier Fuentealba, who provided essential wavelet computer codes. Dr. Ronald Stearman also deserves our thanks for his ongoing assistance and understanding of this project. Finally, Mr. Jack Murphy, father of one of the pilots, receives our thanks for his services in providing the CVR tape and ongoing assistance to our research. Abstract WDC Aeronautics conducted Wavelet analysis of the cockpit voice recorder data from a Beech Aircraft 1900C that crashed in December of 1991. However, there is a great deal of speculation to the cause of the crash. The National Transportation and Safety Board stated that the crash was due to pilot error, while other investigations leaned towards the failure of a strut in the right engine mount that caused the right engine to separate from the aircraft and subsequently destroy the empennage. In this study, background research was conducted on the theory of wavelets in order to familiarize WDC Aeronautics with the capabilities of the wavelet transform, its applicability to this analysis, and which wavelet function would be most appropriate. Next, the data from the cockpit voice recorder tape was converted into a digital format to allow for manipulation in GoldWave and MatLab. Previously written wavelet analysis codes were used and altered to suit the specific needs of WDC Aeronautics in order to correctly conduct the wavelet analysis on the cockpit voice recorder data. To determine the effect of various input parameters on the wavelet output, several simple signals were developed and used to parameterize the input variables of the code so as to improve the accuracy and efficiency of the output of the code. Also employed for analysis of the silent track of the CVR was the spectrograph option in Goldwave. Goldwave’s spectrograph aided in not only the actual analysis, but also helped in verifying the output of the Matlab code. Analysis seems to indicate that a catastrophic mechanical failure occurred. One possibility is that excessive drag on the right engine due to the flight idle condition caused the buckling of an engine strut that led to the crash. Table of Contents 1 Introduction _______________________________________________________ 1 1.1 1.2 2 Background Theory ________________________________________________ 2 2.1 2.2 2.3 2.4 3 Cockpit Voice Recording Investigations __________________________ 12 DRAK Corporation ___________________________________________ 12 Preliminary Work _________________________________________________ 13 4.1 4.2 4.3 4.4 5 Fourier Analysis ______________________________________________ 2 Wavelet Analysis _____________________________________________ 6 Triboelectric Effect ____________________________________________ 9 Applications of Theory ________________________________________ 10 Previous Work ____________________________________________________ 12 3.1 3.2 4 Accident History ______________________________________________ 1 Project Goals _________________________________________________ 1 Program Development ________________________________________ Generation of Test Signals _____________________________________ Input Parameter Determination __________________________________ Signal Recording ____________________________________________ 13 16 18 24 Paramaterization Studies __________________________________________ 27 5.1 5.2 5.3 5.4 5.5 5.6 5.7 Scale Parameters _____________________________________________ Minimum Scale Size __________________________________________ Maximum Wavenumber _______________________________________ Tone Width _________________________________________________ Tone Resolution _____________________________________________ Edge Effects ________________________________________________ Memory Concerns ____________________________________________ 27 29 33 42 47 53 57 6 Goldwave Analysis ________________________________________________ 60 7 Wavelet Analysis __________________________________________________ 65 7.1 7.2 7.3 7.4 7.5 7.6 8 Propeller 1p Mode____________________________________________ 26 Hz Signal - Area Mike Analysis ______________________________ Wing Torsion Mode __________________________________________ Propeller 4p Mode____________________________________________ Right Turbine _______________________________________________ Crash Hypothesis ____________________________________________ 65 66 69 69 72 72 Work Distribution and Schedule _____________________________________ 74 8.1 8.2 Work Distribution ____________________________________________ 74 Work Schedule ______________________________________________ 74 9 Future Work _____________________________________________________ 76 10 Conclusions ____________________________________________________ 78 11 References _____________________________________________________ 79 Appendix A - MATLAB Wavelet.m File __________________________________ 80 Appendix B - MATLAB wave_bases.m File ________________________________ 83 Appendix C - MATLAB WLF.m File _____________________________________ 85 Appendix D - MATLAB wave10.m File ___________________________________ 88 Appendix E - MATLAB sigen1.m File ____________________________________ 95 Appendix F – Wavelet Analysis Plots _____________________________________ 97 List of Figures Figure 1 – Signal Aliasing [4] _____________________________________________ 5 Figure 2 - Morlet Mother Wavelet [5]______________________________________ 7 Figure 3 - Fourier Representation of the 'NBC' Tones ________________________ 8 Figure 4 - Wavelet Representation of the 'NBC' Tones _______________________ 9 Figure 5 - Triboelectric Effect [7] ________________________________________ 10 Figure 6 - Test Signals _________________________________________________ 17 Figure 7 - Fourier Representation of Modified 'NBC' Signal__________________ 19 Figure 8 - First Morlet Analysis of Modified 'NBC’ Signal ___________________ 20 Figure 9 - Second Morlet Analysis of Modified 'NBC' Signal _________________ 21 Figure 10 - Third Morlet Analysis of Modified 'NBC' Signal _________________ 22 Figure 11 - DOG Wavelet Analysis of Modified 'NBC' Signal _________________ 23 Figure 12 - Tape Transfer Setup _________________________________________ 26 Figure 13 - Relation Between Number of Scales and Signal Length ____________ 31 Figure 14 - Morlet Analysis of 5 Hz Tone, Wavenumber = 48 _________________ 33 Figure 15 - Morlet Analysis of 5 Hz Tone, Wavenumber = 12 _________________ 34 Figure 16 - Morlet Analysis of 5 Hz Tone, WPS Powerscale __________________ 35 Figure 17 - Morlet Analysis of 5 Hz Tone, Scale Size = .125 ___________________ 36 Figure 18 - Morlet Analysis of 100 Hz Tone, Wavenumber = 768 ______________ 37 Figure 19 - Morlet Analysis of 100 Hz Tone, Wavenumber = 192 ______________ 37 Figure 20 - Morlet Analysis of 5 Hz Tone, Wavenumber = 10 _________________ 39 Figure 21 - Morlet Analysis of 5 Hz Tone, Wavenumber = 9 __________________ 40 Figure 22 - Relation Between Critical Wavenumber and Frequency ___________ 40 Figure 23 - Morlet Analysis of 5 Hz Tone, Wavenumber = 17 _________________ 41 Figure 24 - Graphical Depiction of Tone Width ____________________________ 42 Figure 25 - Relation Between Tone Width and Wavenumber _________________ 45 Figure 26 - Relation Between Power Coeffcient and Frequency _______________ 46 Figure 27 - Relation Between Leading Coeffcient and Frequency ______________ 46 Figure 28 - Combined 50 Hz and 52 Hz Tone ______________________________ 48 Figure 29 - Beat Phenomenon Example ___________________________________ 49 Figure 30 - Absence of Beat Frequency ___________________________________ 49 Figure 31 - Single 50 Hz Tone Width, Wavenumber = 24 ____________________ 50 Figure 32 - Single 50 Hz Tone Width, Wavenumber = 92 ____________________ 51 Figure 33 - Single 52 Hz Tone Width, Wavenumber = 92 ____________________ 51 Figure 34 - Combined Tone, Wavenumber = 92 ____________________________ 52 Figure 35 - Graphical Depiction of Edge Effect Size _________________________ 54 Figure 36 - Relation Between Edge Effect Size and Wavenumber _____________ 55 Figure 37 - Relation Between Edge Effect Slope and Frequency _______________ 56 Figure 38 - Relation Between Edge Effect Y-Intercept and Frequency _________ 57 Figure 39 - Cruise Power Settings ________________________________________ 61 Figure 40 - Left Engine Failure __________________________________________ 62 Figure 41 - Landing Gear Noise _________________________________________ 62 Figure 42 - Left Engine Power Up ________________________________________ 63 Figure 43 - Right Engine Failure _________________________________________ 63 Figure 44 - Pass Band Filter _____________________________________________ Figure 45 - Wavelet Analysis of Silent Track, 5 Hz - 30 Hz ___________________ Figure 46 - Wavelet Analysis of Cockpit Area Mic, 18 Hz - 36 Hz _____________ Figure 47 - Wavelet Analysis of Silent Track, 30 Hz - 75 Hz __________________ Figure 48 - Wavelet Analysis of Silent Track, 75 Hz - 150 Hz _________________ Figure 49 - Wavelet Analysis of Silent Track, 4000 Hz - 4600 Hz ______________ Figure 50 - Work Schedule______________________________________________ 64 67 68 70 71 73 75 List of Tables Table 1 - Beech 1900C_CVR Master CD __________________________________ 25 Table 2 - CVR Key Events ______________________________________________ 60 Table 3 -CVR Key Frequencies __________________________________________ 64 1 Introduction 1.1 Accident History On December 28, 1991, a Beech Aircraft Corporation Beechcraft 1900C twin turboprop commuter airplane, tail number N811BE, departed for Block Island Airport for a series of training exercises [1]. On board were an instructor pilot and two other pilots who were preparing for an upgrade to the rank of captain. At approximately 9:46 P.M. EST, Boston Air Route Traffic Control Center lost radar contact with N811BE. The next morning, persons aboard a fishing vessel found part of an aircraft wing floating in the water off the coast of Block Island. Search and rescue crews later discovered the wreckage of N811BE and recovered the cockpit voice recorder (CVR). The National Transportation and Safety Board (NTSB) determined the probable cause of the accident to be “the instructor pilot’s loss of altitude awareness and possible spatial disorientation” [2]. However, extensive work by David McAllister, a former University of Texas aerospace undergraduate, previous ALPA investigations, and several wreckage inspection photographs, indicate that N811BE broke-up in-flight as a result of catastrophic failure of an engine mount [3]. 1.2 Project Goals The goal of WDC Aerospace (WDC) is to determine whether wavelet analysis procedures are capable of determining a characteristic “pop” signature produced by the in-flight failure of the right engine mount of N811BE. From our efforts, we hope to provide collaborating evidence supporting the theory that N811BE crashed as a result of an engine mount failure, and not the result of pilot error. 1 2 Background Theory 2.1 Fourier Analysis In engineering practice, a useful tool for analyzing periodic signals is the Fourier transform. This transformation allows for a signal in the time-domain to be converted to the frequency-domain (sometimes called Fourier Space). Once in the frequency domain, the frequencies that are present in the signal are clearly identifiable; this is very useful for analyzing steady-state signals and determining the frequency response of structures. Presented here are the theoretical aspects of the Fourier transform and some of the inherent disadvantages of the technique for frequency analysis in engineering applications. In harmonic analysis, one can build a signal by summing up different types of waves in what is known as a Fourier series. A Fourier series is constructed such that the signal y(t) is represented by y t A0 An cos nt Bn sin nt 2 n 1 (1) where An and Bn are the harmonic coefficients and the summation index n is the harmonic order [4]. In practice, however, it is often desirable not to build a signal with various waves, but instead to extract the frequencies of the waves that are contained within a signal. These frequencies can be extracted from the measured signal by calculating the harmonic coefficients through mathematical manipulation. That is, Bn An 2 0 2 0 y t cosnt dt y t sin nt dt 2 (2a,b) where is the circular frequency, y(t) is the measured signal, and n, again, represents the harmonic orders [4]. There are several different methods to quantify the coefficients in order to determine the most ‘powerful’ frequencies present in the signal. One such method would be to normalize the coefficients for each harmonic by Cn An 2 Bn 2 (3) and then plot Cn against each frequency; the greater the value of Cn, the more ‘powerful’ the frequency. While Fourier analysis is an excellent tool for analyzing periodic signals, there are many inherent drawbacks to the method. The first, and foremost, disadvantage when studying non-steady-state signals is that the time aspect of the signal becomes smeared in the transformation from the time space to Fourier space. This smearing occurs because of the inherent non-localization of the trigonometric functions in time. That is to say, there is no way to tell where in time the extracted frequencies occur; it is merely known that they are present. To aid in alleviating this problem of time ambiguity, the Windowed Fourier Transform (WFT) can be used. The WFT takes a certain time block of the signal and computes the Fourier transform for that section. Once computed, the window is translated in time to the next block of data in the signal where the Fourier transform is computed again. In this way, frequencies can be attributed to certain time blocks in the data from the various windows translated on the time axis. While the method of the WFT may sound attractive, it is not always consistent. First, the results of the WFT depend on the window size used. Second, the frequency of the signal being analyzed also affects the study; that is, at low 3 frequencies, the frequency localization is lost because there are so few oscillations in the window. In other words, the WFT cannot precisely determine the frequencies present for low frequency signals. Similarly, at high frequencies, time localization is lost because there are too many oscillations. In other words, for high frequency signals, the WFT cannot tell at what time the signals occurred [5]. Another major disadvantage of the Fourier transform has to do with the sampling rate of the measured signal. In reality, no digitized signal is truly continuous since a digital computer separates the information into discrete packets (analog signals are not being considered since all signals in this study have been converted/constructed in digital format). The discrete sampling, then, determines the resolution of the actual signal: the more points sampled, the more accurate the representation of the signal. Conversely, the fewer the points sampled, the lower the resolution of the represented signal. While it would be ideal to sample many points, there is a limit to both the capacity of the computer memory available to store the information and the patience of the scientist who is working with the data. Hence, it is desired to sample the smallest number of points possible that will still allow us to satisfactorily resolve the desired signal. However, when too few points are sampled, aliasing can occur. Aliasing is a situation where the sampled points construct a function that does not satisfactorily represent the sampled signal. Figure 1 illustrates the aliasing phenomenon more clearly. 4 Figure 1 – Signal Aliasing [4] In order to ensure that the measured frequencies represent what is actually in the sampled signal, the Nyquist Frequency can be used. The Nyquist Frequency is the highest frequency that can be resolved in a signal given its sampling rate and is given by f NYQ fs 2 (4) where fs is the sampling rate of the signal. Hence, any frequency greater than fNYQ in the sampled signal will not be accurately represented [4]. Furthermore, if the signal is not 5 sampled correctly (as stated by the Nyquist condition), the Fourier transform will yield erroneous frequencies in the calculation. 2.2 Wavelet Analysis Many signals in engineering applications contain periodic signals. The periodicity of these signals, however, can vary in both amplitude and frequency over a given length of time. One analysis tool available for studying these types of signals is the Fourier transform. As was seen in the previous section, the Fourier transform will only isolate the frequency variation of the signal and cannot discern the time location of each of the frequencies. This becomes a major problem when trying to study events that are not steady state because the time-history of the event is lost in the Fourier transform. The use of wavelet analysis, however, alleviates this problem and makes the examination of transient signals feasible. In this discussion of wavelet analysis, relevant aspects of the theory will be presented and followed by an example to more clearly illustrate the theoretical concepts discussed. In order for a function to be a continuous wavelet function, it must be admissible as a square integrable function. That is, C 2 n Rn ˆ k 2 d nk k n (5) where ˆ k 2 n ( x)e ik x d n x Rn (6) with n being the number of spatial dimensions in the problem [6]. For practicality, the wavelet function (x) should also be well localized in both the physical space and the 6 Fourier spaces. This will ensure that the transient data will not be ‘smeared’ in the transformation, as is the case with the Fourier transform because the trigonometric functions used in Fourier analysis are not well localized. Once the wavelet function has been chosen, it is then scaled and translated to produce a family of wavelet functions based on the original, or mother, wavelet [6]. This family of wavelets is then used to generate the transformation from the time-domain to the time-space domain (wavelet space) by convoluting the wavelet functions with the signal being investigated. The transformation produces wavelet coefficients that are dependent on the scale and the translation of the wavelet. For engineering purposes, the best way to make sense of the wavelet coefficients is to use a 2-D contour type plot that shows the scale versus time with the more intense colors showing where the scale is concentrated in the signal. An example of the mother Morlet wavelet is shown below in Figure 2. Figure 2 - Morlet Mother Wavelet [5] These concepts can be more easily seen with an example. Take for instance the tones used by the television network NBC in advertising their logo. Shown in Figure 3 is the Fourier representation of the ‘NBC’ signal. 7 Figure 3 - Fourier Representation of the 'NBC' Tones As seen in Figure 3, the three distinct frequencies of the ‘NBC’ signal are shown, but the times at which the tones occur are not known. However, when a wavelet analysis is performed on the ‘NBC’ signal, the tones are clearly shown at their respective frequencies and their duration in time. See Figure 4. The red denotes where the scale of the coefficients is largest, or where the frequency resides, while the bluer colors show where the wavelet coefficients are quite small. 8 Figure 4 - Wavelet Representation of the 'NBC' Tones 2.3 Triboelectric Effect Twisted pairs of wires, similar to those often found in commercial aircraft, can experience a phenomenon known as the triboelectric effect. When the twisted wires are subjected to vibrations, an imbalance of charge develops as a result of the friction between the interior wire core and the surrounding insulation. The conductive wire sheds electrons to the insulation, thus causing a charge imbalance that in turn allows current to flow between the twisted wires. See Figure 5 for details. 9 Figure 5 - Triboelectric Effect [7] A more common example of this type of phenomenon occurs when a person slides across a cloth car seat and then touches a metal object. The resulting induced current and spark is known as a triboelectric current. Large amounts of triboelectric current are highly undesirable as they can hinder the capability of measurement devices as well as create a safety hazard to aircraft since the sparks could feasibly melt the wiring. Hence, considerable effort has been made to reduce the triboelectric phenomenon in wiring. The addition of Teflon insulation to the wire reduces the coefficient of friction and thus reduces the triboelectric effect within the wire. Nevertheless, the triboelectric effect cannot be completely eliminated and the currents are still detectable. 2.4 Applications of Theory Once all four tracks of the cockpit voice recorder tape had been digitized, as described later in section 4.4, they were analyzed by the MATLAB codes, which are 10 discussed in sections 4.1-4.3. The analysis process began by applying the Fourier transform on selected portions of each track to determine the frequencies present. Next, the wavelet analysis was performed so a time-space contour plot could be produced which allowed the frequencies to be easily identified at their respective excitation times. The triboelectric effect is crucial when considering the fourth, or silent, track of the cockpit voice recorder tape, since the only data it contains is produced by the triboelectric effect. With that said, the triboelectric effects captured on the fourth track of the cockpit voice recorder tape can be converted into a frequency response spectrum, which can be used to construct a time-space plot via the wavelet analysis tools and thereby aid in isolation of the failure of the engine strut. 11 3 Previous Work Although a significant amount of work has been done on the analysis of the CVR tape and the triboelectric effect, there has been no previous attempt by University of Texas aerospace students to combine the CVR tape and triboelectric effect with wavelet analysis. WDC Aerospace has begun an entirely new phase of investigation and hopes to shed some light on the applicability of wavelets in the analysis of aircraft accidents. In preparation for this project, WDC has had to make use of work done by past University of Texas design teams. 3.1 Cockpit Voice Recording Investigations In January of 1996, David McAllister submitted his findings from his investigation of the CVR recording from N811BE [3]. Review of Mr. McAllister’s work has given WDC insight on the background of the accident, operation of the CVR, tape playback equipment, and interpretation of many portions of the CVR audio signals. 3.2 DRAK Corporation The use of wavelets to analyze CVR signals pivots around the confirmation that aircraft wiring is capable of effectively transmitting vibration inputs from the aircraft, via triboelectric effect, into the CVR. In the fall of 1997, The DRAK Corporation successfully proved that wiring, such as that on N811BE, is capable of transmitting vibration induced triboelectric electricity into the CVR. Thus, there exists a high probability that the signals from the N811BE CVR will contain a distinct triboelectric signature characterizing the in-flight failure of the right engine mount strut. 12 4 Preliminary Work 4.1 Program Development Three MATLAB files were used to perform the wavelet analysis of the CVR signal. A wavelet analysis code consisting of two MATLAB files was obtained from C. Torrence and G. Compo from their website [5]. The third file was obtained from C. Garland and J. Fuentealba and modified to correct minor problems and increase the efficiency of the code [8]. The MATLAB m-files, shown in Appendices A-D, include: wavelet.m, wave_bases.m, WLF.m, and wave10.m. In the discussion below, the actual variable names from the code are shown in italics and the MATLAB functions are shown in bold italics. Given a signal, the wavelet.m file calculates the one-dimensional continuous wavelet transform. The input required by the wavelet.m file includes the signal in vector form and the time between samples, or inverse of the sample rate. The user can input whether or not zero padding should be used on the signal. Padding the signal with zeros limits edge effects due to the given signal’s finite-length in time and the assumption in the Fourier transform that the signal is cyclic [9]. In addition, padding the signal with zeros reduces the errors due to the finite signal; however, it introduces a discontinuity in the signal at the endpoints that causes the amplitude of the transform to decrease near the edges at larger scales where more zeros are required to limit the edge effects. Since WDC is attempting to locate a transient event in the middle of the signal, a decrease in amplitude near the endpoints is not a concern. One can also specify the spacing between discrete scales, which essentially amounts to specifying the resolution of the analysis. 13 Finally, the user can set the smallest scale of the wavelet and can select the type of mother wavelet, the Morlet, Paul, or the DOG, to be used. The output includes the following: the wavelet transform of the input stored as a complex array, the vector of “Fourier” periods that correspond to the scales, the vector of the scale indices, and the Cone-of-Influence, which gives a measure of the edge effects present at a given time. The Wavelet.m file calls wave_bases.m, provided by Torrence and Compo, to calculate the wavelet function as a function of Fourier frequency, which is used for the wavelet transform in Fourier space. The file’s inputs and outputs are handled by wavelet.m and are specified by the user through the choices made for the input values of the variables in wavelet.m. The MATLAB file WLF.m was provided by Garland and Fuentealba and has been modified in several ways. It was also renamed Wave10.m. WLF.m was modified in order to allow the user to select the input signal from a list of signals in the current user directory and to allow the user to specify the sample rate of the signal. The sample rate is used to provide a meaningful frequency basis for the Fast Fourier Transform (FFT) output. It should be noted that the inverse of the sample rate is simply the time between samples. Since the signals to be analyzed are rather large, the Fourier analysis is completed separate from the Wavelet analysis. This allows the user to see the frequencies in the signal and choose an appropriate frequency range on which to perform the wavelet analysis so that the user does not waste time on a frequency range where no signal exists. Another modification to improve the accuracy of the frequencie’s output given by the wavelet transform was using the output variable period, produced by 14 wavelet.m. WLF.m used the inverse of the variable scale; however, the frequencies obtained in this way were found to not perfectly correspond to the actual frequencies known to exist in the signal. The use of the inverse of period to find the frequencies decreased this discrepancy to nearly zero. The frequencies displayed were still not perfectly matched, though the difference had to do with the limited resolution of the transform. The plotting function, contourf(x,y,z), used in WLF.m, had memory problems due to the size of the matrices being generated by wavelet.m for high resolution images. These problems often caused MATLAB to crash. Several different display methods were tried in an attempt to avoid the memory problem and yet still allow for high-resolution analysis. First, contourf(x,y,z,N) was tried with the hope that specifying the number of contour lines, N, would reduce the processing power required to display the plot. However, because contourf(x,y,z) varies the number of contours drawn locally based on the local slope, it can display more detail where it is needed and less where it is not; whereas contourf(x,y,z,N) uses a fixed number of contour lines for the entire plot and thus requires more memory resources. Next, contour(x,y,z) was used and found to be slightly slower to plot and harder to read. Contour(x,y,z,N) was unsuccessful for the same reasons as above. Finally, surf(x,y,z) was used to generate a surface plot. This method was faster and used less memory than contourf(x,y,z) for low resolution plots, but at high resolutions the black lines used by the surf(x,y,z) command to delineate the data points blended together and the plot appeared as just a black image. There was no way to get rid of the lines except by using the command shading interp which 15 interpolated the data points and returned a smoothed plot. However, the shading interp command used too many memory resources and caused the surf(x,y,z) command to plot slower and with lower resolution than the contourf(x,y,z) command. One should note that for sufficiently long, medium resolution signals MATLAB crashes while calculating the transform before ever getting to the plot command. Since surf(x,y,z) with shading interp interpolates the data, the plot can yield a slightly better resolution than with contourf(x,y,z) for these signals. The extra resolution must be treated carefully though, since it is merely interpolated and not necessarily showing the physical behavior of the signal. 4.2 Generation of Test Signals The signals that were analyzed in this project were not computer generated. Rather, they are real signals that were recorded ‘live’ via cockpit voice recorder and thus contain a great deal of noise, many frequencies, harmonics, and variations in sampling rate. Due to the complexity of the signals involved, and before analysis of the real signals could be done, it was necessary to test our signal analysis computer codes with simple signals to ensure that the analysis codes could accurately display the frequencies and excitation times within each test signal. The initial test signals were generated in MATLAB and were simple monotonic sinusoidal signals. As testing progressed, more complex signals were generated by adding several simple signals together to form a single signal with multiple frequencies and time durations. A progression of test signals is shown below in Figure 6. Signals 1 16 through 3 are single frequency signals which, when added together, form the final test signal shown at the bottom of Figure 6. Figure 6 - Test Signals While generating each test signal, we found it imperative to ensure that the signal was created, recorded, and played at specific sampling rates to ensure that the signal matched predetermined signal specifications such as frequency and duration. The generation of signals in MATLAB is a relatively simple operation and involves forming a column vector whose entries are created by a particular sinusoidal function that is structured in such a way as to allow the frequency and duration of the signal to be specified. In addition, MATLAB offers a convenient means to transform the vector into a .wav file format via the wavwrite command. However, care must be taken to match the sampling rate at which the vector was created with the sampling rate for which the vector is recorded. Playback of the .wav file is accomplished with the wavplay command, and must be done at the same sampling rate that the .wav file was recorded. 17 Once each test signal had been generated, they were entered into our codes for testing and verification. A sample of the MatLab code necessary for the generation of .wav format test signals is found in Appendix E. 4.3 Input Parameter Determination In order to perform meaningful analysis of the CVR data, the effects of the input parameters requested by wavelet.m needed to be determined. There are three critical transformation parameters that can be altered in order to change the wavelet analysis. The transformation parameters are as follows: the wavelet parameter, the spacing between the discrete scales, and the wavelet function to use. There are two additional parameters that modify the range over which the analysis is performed: the base scale and the number of scales. In order to gauge the effect of the various parameters, the NBC signal was modified to include a 600 Hz tone at the same excitation time as the 500 Hz tone. The 600 Hz tone lasted approximately 30 milliseconds, stopped for 3 milliseconds and then restarted and decayed over 30 milliseconds. The Fourier analysis of the modified NBC signal is shown in Figure 7 and shows the presence of the 300, 400, 500, and the 600 Hz tones, but not the times at which they occurred. 18 Figure 7 - Fourier Representation of Modified 'NBC' Signal The effects of the wavelet parameter, w0, on the transform output were determined by analyzing the modified NBC signal. The analysis showed that the wavelet parameter controls the effective width of the wavelet transform in spectral-space (frequency-space) and therefore determines the maximum possible resolution in frequency-space. For the Morlet wavelet this number is called the wavenumber (o) and as it increases, the Morlet wavelet’s width decreases, while for the Difference Of Gaussians (DOG) wavelet the parameter is the derivative of the wavelet (m) and increases the width of the wavelet as the derivative is increased. Comparing Figures 8 and 9 shows the effect of the wavelet width. Figure 8 shows a Morlet wavelet analysis with a wavenumber of 6, while Figure 9 shows the analysis with a wavenumber of 24. The analysis done with a wavenumber of 6 has wide bands in frequency-space making it 19 difficult to determine the precise frequency of the 300 and 400 Hz tones. The 500 Hz tone and the 600 Hz tone blend together and are therefore difficult to identify. The black lines in the 500 Hz region occur because the contour lines in that region are so dense that only the black lines surrounding the contours are shown. The analysis with the wavenumber set at 24 provided a much clearer display to determine the 300, 400, and 500 Hz tones; however, it was still difficult to identify the 600 Hz tone. Figure 8 - First Morlet Analysis of Modified 'NBC’ Signal 20 Figure 9 - Second Morlet Analysis of Modified 'NBC' Signal In order to distinguish the 600 Hz tone, another parameter must be changed. The spacing between discrete scales, dj, was found to also impose a maximum resolution in the frequency domain by setting the width between the scales. Since the scales essentially correspond to the inverse of the frequencies, the scale size limits the frequency resolution of the transform. The smaller the scale size, the finer the resolution is in frequency-space as long as the wavenumber is appropriately large (or small in the case of the DOG wavelet). Figure 9, shown previously, represents the modified NBC signal analyzed with the Morlet wavelet, a wavenumber of 24, and a scale size of 0.25. Figure 10 shows the analysis with a scale size of 0.025. By reducing the scale size by a factor of 10, the 600 Hz tone, including the tone decay, is easily distinguished. The gap between 21 the 600 Hz tones was identifiable as long as the size of the gap (in time) was much greater than the inverse of the sample rate of the signal. Figure 10 - Third Morlet Analysis of Modified 'NBC' Signal The code obtained from Torrence and Compo allowed the user to choose between three wavelet functions. While there are many more types of wavelets, the three provided are the most common for nonorthogonal wavelet analysis. The most notable difference between the wavelet choices was found to be the fine temporal resolution and poor spectral-space (frequency domain) resolution of the Difference of Gaussian, or DOG, wavelet. The DOG wavelet has these properties because it is real valued and therefore contains both the positive and the negative oscillations of the time series as separate peaks in wavelet power. The Morlet wavelet, on the other hand, is complex and thus combines both the positive and the negative peaks into a single broad peak in time [9]. 22 This effect can best be seen from analyzing the modified NBC signal with the DOG wavelet and the Morlet wavelet. Figure 11 shows the results of the analysis with the DOG wavelet (m = 2, dj = .025) while Figure 9, shown earlier, exemplifies the results of the analysis with the Morlet wavelet (w0 = 24, dj = .025). It is apparent from the figures that the Morlet wavelet represents the signal in a much more readable and usable fashion. With the DOG wavelet, the signal band representing the 300 Hz tone is a wide band at the beginning of the signal, but the other three tones blend together. The Morelet analysis shows all of the tones clearly and it picks up the break in the 600 Hz tone as long as the sample rate of the signal is smaller than the inverse of the time between the two tones. The Paul wavelet is not very different from the Morlet wavelet; however, it is wider in spectral-space and therefore has poorer frequency resolution than the Morlet wavelet. The Morlet wavelet appears to be the best wavelet for the type of signal analysis that must be done for this project. Figure 11 - DOG Wavelet Analysis of Modified 'NBC' Signal 23 4.4 Signal Recording Since our analysis codes were designed to accept data in the .wav format, it was necessary to input the CVR recording into the computer code in the .wav file format. However, when WDC began this project, all copies of the original CVR tape were contained in a host of magnetic audiotapes that included five reel-to-reel tapes and one cassette tape. This particular data format proved to be useless with the analysis codes that had been developed since there was no means to directly transfer the tape data onto the computer in a .wav format. In our attempt to solve this problem, the CVR cassette tape was taken to the University of Texas School of Music where a portion of it was transferred to a computer. This first recording only served as a test signal to check to see if the .wav file format and data transfer process would be adequate for the purposes of this project. Although the CVR data from the cassette was useful in testing the computer codes, it was still necessary to transfer the entire CVR recording onto disk. This proved to be easier said than done. Pete Moss, of the University of Texas School of Music, was contacted with a request for assistance in the transferring of the CVR copies to computer. However, upon attempting to play the reel-to-reel tapes, it was discovered that the School of Music does not own equipment capable of the 1 7 8 inches per second (IPS) tape speed required to play the CVR copies, or the original CVR tape. In light of this problem, Dr. Ronald Stearman was able obtain a Sony TC277-4 quadraphonic reel-to-reel recorder/player, which is capable of playing and recording at 1 7 IPS. 8 Due to the poor notation and documentation of the content of the CVR tape copies, there was a great deal of uncertainty as to what was actually contained on the 24 reel-to-reel tapes, what format the data had been recorded in, and the condition or health of the tapes, all of which are several years old. Thus, to preserve the greatest amount of data actually contained on the original CVR tape, and to ensure the highest quality of recording, WDC decided to transfer the original CVR tape, in its entirety, to computer. In addition, a portion of one of the CVR copies was transferred to computer as well. With the Sony TC277-4 in hand, and the expert work of Pete Moss, all four tracks of the original CVR tape and a portion of the CVR tape copy were transferred onto computer and saved onto compact disk (CD) as .wav files. It should be noted that all tracks from both the CVR original and copied CVR tape were recorded with 16-bit depth, and at a 44,100 Hz sampling rate. Table 1 shows the content of the “master” CVR compact disk. Table 1 - Beech 1900C_CVR Master CD Beech 1900_CVR Directory cvr_master cvr_copy Files cam cam pilot1 pilot1 silent silent pilot2 pilot2 The Beech 1900_CVR compact disk contains two directories, cvr_master and cvr_copy. The cvr_master directory contains a copy of the entire original CVR tape. Each of the four tracks were recorded and saved into files: cam, pilot1, silent, and pilot2. The files are identified as follows: cam denotes the cockpit area microphone; pilot1 is the pilot-to-pilot communications, silent denotes the silent track, and pilot2 contains the 25 intercom recording. The directory cvr_copy contains a portion of a reel-to-reel tape with all four tracks as described for the cvr_master directory. Please note that the recordings found on the Beech 1900_CVR CD contain content that is sensitive to the families of the pilots; discretion should be used when playing and/or transferring the CD data. For reference, the transfer setup is shown below in Figure 12. Figure 12 - Tape Transfer Setup Due to the large amount of computation time required to analyze signals, it was necessary to break up the CVR signal into sections that were small enough to be analyzed in a relatively short amount of computing time. GoldWave, a sound visualization and editing program, allowed WDC to quickly “pick off” sections of the CVR signal that were of particular interest and save them into small files that were then loaded into the analysis codes. 26 5 Paramaterization Studies 5.1 Scale Parameters It proved advantageous to specify the frequencies over which to perform the analysis while examining the various input parameters. By defining a range of frequencies, the resolution of the signal could be increased without the program crashing. Narrowing the range over which the analysis is performed also facilitates distinguishing the weaker tones from the background and separating tones only several Hertz apart. The two parameters that determined the frequency range were the base scale and the number of scales. However, while investigating the effects of the transformation parameters on the various test signals, it was noticed that the frequency range analyzed was also dependent on the wavenumber, scale size, and wavelet type. To display the desired range of frequencies correctly, the scales had to be correctly correlated with their associated Fourier frequency. Since the Fourier analysis allows the user to determine the desired frequency range in a straightforward manner, it is easier for the user to specify the frequencies to analyze, rather than the base scale. The code then converts the maximum frequency to the base (minimum) scale from the relationship between the equivalent Fourier period and the wavelet scale. This relationship is dependent on the type of wavelet used and is shown in [9] for the three wavelets available through the wavelet code obtained from Torrence and Compo [5]. For the Morlet wavelet the relationship is 4 2 2 o o 27 s (7) where is the Fourier wavelength (equal to the inverse of the Fourier frequency), o is the wavenumber, and s is the current scale. Thus, for the Morlet, the base scale is 2 1 o 2 o s0 f max 4 (8) The base scale can therefore be calculated in the code given the maximum frequency and the wavenumber from equation 8. To correctly satisfy the minimum frequency desired the number of scales must also be properly determined. The relationship is independent of the wavelet used and is shown in [9] to be Nt J j1 log 2 s0 (9) where J is the number of scales, j is the scale size, N is the number of samples, and t is the time between samples. Equation 9 can be re-written in a more useful form as follows f J j1 log 2 max f min (10) where fmax and fmin are the maximum and minimum frequencies to analyze. In the code, the number of scales must be an integer value, so it is necessary to round equation 10. 28 5.2 Minimum Scale Size When the analysis is performed, the maximum scale resolution is achieved with the maximum number of scales in-between the desired frequencies as possible. From Equation 10, it can be seen that, for a set frequency range, j (dj) must therefore be as small as possible if the number of scales, J, is to be maximized. The maximum number of scales that the code could handle without crashing was dependent on several factors. The first factor was the computer on which the analysis was performed. There was little (if any) difference between the newer computers in the lab, the Dell Precision 340’s, which all had at least 512 MB of RAM and a Pentium 4 2.2 GHz processor or better. However, there was a significant difference between the number of scales that the newer computers could handle without crashing; the older computers, such as the Dell Optiplex GX300, all had less RAM and slower processors (they all varied in amounts of RAM and processor speed). It was, therefore, decided that the analysis would continue only on the newer computers, as the larger number of scales provided a more detailed and accurate picture of the signal. Second, the number of scales that the code could handle was dependent on the ‘length’ of the signal. In other words, if the signal lasted for 2 seconds and had a sample rate of 10000 samples per second, then the length of the matrix that represented the signal was 20000. This length was important because the larger the signal’s matrix was, the more memory it would take up in the code and therefore the more memory it would take up during the transform. The display type (surf or contourf) also affected the maximum number of scales that the code could handle without crashing. Because the surf command interpolated between the data points, it could not display the 29 same length signal as the contourf command. The maximum number of scales that could be used on the newer computers was found for each display type and for signals of various lengths so that the user would know the approximate minimum scale size that could be used without causing the computer to crash. Obtained through trial and error, Figure 13 shows the maximum number of scales at which the program would run as a function of signal length accompanied by the power law correlation determined by Excel. While only four data points were taken, the correlation has a very high R2 value, indicating that the correlation is most probably a very close fit for other signal lengths in-between those explicitly stated. 30 1200 Contourf(x,y,z) Surf(x,y,z) 1000 Maximum # of Scales y = 2.442E+07x-1.095E+00 2 R = 9.973E-01 800 -9.696E-01 y = 3.735E+06x R2 = 9.999E-01 600 400 200 0 0 50000 100000 150000 200000 250000 300000 Signal Length (# Samples) Figure 13 - Relation Between Number of Scales and Signal Length The correlation is used by the code in order to give a recommended value for the scale size j. This recommended value is calculated by first finding the maximum number of scales for a given signal and output type according to whichever curve-fit from above applies. The code then uses Equation X to solve for the minimum scale size possible. In general, the minimum scale size possible can then be written as jmin f max 1 log 2 L f min 31 (11) where is the coefficient in the correlation, is the power coefficient, and L is the signal length. It should be noted that the wavenumber had little, if any, effect on the maximum number of scales. Specifically, the maximum number was constant from a wavenumber of 20 to about 300, but if the wavenumber was above 300 the maximum number possible was one lower. This was for a 100 Hz tone, and the most probable reason that the maximum number changed is because the wavenumber surpassed the critical (maximum) wavenumber, which will be discussed in detail next. 32 5.3 Maximum Wavenumber As parameter testing proceeded, limitations on the wavenumber were discovered and several test signals were generated in an attempt to determine the extent of the limitations. Morlet analysis was performed on a pure, constant amplitude 5 Hertz tone with a wavenumber of 48, and a scale size of 0.0075. In Figure 14 the output is shown. It is clear from the figure that the analysis failed, as it shows two distinct tones, one at 5.5 hertz and the other at 4.9 hertz. Also note that no edge effects are present in the plot, possibly indicating that the wavelet transform was somehow not working. Figure 14 - Morlet Analysis of 5 Hz Tone, Wavenumber = 48 33 However, the single 5 Hertz tone could be correctly resolved if the analysis was performed with a wavenumber of 14 or less, as determined by trial and error. Figure 15 shows the analysis with a wavenumber of 12. The wavelet power spectrum plotted shows a single tone with large edge effects; however, the effective bandwidth is quite large. The magnitude of the power spectrum, as represented by the colorbar, is vastly different in each case. For Figure 14 the power is of the order 104, while for Figure 15, the power is of order 103. Figure 15 - Morlet Analysis of 5 Hz Tone, Wavenumber = 12 To ensure that the effect could not be corrected by the appropriate choice of scale size, the analysis was performed with several different scale sizes. Figure 16 shows the 34 transform output at the smallest scale possible on the current computers. The effect is still present, though the power spectrum’s magnitude has changed slightly. Figure 17 shows the transform with a scale size of 0.125 – approximately double the size of the analysis in Figure 14. Interestingly, the tones do combine into one; however, the combined signal’s peak is not centered on 5 Hertz, but closer to 4.9 Hertz. Also, the maximum power in Figure 17 is 3000 whereas the max power in Figure 15 is 2000. As will be shown later, the correct (i.e. consistent) power of the signal is 2000, which means that the analysis shown in Figure 17 cannot be usefully compared to other tones in different frequency bands. Figure 16 - Morlet Analysis of 5 Hz Tone, WPS Powerscale 35 Figure 17 - Morlet Analysis of 5 Hz Tone, Scale Size = .125 The maximum wavenumber allowed was experimentally found to be dependent on the frequency, the signal length, and the sample rate of the signal. Figure 18 shows the transform of a pure 100 Hertz tone with a wavenumber of 768 in which three distinct tones are present. Figure 19 shows the same tone analyzed with a wavenumber of 192. Notice that a significantly higher wavenumber can be used in the analysis than for the 5 Hertz tone, but the wavelet power spectrum still has a maximum of 2000. The maximum power for the 5 Hertz tone (Figure15) and for the 100 Hertz tone is expected to be identical because the amplitudes of the tones created in MATLAB were the same. 36 Figure 18 - Morlet Analysis of 100 Hz Tone, Wavenumber = 768 Figure 19 - Morlet Analysis of 100 Hz Tone, Wavenumber = 192 37 It was necessary to study the maximum wavenumber as a function of the frequency, sample rate, and signal length in order to perform meaningful, physical analysis in the frequency range specified by the user. To determine the cutoff point in a consistent manner for the maximum possible wavenumber, it was also necessary to define when the transform started to return erroneous results. For several reasons, the critical (maximum) wavenumber was determined to occur when the frequency band over which the tone was represented no longer narrowed with increasing wavenumber by a significant amount. In other words, the wavenumber at which the derivative of the tone width with respect to the wavenumber is less than , where is a negative number, is the critical wavenumber. Defining the critical wavenumber in this way required the functional dependence of the tone width to be known, and is discussed later. For our purposes a simple relationship between the critical wavenumber and frequency is obtained if is inversely proportional to frequency. where A is the constant of proportionality. A f (12) In order to keep the tone from being excessively distorted, A needed to greater than 0.1. A was chosen to be 1. Defining the critical wavenumber in this way seemed to be the only way that a correlation could be obtained that would accurately predict the critical wavenumber. Figure 20 shows a 5 Hertz tone at the critical wavenumber (9) and Figure 21 shows the same tone at a wavenumber number of 10. It is important to note that there is little difference between the two Figures, and that either wavenumber would technically be acceptable; however, since the reason for a higher wavenumber is to lower the frequency width, there is little reason to employ higher wavenumbers and risk distorting the tone. 38 The correlation obtained for the critical wavenumber with the previously mentioned criteria is shown in Figure 22. It was found that by making inversely proportional to the frequency, the critical wavenumber was simply a linear function of frequency. Figure 22 suggests that the critical wavenumber may be represented by oc 1.43 f (13) with very good accuracy as indicated by the R2 value of 0.9999. In order to generate the data and correlation seen in Figure 22, it was necessary to determine the tone width’s functional dependence on wavenumber and frequency. Figure 20 - Morlet Analysis of 5 Hz Tone, Wavenumber = 10 39 Figure 21 - Morlet Analysis of 5 Hz Tone, Wavenumber = 9 1600 1400 Critical Wavenumber 1200 1000 800 600 y = 1.4298x R2 = 0.9999 400 200 0 0 200 400 600 800 1000 Frequency (Hz) Figure 22 - Relation Between Critical Wavenumber and Frequency 40 A more physical definition of the critical wavenumber would be to define it as the wavenumber at which the signal band displayed by the analysis starts to deform; however, the precise definition of deformation is also ambiguous and leads to too complicated a dependence on signal size (length), sample rate, frequency, and scale size. We were unable to formulate useful correlations from the parametric study with that definition of the critical wavenumber. Figure 23 shows the 5 Hertz tone analyzed with a wavenumber of 17. The displayed tone is no longer close to being symmetric (about the 5 Hz line), the contour lines can be seen to curve irregularly on the top half of the tone, and at the bottom there are small ‘notches’ in the lowest contour area of the tone that expand as wavenumber is increased until a separate ‘ghost’ signal is generated as seen in Figure 18. Figure 23 - Morlet Analysis of 5 Hz Tone, Wavenumber = 17 41 5.4 Tone Width Earlier, the critical wavenumber was defined as the wavenumber at which the tone width in frequency space no longer decreased by an appreciable amount. In order to develop the linear correlation shown in Figure 22, it was necessary to determine the tone width’s functional dependence on the wavenumber, the tone’s frequency, and other variables. The definition for tone width used for the parameterization was just the maximum distance between the center of the tone and the last contour line of the tone was the tone width. This is depicted in Figure 24. Figure 24 - Graphical Depiction of Tone Width 42 Once the tone width was defined, the tone width was measured for several frequencies at various wavenumbers, scale sizes, signal lengths, and sample rates. Figure 25 shows the tone width correlation for a 100 Hz tone with various input parameters. It can be seen from the Figure that the tone width is independent from the sample rate of the signal and the length of the signal. For large wavenumbers the tone width was essentially independent of the scale size, dj. However, for smaller wavenumbers the tone width became more dependent on the scale size, as indicated by the larger separation between the data points at small wavenumbers. The dependence was not too strong since the scale size differed by a factor of 10 and the curve fit was still close to the other fits. It was also found that a tone could not be resolved at all if the scale size was too large; but this was not investigated any further. Instead it was used as justification to consider the tone width independent of the scale size. Essentially, if the analysis is performed at a scale size on the order of 0.001, the correlation obtained should be valid. This is fine for the analysis performed because this was close to the minimum scale size that would not crash the computer. 43 10 Sample Rate = 10000, L = 1 Sec, dj = 0.00075 9 Sample Rate = 10000, L = 1 Sec, dj = 0.0075 8 Sample Rate = 10000, L = 3 Sec, dj = 0.0075 Tone Width (Hz) 7 Sample Rate = 44100, L = 1 Sec, dj = 0.0075 6 -0.8942 y = 119.6x 2 R = 0.9949 5 -0.9104 y = 136.56x 2 R = 0.9983 4 -0.9054 y = 133.22x R2 = 0.9979 3 y = 141.96x-0.9205 2 R = 0.9989 2 1 0 0 50 100 150 Wavenumber Figure 25 - Relation Between Tone Width and Wavenumber 200 250 The tone width was therefore only a function of the wavenumber and the frequency of the tone. Thus the analysis that led to the curve fit shown in Figure 25 was performed for three different frequencies: 5, 100, and 1000 Hz, in order to determine the frequency dependence. Shown in Figure 26 is a plot of the power coefficient from the correlations (like Figure 25) at the different frequencies. No analytic function is immediately obvious that would realistically fit these data points; however with more data points, or by considering the power coefficient as a function of other variables (the scale size, sample rate, or signal length) future groups may be able to quantify this coefficient better. For the current analysis though, it was decided that the power-term in the tone width—wavenumber relationship was close enough to -0.9 for the various frequency tones that it was valid for a majority of the frequencies the analysis would be focusing on. Shown in Figure 27 is a plot of the leading coefficient from the different frequency correlations. A very simple linear relationship exists between the coefficient and the frequency and is shown in the Figure. With the leading coefficient known from the curve fit, the tone width could then be written as: TW 1.09 f o 10.45 o.9 (14) where TW is the tone width in hertz and fo is the frequency of the tone. Equation 14 was used in the code to tell the user the width of a hypothetical pure tone at the maximum and minimum frequencies analyzed. 45 -1.2 Tone Width Power Coefficient -1 -0.8 -0.6 -0.4 -0.2 0 0 200 400 600 Frequency (Hz) 800 1000 Figure 26 - Relation Between Power Coeffcient and Frequency 1200 Tone Width Leading Coefficient 1000 800 600 400 y = 1.0854x + 15.22 R2 = 0.9999 200 0 0 200 400 600 800 1000 Frequency (Hz) Figure 27 - Relation Between Leading Coeffcient and Frequency 46 5.5 Tone Resolution The ability of the transformation to distinguish two close tones from one another was investigated. It was found that two tones close together would be indistinguishable from one another if their individual power spectrums overlapped. Several signals were generated to illustrate this. First, a signal with a 50 Hertz tone and a 52 Hertz tone was made and analyzed so that the transformation’s resolving ability could be determined. Then two separate signals were made; one with a 50 Hertz tone and the other with a 52 Hertz tone so that a connection between the individual power spectrums and the combined signal resolution could be made. The signal is shown below in Figure 28 and exhibits beat phenomenon of 2 Hertz (equal to the absolute value of the difference of the two frequencies). The wavelet analysis is shown in Figure 29 and in Figure 30. Figure 29 shows the analysis in the frequency range of 45 to 55 Hertz, but the two tones blend together into a single 51 Hertz tone that fades in and out at 2 Hertz. End effects distort the power spectrum of the tone at the edges of the signal, but do not inhibit analysis of the tone. The two tones become more distinguishable as the difference in the frequencies increases, the wavenumber is increased, or the scale size decreased. However, the frequency separation cannot be controlled by the user, the wavenumber apparently has a maximum value dependent upon several variables, and too small of a scale size will cause the code to crash. 47 Figure 28 - Combined 50 Hz and 52 Hz Tone Figure 30 shows the analysis centered about 2 Hertz in order to determine if the wavelet analysis would display the pseudo-tone created by the beats phenomenon. Since only edge effects are present in the plot, it is clear that the wavelet analysis does not pick up the 2 Hertz tone. This is desirable, though, as it means that all the tones that exhibit edge effects are real and not just created from the beat phenomenon or the wavenumber being too large. 48 Figure 29 - Beat Phenomenon Example Figure 30 - Absence of Beat Frequency 49 The wavelet transform was then applied with various wavenumber values to the single tone signals. The output from the Morlet transform is shown in Figure 31, 32, and 33. With a wavenumber of 24, shown in Figure 31, the individual power spectrum of the transformed 50 Hertz tone is approximately 6 Hertz wide and would clearly overlap with the transform of the 52 Hertz tone. If the wavenumber is increased to 92, as shown in Figure 32, the width of the 50 Hertz tone’s individual power spectrum decreases to less than 2 Hertz. As shown in Figure 33, the width of the 52 Hertz tone is also less than 2 Hertz, thus the two tones would not overlap if the two plots were superimposed. Figure 31 - Single 50 Hz Tone Width, Wavenumber = 24 50 Figure 32 - Single 50 Hz Tone Width, Wavenumber = 92 Figure 33 - Single 52 Hz Tone Width, Wavenumber = 92 51 Once the transformation performed with a wavenumber of 92 was determined to produce power spectrums that did not overlap, the transform was applied again to the two-tone signal to determine if the tones could be distinguished separately or if the beat phenomenon was present. The analysis is shown in Figure 34 with a wavenumber of 92. The two tones are distinct, yet still slightly interfering with each other. This indicates that, although the transformation is non-linear (the transformation of the two signals together does not equal the superposition of the signals transformed separately), the analysis is quasi-linear. In other words, at large enough frequency separations the transformation correctly represents the frequency content of the signal. The minimum frequency separation for the analysis to properly display the tones can be determined by the single-tone frequency widths developed earlier. Figure 34 - Combined Tone, Wavenumber = 92 52 5.6 Edge Effects A final effect that was present in the analysis was the edge effects that occurred due to the signal edges. It was noted as various test signals were analyzed that the effective size of the edge effect was variable. It is important to realize that the edge effect itself is actually present throughout the entire length of the analysis; however, the effect becomes negligible at a certain point, which we denote as the effective size of the edge effect. Specifically we defined the edge effect to cease at the highest power spectrum contour for the constant intensity, pure test tones that were used in analyzing the effect. Contour lines were used because they were more consistent from analysis to analysis; i.e. there is no ambiguity as to where the contour level ends. Due to the interpolation between data points, the surface command plotted smooth, continuous images that made quantifying the effective size more inconsistent. Figure 35 shows a 100 Hz tone with the effective edge effect size of 0.327. Finally, the size of the effective edge effect would vary based on the number of contour lines that were present in the output plot. For the present study, 10 contour lines were used on every plot to keep the effective size measured consistent; however, this means that if more (or less) contour lines are used in the analysis, the edge effect size calculated from the current correlation might not be valid. 53 Figure 35 - Graphical Depiction of Edge Effect Size It was found that, for a given frequency, the edge effect was approximately linear over a certain range. Figure 36 shows the correlations for a 100 Hz tone with various input parameters. It can be seen that the 1 second signals all level off at about 0.35 seconds of edge effect, while the 3 second signal did not level off (though it started to) before the signal deformed due to too high of a wavenumber. However, the data points are relatively close together for the lower wavenumbers, independent of the sample rate, the length of the signal, and the scale size selected. This allowed for a linear fit to be made with the data at the lower wavenumbers that would accurately predict the size of the edge effect at low wavenumbers and overestimate the size of the edge effect at large wavenumbers. This was not considered to be a problem because over estimation would 54 merely add a factor of safety to the size of the effect, which was used to determine how much overlap was needed in-between separate sections of the signal when it was separated into smaller pieces. 0.8 Sample Rate = 10000, L = 1 sec, dj = 0.00075 Edge Effect Size (sec) 0.7 0.6 Sample Rate = 10000, L = 1 sec, dj = 0.0075 0.5 Sample Rate = 10000, L = 3 sec, dj = 0.0075 0.4 Sample Rate = 44100, L = 1 sec, dj = 0.0075 y = 0.0026x + 0.0061 R2 = 0.9982 y = 0.0025x + 0.0081 R2 = 0.9977 Series8 0.3 y = 0.0025x + 0.0076 R2 = 0.9994 Linear (Sample Rate = 10000, L = 3 sec, dj = 0.0075) Linear (Sample Rate = 44100, L = 1 sec, dj = 0.0075) 0.2 0.1 y = 0.0025x + 0.0094 R2 = 0.998 0 0 50 100 150 200 250 300 Wavenumber Figure 36 - Relation Between Edge Effect Size and Wavenumber The next step in quantifying the effective size of the edge effect was to determine how the slope and intercept of the linear fit shown above depended on the frequency of the signal being examined. Figure 37 shows the slope of the edge effect function from Figure 36 versus the frequency at which it was measured. It was found that the slope was approximately inversely related to the frequency. Even though only three points were 55 used, the curve fit is likely to be valid for other values because of the high R2 value. Unfortunately, it was not at all obvious how to fit an analytic function to the intercept of edge effect function. Figure 38 shows the intercept plotted versus the frequency of the tone. The intercept starts at 0.014 for a 5 Hz tone, decreases to 0.008 for a 100 Hz tone, but then increases to 0.064 for a 1000 Hz tone. This behavior is too erratic to characterize with a function from only three data points; however, there was not enough time to generate further data. It was therefore decided to just estimate the intercept to be equal to 0.1 for all frequencies. This introduced further over estimation into the size of the edge effect; however, as discussed earlier this was not an important issue. 0.06 Slope of Edge Effect Growth 0.05 y = 0.2699x-1.0361 R2 = 0.9992 0.04 0.03 0.02 0.01 0 0 200 400 600 800 1000 Frequency (Hz) Figure 37 - Relation Between Edge Effect Slope and Frequency 56 0.07 y-Intercept of Edge Effect Growth 0.06 0.05 0.04 0.03 0.02 0.01 0 0 200 400 600 800 1000 Frequency (Hz) Figure 38 - Relation Between Edge Effect Y-Intercept and Frequency 5.7 Memory Concerns In order to have good resolution in frequency for the large signals that the code would need to process, it was necessary to do several things in order to reduce the amount of memory that the code would use as it performed the transform. The most obvious way to reduce the amount of memory needed in the transform was to reduce the sample rate of the signal deliberately. As was discussed earlier, if the sample rate is not at least twice the frequency that one wishes to investigate, problems will result. However, the maximum frequency that we would possibly be interested in would be the high turbine frequency of the engine, which was 10,400 Hz. This meant that our signal needed to be sampled at least at a rate of 20800 samples/sec. The original 57 digitized signal was sampled at 44100 samples/sec and so we had a lot of extra data that was not necessarily needed in order to have an accurate representation of the signal. Therefore the signal used in the final analysis was only sampled at 22050 Hz so that the amount of memory the transform needed (holding everything else constant) was cut in half. This allowed us to significantly lower the scale size, dj, which was used in the analysis. The next way that memory usage was controlled was to make sure that the larger variables in the code were cleared as soon as they were no longer needed. While this did not lower the memory usage by half of the total, it did lower it by 16 – 34 percent, depending on the signal length analyzed. Clearing the extraneous variables also improved the code’s overall efficiency. Finally, while the reductions in memory usage from the above methods were good, they were not nearly enough to allow the code to process the last 30 seconds of the CVR at a decent resolution. In order to have a resolution high enough that we could rely on the output, it was necessary to break the signal up into many smaller intervals, sections of which overlapped with the each other. In other words, the first section analyzed could be from 0 to 3 seconds, the next section from 2 to 6 seconds, the next from 5 to 8, and so on until the last section. By breaking up the code into 3 second intervals, the length of the signal that was analyzed was reduced from 662,000 to only 66,000 samples; a factor of ten reduction. Figure 13 shows that analysis on a signal with 660,000 samples would be able to have less than 50 scales, while the same analysis with only 60,000 samples could have around 150 scales. Therefore, by just breaking up the signal the analysis gains more than three times the resolution in the frequency range, 58 which is very good. The reason that 3 second intervals were chosen is because the characteristic edge effect size of the signal analysis was half a second. This meant that, for the signals to be continuous when they were put back together, approximately half a second on each side of the signal had to be discarded. If a smaller interval were used, then a larger portion of the analysis done on a given section would need to be discarded because of the edge effects, meaning that more sections would needed to recreate the signal. This would increase the computation time enormously and WDC did not have the time to for such a long computation time. 59 6 Goldwave Analysis Since the CVR silent track contains a great deal of complex information, WDC found it necessary to examine various portions of the track to gain a ‘big picture’ of what frequencies, trends, and other key characteristics such as landing gear actuations, and normal simulated engine failure signatures are contained within the recording. To accomplish this task, WDC chose to look at five major events: simulated left engine failure, left engine power up, simulated right engine failure, landing gear extension, and normal operating cruise flight. Once each of these events had been located on the silent track, via correlation with the CVR transcript, each selection was ‘picked off’ and saved as an independent .wav file. A list of each file is shown below in Table 2. Each file name contains a description of the event and the time (referenced to the transcript) at which the event begins. Note that there exist two Rgt_Eng_Fail_ files. The first file contains the right engine failure and the second file contains the final few seconds of the CVR recording, including the end of tape. The event was broken into two pieces due to the excessive amount of time between the initial engine failure and the final sequence of events at the end of the tape. Table 2 - CVR Key Events Cruise_Power_Settings.wav Lft_Eng_Fail_2134_49.wav Ldg_Gear_Ext_2134_49.wav Lft_Eng_PowerUp_2135_30.wav Rgt_Eng_Fail_2144_22.wav, Rgt_Eng_Fail_2146_19.wav 60 The Goldwave program was, then, used to generate windowed Fourier transform plots (WFTP) and identify key frequencies, such as turbine compressor blade passage frequencies. The windowed Fourier transform plots, which are shown in Figures 13,14,15,16,17 and correspond to the files shown above in Table 2, give a time history of signal activity within each selection. These plots, when viewed in real time as the selection is played, allow for quick graphical identification of various frequencies. Figure 39 - Cruise Power Settings Figure 13 shows the typical frequency spectrum of the Beech 1900C in cruise flight. The line marked “Turbines in Cruise” denotes one of the turbine frequency bands; this particular frequency band ranges between 5200Hz and 5800Hz. In addition the turbine frequencies, a blade passage frequency of approximately 105Hz is found in this selection. Although it is not easily seen on the WFTP, this frequency can be found via electronic filtering process that isolates a particular frequency band, as explained later. In addition, the 105Hz blade passage frequency found by WDC collaborates well with work done by David McAllister and the Applied Research Lab, who determined the blade passage frequency to be between 104 – 108Hz [3]. 61 Figure 40 - Left Engine Failure To gain a better understanding of what should be seen in the frequency spectrum when an engine failure occurs, WDC examined a simulated engine failure that occurred at 2134:49. In this particular event, shown in Figure 14, the left engine is seen to fail first, followed by the raising of the landing gear. As the left engine fails, the turbine frequency drops, as seen by the downward sloping magenta line. Note, however, that the right engine continues normal operation, as seen by the constant horizontal blue line. Figure 41 - Landing Gear Noise In addition to an engine failure, Figure 14 also shows the landing gear actuation. However, for ease of analysis, the landing gear actuation was separated from the file and saved as a separate .wav file and WFTP that correspond to Ldg_Gear_Ext_2134_49.wav 62 and Figure 15. The landing gear frequency spectrum is shown in Figure 15 as a very wide band of “noise” surrounding the two turbine frequency bands. Figure 42 - Left Engine Power Up Shortly after the left engine was failed, the flight crew restored the left engine to its normal operating power settings, as seen in Figure 16. Figure 43 - Right Engine Failure The final selection that WDC examined is found near the end of the CVR recording and starts at 2144:22 and continues to the end of the tape. Although this final selection is contained on two separate sound files, the two resulting WFTP’s have been combined to form one picture for ease of viewing, as shown in Figure 17. 63 However, the WFTP’s alone did not provide numerical frequency values, only a graphical representation of the frequency. To overcome this obstacle, numerous electronic pass band filters were created and applied to each selection in a manner so as to obtain a ‘window’ in which a particular frequency might be found. This filter window method was applied in an iterative method until a substantial number of key frequencies had been identified. Figure 18, shows an example of the filtering process and several key frequencies are shown in Table 3. Figure 44 - Pass Band Filter Table 3 -CVR Key Frequencies Item Tubine Blade Passage Propeller (4 Blade) Propeller Blade Passage Unknown Carrier 64 Frequency (Hz) 5200-5800,10300-10400 105 26 400 7 Wavelet Analysis Once the code functioned with a reasonable amount of consistency and predictability, the actual analysis of the CVR was performed. This section contains key parts of the analysis that led to the formulation of a hypothesis as to the events that caused the crash of the Beechcraft 1900C. All wavelet analysis was performed on the file Crash_2146_19_22050hz_new.wav (except as noted) and can be found on the disc included. All wavelet results are presented in Appendix G. Analysis was not performed on the signal for a large frequency range all at once because the scales are fractional powers of two. This means that the higher scales are further apart than the lower scales and thus the high frequencies would be more accurately represented than the low frequencies. Since the transformed power of the tone depends not only on the actual power of the tone, but on the wavenumber and the scale spacing (at least those variables), the lower frequencies would not necessarily have a similar power level compared to a high frequency tone even though they might have the same actual power. 7.1 Propeller 1p Mode Shown in Figure 45 is a surface plot of the last 30 seconds of the silent track in the frequency range of 5 Hz to 30 Hz. As can be seen, there is a great deal of beat effects in the signal due to the tone width (see Parameterization section for more details). However, there does appear to be a fairly consistent 15 Hz signal, but WDC Aeronautics was unable to correlate this frequency to any physical behavior in the aircraft; further research should be conducted into the matter. A 26 Hz tone was expected in the signal, 65 but none was reliably detected. This led WDC to analyze the area mike track in a similar frequency range; results are discussed below. 7.2 26 Hz Signal - Area Mike Analysis The last 20 seconds of the area mike track in the frequency range of 18 Hz to 36 Hz is shown in Figure 46. As can be seen, there is a signal apparent in the 24 Hz to 28 Hz range near the time of the suspected catastrophic event while the altitude alert chime on. While some of the stronger signals are likely products of the beat phenomenon, the aforementioned signal is not and indicates a mass imbalance in the propeller and, possibly, a whirl flutter phenomenon in the engine itself [10]. It should be noted that this signal was not found on the silent track. This is likely due to the suspected recorder limitations in frequency (i.e. cannot recorder below 40 Hz): there was simply no signal to modulate this frequency on the silent track while there was such a signal on the area mike track. 66 Figure 45 - Wavelet Analysis of Silent Track, 5 Hz - 30 Hz 67 Figure 46 - Wavelet Analysis of Cockpit Area Mic, 18 Hz - 36 Hz 68 7.3 Wing Torsion Mode Shown in Figure 47 is the plot of the silent track in the frequency range of 30 Hz to 75 Hz. As can be seen, there is a relatively consistent signal present at 60 Hz. This was determined to be a torsional vibration mode in the main wing of the aircraft [10]. Since the signal varies little throughout the track, it was concluded that this vibration is characteristic of normal operation and did not indicate a flutter mode of the wing. 7.4 Propeller 4p Mode Shown in Figure 48 is a surface plot of the last 30 seconds of the silent track in the frequency range of 75 Hz to 150 Hz. As can be seen, there is an intermittent signal at 105 Hz; this was interpreted to be the 4p propeller vibration mode. That is, the wavelet analysis is registering all four of the propeller blades rotating on the airplane. The reason for the intermittency from 4-12 seconds and again at 15-20 seconds has yet to be determined and needs to be analyzed by future. However, the gap at 22 seconds corresponds with the gap encountered in the CVR tape at 2146:29. [3] This, coupled with the fact that an intense propeller signal immediately follows the gap may support the notion of a catastrophic event occurring which lead to the crash of the airplane. 69 Figure 47 - Wavelet Analysis of Silent Track, 30 Hz - 75 Hz 70 Figure 48 - Wavelet Analysis of Silent Track, 75 Hz - 150 Hz 71 7.5 Right Turbine Shown in Figure ( ) is a surface plot of the last 30 seconds of the silent track in the frequency range of 4000 Hz to 4600 Hz. As can be seen, there is a signal present near 4350 Hz, which was interpreted as the right engine’s turbine in zero-thrust mode. As before, the intermittency of the signal is not well understood. Of significance, however, is how the engine signal tapers off near the end of the signal; the taper was also observed in the Goldwave Analysis. The taper indicates the engine power was lowered, most likely to the flight idle condition. This point in the data plays a key role in the hypothesis formulated by WDC Aeronautics as to the events that lead up to the crash. 7.6 Crash Hypothesis Based upon the previously discussed analysis, WDC Aeronautics was able to formulate a working hypothesis of the events that led to the catastrophic crash of the Beechcraft 1900C. In simulating a one-engine-out scenario, the pilot lowered the engine to a zero thrust level simulating the right engine failure. During this time, an event occurred that caused the pilots to lower the engines to flight idle, which is standard procedure in time of an unexpected event in flight. This flight idle condition caused an increased drag loading on the right engine that, in turn, caused a critical buckling load on the engine strut (perhaps due to critical fatigue cracking or some similar phenomenon). Following the buckling of the engine, the engine entered a whirl flutter mode that led to the engine separation and eventual crash of the airplane. 72 Figure 49 - Wavelet Analysis of Silent Track, 4000 Hz - 4600 Hz 73 8 Work Distribution and Schedule 8.1 Work Distribution WDC Aeronautics’ analysis team consists of three senior undergraduate aerospace engineering students from the University of Texas at Austin. David Hughling was ‘elected’ team leader by a coin toss and is responsible for coordinating the team, writing the weekly progress memos, and digitizing and processing the CVR recordings as well as performing the Goldwave analysis. Chris Moore’s duties included developing the MATLAB code necessary for signal analysis and the performing that analysis. Paul Bauman is responsible for understanding the theory behind wavelet analysis and also performing the wavelet analysis. In general, each team member contributed to all the areas of the project, not just their individual responsibilities. All three members contributed equally to the report and oral presentation preparation. Dr. Stearman helped obtain previous data that WDC will use to compare against the signal analysis results. 8.2 Work Schedule Table 2 shows the timeline of the major milestones for WDC. The schedule was made at the beginning of the semester once the project assignments were determined and covers all the work expected to be completed over the semester. Due to the unexpected amount parameterization studies that needed to done for the final version of the Matlab code, WDC did fall behind schedule in the final wavelet analysis of the CVR data. However, with extra effort, the deadlines were maintained and the analysis delivered on time. 74 Figure 50 - Work Schedule 75 9 Future Work WDC Aeronautics has accomplished a great deal in analyzing the CVR of the Beechcraft 1900C: the analysis of the CVR silent track was completed using both Goldwave and the developed Matlab wavelet code. There is, however, still work left to be done. While there was a great deal of data on the silent track, the other three tracks of the CVR were not extensively analyzed in this study. By performing the Goldwave and wavelet analysis on these other three tracks, other insights may be gained into the nature of the accident. On the area mike track, a 26 Hz tone was found to occur at the suspected time of the catastrophic event. The 26 Hz signal is a frequency that may indicate a mass imbalance in the propeller and, therefore, whirl flutter of the engine. This data would then serve to substantiate WDC’s crash hypothesis. However, this frequency only occurs near the altitude alert chime. This altitude alert occurs earlier in the signal as well; hence, to ensure the 26 Hz is associated with the catastrophic event, a wavelet analysis should be performed on the previous chime to see if the 26 Hz is present. In order to validate the wavelet analysis, a comparison to controlled data of the triboelectric effect should be obtained. This needs to be done because most of the analysis was conducted on data that were produced by the triboelectric effect. Hence, the accuracy of the wavelet analysis needs to be confirmed by performing a test to produce data similar to that of the silent track and observe whether the wavelet analysis extracts the actual input frequencies. 76 Furthermore, the code itself needs continuing verification. While the parameterization seems to be producing useful results, it is not necessarily based on sound mathematical principles in wavelet theory. Hence, these parameters may need to be altered or new parameters introduced to keep the code from producing results that are not erroneous. In addition, the dependence of the power spectrum on the various input parameters needs to be investigated. The limitations of the CVR need to be researched. Specifically, the limitations on the frequencies that are captured in the recording process need to be known since it is suspected that frequencies below 40 Hz are not recorded (and thus have to be modulated in another signal). Current efforts to ascertain these limitations have been unsuccessful, but the information is needed so as to know which results may be somewhat flawed. Finally, more thought should be put into analyzing the events leading up to the demise of the Beechcraft 1900C as well as the physical processes that may have been involved so as to either validate or invalidate the claims made by WDC Aeronautics. This is important because the analysis presented here is not sufficient to substantiate the claims by WDC. The first step should be reading through references [ ] and [ ] (found the references section of WDC’s group notebook) to more fully understand the whirl flutter phenomenon (these readings were given the last day of class). 77 10 Conclusions While wavelets have proven useful in beginning to more completely understand the data on the cockpit voice recorder (and produced results comparable to the Windowed Fourier Transform in Goldwave), it is an insufficient tool to determine the actual cause of the crash without some other source of input, besides the CVR, regarding the events of the catastrophe. In addition to the data being insufficient, there was also a great deal of low frequency noise on the silent track that was analyzed. Many pops and clicks that were present in the recorded signal may have masked the sort of transient event for which WDC was looking to help support the notion of the engine mount failure. Furthermore, it is suspected that the CVR does not record low frequency data (i.e. below 40 Hz); however, current research could not verify this notion. Overall, there is just too much speculation about the analysis results to draw a well-founded conclusion about the events of the crash; only educated guesses could be made. WDC’s conjecture is that when the pilot when to flight idle, drag on the right engine cause the mount to buckle leading to the engine separation. Wavelets would serve very well, however, with a flight data recorder to coincide with the analysis from the CVR in investigating flight accidents. The detailed frequency analysis alongside the flight data could prove to be very illuminating to investigators in recreating the events of a crash. Another potential use for the wavelet analysis in aircraft is a post flight inspection of the CVR. The analysis could be conducted and if any structural modes appeared that could prove fatal were present, then an inspection could be performed on the aircraft to ensure accidents involving fatigued engine mounts or some similar problem could be avoided altogether. 78 11 References [1] “Aircraft Accident/Incident Summary Report,” The Investigative Process Research Roundtable and Library, July 14, 2002 [2] “Accident Synopses – NYC92FA053,” The National Transportation and Safety Board, July 13, 2002 [3] McAllister, David, “Business Express N811BE Beech Model 1900C Airliner Accident: Cockpit Voice Recording Investigations,” The University of Texas at Austin, January 5, 1996. [4] Beckwith, Thomas, Maragoni, Roy, and Lienhard, John, Mechanical Measurements, 5th ed., Addison-Wesley, Massachusetts, 1995. [5] Torrence, Christopher and Compo, Gilbert P., “Wavelet Analysis; significance levels; confidence intervals”, http://paos.colorado.edu/research/wavelets/ [6] Farge, Marie, “Wavelet Transforms and Their Applications to Turbulence”, Annual Review of Fluid Mechanics, 24, p. 395-457 [7] McDonald, David; Budinszky, Andras; Lopategui, Ed., Structural Acoustics Monitoring Using Wire Transducers, Department of Aerospace Engineering and Engineering Mechanics, University of Texas at Austin; May 6, 1998. [8] Garland, Christopher; Javier Fuentealba, “Use of Wavelets for Detection of Transient Events”, M391C Report, December 14, 2001. [9] Torrence, Christopher and Compo, Gilbert P., “A Practical Guide to Wavelet Analysis”, Bulletin of the American Metrological Society, Vol. 29, No. 1, January 1998, p. 61-78.\ [10] Zwillenberg, Peter A., “Engineering Structural Dynamics Report: Model 1900 Flutter Analysis”, Beech Aircraft Corporation, Report No. 1900E361 DF. 79 Appendix A - MATLAB Wavelet.m File %WAVELET 1D Wavelet transform with optional singificance testing % [WAVE,PERIOD,SCALE,COI] = wavelet(Y,DT,PAD,DJ,S0,J1,MOTHER,PARAM) % Computes the wavelet transform of the vector Y (length N), % with sampling rate DT. % By default, the Morlet wavelet (k0=6) is used. % The wavelet basis is normalized to have total energy=1 at all scales. % % INPUTS: % Y = the time series of length N. % DT = amount of time between each Y value, i.e. the sampling time. % % OUTPUTS: % WAVE is the WAVELET transform of Y. This is a complex array % of dimensions (N,J1+1). FLOAT(WAVE) gives the WAVELET amplitude, % ATAN(IMAGINARY(WAVE),FLOAT(WAVE) gives the WAVELET phase. % The WAVELET power spectrum is ABS(WAVE)^2. % Its units are sigma^2 (the time series variance). % % OPTIONAL INPUTS: % % *** Note *** setting any of the following to -1 will cause the default % value to be used. % PAD = if set to 1 (default is 0), pad time series with enough zeroes to get % N up to the next higher power of 2. This prevents wraparound % from the end of the time series to the beginning, and also % speeds up the FFT's used to do the wavelet transform. % This will not eliminate all edge effects (see COI below). % % DJ = the spacing between discrete scales. Default is 0.25. % A smaller # will give better scale resolution, but be slower to plot. % % S0 = the smallest scale of the wavelet. Default is 2*DT. % % J1 = the # of scales minus one. Scales range from S0 up to S0*2^(J1*DJ), % to give a total of (J1+1) scales. Default is J1 = (LOG2(N DT/S0))/DJ. % % MOTHER = the mother wavelet function. % The choices are 'MORLET', 'PAUL', or 'DOG' % % PARAM = the mother wavelet parameter. % For 'MORLET' this is k0 (wavenumber), default is 6. % For 'PAUL' this is m (order), default is 4. % For 'DOG' this is m (m-th derivative), default is 2. % % OPTIONAL OUTPUTS: % % PERIOD = the vector of "Fourier" periods (in time units) that corresponds % to the SCALEs. % SCALE = the vector of scale indices, given by S0*2^(j*DJ), j=0...J1 % where J1+1 is the total # of scales. % % COI = if specified, then return the Cone-of-Influence, which is a vector % of N points that contains the maximum period of useful information 80 % at that particular time. % Periods greater than this are subject to edge effects. % This can be used to plot COI lines on a contour plot by doing: % % contour(time,log(period),log(power)) % plot(time,log(coi),'k') %---------------------------------------------------------------------------% Copyright (C) 1995-1998, Christopher Torrence and Gilbert P. Compo % University of Colorado, Program in Atmospheric and Oceanic Sciences. % This software may be used, copied, or redistributed as long as it is not % sold and this copyright notice is reproduced on each copy made. This % routine is provided as is without any express or implied warranties % whatsoever. % % Notice: Please acknowledge the use of this program in any publications: % ``Wavelet software was provided by C. Torrence and G. Compo, % and is available at URL: http://paos.colorado.edu/research/wavelets/''. % % Notice: Please acknowledge the use of the above software in any publications: % ``Wavelet software was provided by C. Torrence and G. Compo, % and is available at URL: http://paos.colorado.edu/research/wavelets/''. % % Reference: Torrence, C. and G. P. Compo, 1998: A Practical Guide to % Wavelet Analysis. <I>Bull. Amer. Meteor. Soc.</I>, 79, 61-78. % % Please send a copy of such publications to either C. Torrence or G. Compo: % Dr. Christopher Torrence Dr. Gilbert P. Compo % Advanced Study Program NOAA/CIRES Climate Diagnostics Center % National Center for Atmos. Research Campus Box 216 % P.O. Box 3000 University of Colorado at Boulder % Boulder CO 80307--3000, USA. Boulder CO 80309-0216, USA. % E-mail: torrence@NOSPAMucar.edu E-mail: gpc@NOSPAMcdc.noaa.gov % (remove NOSPAM from email addresses) %---------------------------------------------------------------------------function [wave,period,scale,coi] = ... wavelet(Y,dt,pad,dj,s0,J1,mother,param); if (nargin < 8), param = -1;, end if (nargin < 7), mother = -1;, end if (nargin < 6), J1 = -1;, end if (nargin < 5), s0 = -1;, end if (nargin < 4), dj = -1;, end if (nargin < 3), pad = 0;, end if (nargin < 2) error('Must input a vector Y and sampling time DT') end n1 = length(Y); if (s0 == -1), s0=2*dt;, end if (dj == -1), dj = 1./4.;, end if (J1 == -1), J1=fix((log(n1*dt/s0)/log(2))/dj);, end if (mother == -1), mother = 'MORLET';, end %....construct time series to analyze, pad if necessary x(1:n1) = Y - mean(Y); 81 if (pad == 1) base2 = fix(log(n1)/log(2) + 0.4999); % power of 2 nearest to N x = [x,zeros(1,2^(base2+1)-n1)]; end n = length(x); %....construct wavenumber array used in transform [Eqn(5)] k = [1:fix(n/2)]; k = k.*((2.*pi)/(n*dt)); k = [0., k, -k(fix((n-1)/2):-1:1)]; %....compute FFT of the (padded) time series f = fft(x); % [Eqn(3)] %....construct SCALE array & empty PERIOD & WAVE arrays scale = s0*2.^((0:J1)*dj); period = scale; wave = zeros(J1+1,n); % define the wavelet array wave = wave + i*wave; % make it complex % loop through all scales and compute transform for a1 = 1:J1+1 [daughter,fourier_factor,coi,dofmin]=wave_bases(mother,k,scale(a1),param); wave(a1,:) = ifft(f.*daughter); % wavelet transform[Eqn(4)] end period = fourier_factor*scale; coi = coi*dt*[1E-5,1:((n1+1)/2-1),fliplr((1:(n1/2-1))),1E-5]; % COI [Sec.3g] wave = wave(:,1:n1); % get rid of padding before returning return 82 Appendix B - MATLAB wave_bases.m File %WAVE_BASES 1D Wavelet functions Morlet, Paul, or DOG % % [DAUGHTER,FOURIER_FACTOR,COI,DOFMIN] = ... % wave_bases(MOTHER,K,SCALE,PARAM); % % Computes the wavelet function as a function of Fourier frequency, % used for the wavelet transform in Fourier space. % (This program is called automatically by WAVELET) % % INPUTS: % % MOTHER = a string, equal to 'MORLET' or 'PAUL' or 'DOG' % K = a vector, the Fourier frequencies at which to calculate the wavelet % SCALE = a number, the wavelet scale % PARAM = the nondimensional parameter for the wavelet function % % OUTPUTS: % % DAUGHTER = a vector, the wavelet function % FOURIER_FACTOR = the ratio of Fourier period to scale % COI = a number, the cone-of-influence size at the scale % DOFMIN = a number, degrees of freedom for each point in the wavelet power % (either 2 for Morlet and Paul, or 1 for the DOG) % %---------------------------------------------------------------------------% Copyright (C) 1995-1998, Christopher Torrence and Gilbert P. Compo % University of Colorado, Program in Atmospheric and Oceanic Sciences. % This software may be used, copied, or redistributed as long as it is not % sold and this copyright notice is reproduced on each copy made. This % routine is provided as is without any express or implied warranties % whatsoever. %---------------------------------------------------------------------------function [daughter,fourier_factor,coi,dofmin] = ... wave_bases(mother,k,scale,param); mother = upper(mother); n = length(k); if (strcmp(mother,'MORLET')) %----------------------------------- Morlet if (param == -1), param = 6.;, end k0 = param; expnt = -(scale.*k - k0).^2/2.*(k > 0.); norm = sqrt(scale*k(2))*(pi^(-0.25))*sqrt(n); % total energy=N [Eqn(7)] daughter = norm*exp(expnt); daughter = daughter.*(k > 0.); % Heaviside step function fourier_factor = (4*pi)/(k0 + sqrt(2 + k0^2)); % Scale-->Fourier [Sec.3h] coi = fourier_factor/sqrt(2); % Cone-of-influence [Sec.3g] dofmin = 2; % Degrees of freedom elseif (strcmp(mother,'PAUL')) %-------------------------------- Paul if (param == -1), param = 4.;, end m = param; expnt = -(scale.*k).*(k > 0.); norm = sqrt(scale*k(2))*(2^m/sqrt(m*prod(2:(2*m-1))))*sqrt(n); 83 daughter = norm*((scale.*k).^m).*exp(expnt); daughter = daughter.*(k > 0.); % Heaviside step function fourier_factor = 4*pi/(2*m+1); coi = fourier_factor*sqrt(2); dofmin = 2; elseif (strcmp(mother,'DOG')) %-------------------------------- DOG if (param == -1), param = 2.;, end m = param; expnt = -(scale.*k).^2 ./ 2.0; norm = sqrt(scale*k(2)/gamma(m+0.5))*sqrt(n); daughter = -norm*(i^m)*((scale.*k).^m).*exp(expnt); fourier_factor = 2*pi*sqrt(2./(2*m+1)); coi = fourier_factor/sqrt(2); dofmin = 1; else error('Mother must be one of MORLET,PAUL,DOG') end return 84 Appendix C - MATLAB WLF.m File clear all %Define time vector and initialize vectors for each sinusoidal component. dt=.0001; t=0:dt:1; l=length(t); x1=0*t; x2=0*t; x3=0*t; x4=0*t; x5=0*t; x6=0*t; x7=0*t; %Define properties of noise (random, centered about zero with maximum magnitude of 0.4) noise=(rand(1,l)-.5).*.8; %Construct each sinusoidal component x1=sin(2*pi*60*t); x2(1:l*.55)=x2(1:l*.55)+sin(2*pi*250*t(1:l*.55)); x3(l*.35:l*1)=x3(l*.35:l*1)+sin(2*pi*30*t(l*.35:l*1)).*exp(-2.5*(t(l*.35:l*1)-t(l*.35))); x4(l*.45:l*1)=x4(l*.45:l*1)+cos(2*pi*15*t(l*.45:l*1)); x5(l*.20:l*.25)=x5(l*.20:l*.25)+cos(2*pi*120*t(l*.20:l*.25)); x6(l*.60:l*.65)=x6(l*.60:l*.65)+cos(2*pi*200*t(l*.60:l*.65)); x7(l*.85:l*.855)=x7(l*.85:l*.855)+2*cos(2*pi*300*t(l*.85:l*.855)); %Synthesize final test signal by adding each sinusoidal component and noise x=x1+x2+x3+x4+x5+x6+x7+noise; %Calculate the FFT and Fourier Power Spectrum of the test signal z=fft(x); fps=(z.*conj(z))/l; %Define the required and optional inputs for the wavelet.m file pad = 1; % pad the time series with zeroes (recommended) dj = 0.25; % this will do 4 sub-octaves per octave s0 = 3*dt; % this says start at a scale of 400 Hz j1 = 10/dj; % this says do 10 powers-of-two with dj sub-octaves each mother = 'Morlet'; %Call the wavelet.m file to calculate the wavelet transform [W,period,scale]=wavelet(x,dt,pad,dj,s0,j1,mother,6); %Calculate the wavelet power spectrum wps=abs(W).^2; nm=repmat(fliplr(scale)',1,l); wpsn=wps.*nm; %The following section creates various plots % %Figure 1 shows the sinusoidal components, noise, and final test signal figure(1); subplot(9,1,1),plot(t,x1) ylabel('S1','position',[-.05 0],'rotation',0); subplot(9,1,2),plot(t,x2) ylabel('S2','position',[-.05 0],'rotation',0); subplot(9,1,3),plot(t,x3) ylabel('S3','position',[-.05 0],'rotation',0); 85 subplot(9,1,4),plot(t,x4) ylabel('S4','position',[-.05 0],'rotation',0); subplot(9,1,5),plot(t,x5) ylabel('S5','position',[-.05 0],'rotation',0); subplot(9,1,6),plot(t,x6) ylabel('S6','position',[-.05 0],'rotation',0); subplot(9,1,7),plot(t,x7) ylabel('S7','position',[-.05 0],'rotation',0); subplot(9,1,8),plot(t,noise) axis([0 1 -1 1]) ylabel('Noise','position',[-.05 0],'rotation',0); subplot(9,1,9),plot(t,x) xlabel('Time (sec)'); ylabel('Test Signal','position',[-.05 0],'rotation',0); %Figure 2 shows the original test signal and the DFT of the signal figure(2) subplot(2,1,1),plot(t,x) xlabel('Time (sec)'); ylabel('Signal','position',[-.05 .5],'rotation',0); subplot(2,1,2),plot(abs(z)) set(gca,'Xlim',[0 400]) xlabel('Frequency (Hz)'); ylabel('DFT','position',[-30 3000],'rotation',0); %Figure 3 shows the original test signal & the wavelet power spectrum (linear scale) figure(3); subplot('position',[0.1 0.75 0.682 0.2]),plot(t,x) xlabel('Time (sec)'); ylabel('Signal','position',[-.05 .5],'rotation',0); subplot('position',[0.1 0.1 0.8 0.55]),contourf(t,1./scale,wpsn),colorbar; xlabel('Time (sec)'); axis([0 1 0 400]) ylabel('Frequency (Hz)','position',[-.05 225]); %Figure 4 shows the original test signal & the wavelet power spectrum (log scale) s=0:1:j1; figure(4); subplot('position',[0.1 0.75 0.8 0.2]),plot(t,x) xlabel('Time (sec)'); ylabel('Signal','position',[-.05 .5],'rotation',0); subplot('position',[0.1 0.1 0.8 0.55]),contourf(t,s,wpsn); xlabel('Time (sec)'); ylabel('Scale','position',[-.05 20],'rotation',0); set(gca,'Ydir','reverse') %Figure 5 shows the wavelet power spectrum (linear scale) and a "top view" of the DFT figure(5) Z=repmat(fps(1:400),2,1); tt=1:400; ss=[0 1]; 86 subplot('position',[0.1 0.05 0.7 0.9]),contourf(t,1./scale,wpsn) axis([0 1 0 400]) xlabel('Time (sec)'); ylabel('Frequency (Hz)','position',[-.07 200]); subplot('position',[0.85 0.05 0.1 0.9]),contourf(ss,tt,abs(Z')) xlabel('Time (sec)'); %Figure 6 shows the original test signal and the Fourier power spectrum figure(6) subplot(2,1,1),plot(t,x) xlabel('Time (sec)'); ylabel('Signal','position',[-.05 .5],'rotation',0); subplot(2,1,2),plot(fps) set(gca,'Xlim',[0 400]) xlabel('Frequency (Hz)'); ylabel('Power Spectrum','position',[-30 1000]); %Figure 7 shows the Morlet wavelet we used figure(7) eta=-5:.01:5; psi=pi^(-.25).*exp(i*6*eta).*exp(-eta.^2./2); plot(eta,real(psi),eta,imag(psi),':') legend('Real Part','Imaginary Part') 87 Appendix D - MATLAB wave10.m File %*************************************************************** %******Wavelet and Fourier analysis input code %****** Last Modified on 8/12/02 % % INPUTS: % % dj = The spacing between discrete scales. A smaller % # will give better scale (frequency) resolution, % but be slower to plot. % % w0 = The mother wavelet parameter. Acts like a resolution for % the frequency domain; the higher the finer the resolution. % For 'MORLET' this is k0 (wavenumber), default is 6. % For 'PAUL' this is m (order), default is 4. % For 'DOG' this is m (m-th derivative), default is 2. % % Wavechoice = The mother wavelet function. % The choices are 'MORLET', 'PAUL', or 'DOG' % Morlet and Paul are complex wavelets and % are more suitable to the signal analysis % performed on the CVR. The DOG is real. % % choice3 = Chooses the y-axis variable - frequency or % scale. The frequency axis allows for a more % physical interpertation of the output. % % INPUTCHOICE.m: % filechoice = Allows the user to enter which signal % file (in .wav format) to use. % % t0 = Sets the start time of the time axis. % % Fs = The sample rate of filechoice. % % Freqmin = The minimum frequency to analyze. % % Freqmax = The maximum frequency to analyze. % % choice = Selects which type of analysis to perform % on the signal (FFT, Wavelet). % %*************************************************************** clear all clc %*************************************************************** % USER INPUT SECTION %*************************************************************** disp('Current file choices: '); disp('1) decaytest'); disp('2) silent_pop2'); disp('3) 2_LDG_Gear_Amplified'); disp('4) silent_right_fail_1'); 88 disp('5) Test Signals'); disp('6) other'); filechoice = input('Enter in number of choice: ') clc if filechoice == 1 choice2 = 'decaytest'; t0 = 0; Fs = 10000; end if filechoice == 2 choice2 = 'silent_pop2'; t0 = 0; Fs = 44100; end if filechoice == 3 choice2 = '2_LDG_Gear_Amplified'; t0 = 0; Fs = 44100; end if filechoice == 4 choice2 = 'silent_right_fail_1'; t0 = 0; Fs = 44100; end if filechoice == 5 disp('Current file choices: '); disp('1)'); disp('2)'); disp('3)'); disp('4)'); disp('5)'); disp('6)'); disp('7)'); disp('8)'); disp('9)'); filechoice2 = input('Enter in number of choice: ') if filechoice2 == 1 choice2 = '5Hz_Signal'; t0 = 0; Fs = 10000; end if filechoice2 == 2 choice2 = '100Hz_Signal'; t0 = 0; Fs = 10000; end if filechoice2 == 3 choice2 = '1000Hz_1Sec'; t0 = 0; Fs = 10000; end if filechoice2 == 4 choice2 = '5Hz_1Sec'; t0 = 0; 89 Fs = 44100; end if filechoice2 == 5 choice2 = 'sig100'; t0 = 0; Fs = 44100; end if filechoice2 == 6 choice2 = 'sig1000'; t0 = 0; Fs = 44100; end if filechoice2 == 7 choice2 = '5Hz_3Sec'; t0 = 0; Fs = 10000; end if filechoice2 == 8 choice2 = 'sig100_2'; t0 = 0; Fs = 10000; end if filechoice2 == 9 choice2 = '1000Hz'; t0 = 0; Fs = 10000; end end if filechoice == 6 ls choice2 = input('Enter file name: ','s'); t0 = input('Enter in the start time of the signal: '); Fs = input('Enter in the Sample Rate: '); end clc Freqmin = input('Enter in the minimum Frequency to be analyzed: '); Freqmax = input('Enter in the maximum Frequency to be analyzed: '); clc disp('Select from the following:') disp('1) FFT') disp('2) Wavelet') choice = input('Enter Choice: '); clc if (choice == 2 | choice == 3) disp('Select from the following:') disp('1) Contour(x,y,z)') disp('2) Surf(x,y,z)') displayfunc = input('Enter Choice: '); clc end x = wavread(choice2); dt = 1/Fs; 90 t = t0 + (0:length(x)-1)/Fs; t = t'; l=length(t); sigsize = l; %*************************************************************** % END INPUT SECTION %*************************************************************** %*************************************************************** % FOURIER ANALYSIS SECTION %*************************************************************** if choice == 1 fftsize = fix(l/4); z=fft(x,(fftsize*4)); fps=(z.*conj(z))/(fftsize*4); z = abs(z); freq = Fs*(0:(fftsize))/(fftsize*4); freq = freq'; %*********************************************************** figure plot(freq,z(1:((fftsize)+1))) %plot(freq,fps(1:((fftsize)+1))) set(gca,'Xlim',[Freqmin Freqmax]) xlabel('Frequency (Hz)'); ylabel('DFT'); clear z fftsize fps freq end %*************************************************************** % END FOURIER ANALYSIS SECTION %*************************************************************** %*************************************************************** % WAVELET ANALYSIS SECTION %*************************************************************** if choice == 2 if choice == 3 clear z fftsize fps freq cwd = pwd; cd('z:\'); pack; cd(cwd); end % 1 = pad the time series with zeroes (recommended) pad = 1; disp('Wavlet choices: '); disp('1) Morlet'); disp('2) Paul'); disp('3) DOG'); Wavechoice = input('Enter in number of choice: ') clc 91 if Wavechoice == 1 mother = 'MORLET'; %This formula is valid... but it underestimates w0_c at low frequencies... %critical_wavenumber = 1.4343*Freqmin - 4.057 %This formula is also valid, and comes closer to w0_c at low frequencies critical_wavenumber = 1.43*Freqmin w0 = input('Enter in a wavenumber (6 is default): '); s0 = (w0 + sqrt(2+w0^2))/(4*pi)*Freqmax^-1; end if Wavechoice == 2 mother = 'PAUL'; w0 = input('Enter in a wavenumber (4 is default): '); s0 = sqrt(w0+.5)/(2*pi)*Freqmax^-1; end if Wavechoice == 3 mother = 'DOG'; w0 = input('Enter in a wavenumber (2 is default): '); s0 = (2*w0 + 1)/(4*pi)*Freqmax^-1; end %*************************************************************** % SIGNAL DIVISION SECTION %*************************************************************** %This would set the colobar axis -- it would allow you to % set all the sections to the same colorbar %v = [0, 1]; num_divisions = 1; seconds_section = input('Enter in the number of seconds per section: '); datasize = Fs*seconds_section; overlap = fix(((.2699*Freqmin^-1.04)*w0 + .1)*Fs); %Times 2 because correlation was made with only one half of the actual width... Max_Tone_Width = 2*(1.0896*Freqmax + 10.45)*w0^-.9; Min_Tone_Width = 2*(1.0896*Freqmin + 10.45)*w0^-.9; if l>datasize sigsize = datasize - overlap; start = 1; stop = datasize; num_divisions = 0; count = 0; while (start<l & count ~=2) num_divisions = num_divisions + 1; i = num_divisions; x1(:,i) = x(start:stop); t1(:,i) = t(start:stop); start = start + datasize - 2*overlap; if (start+datasize) < l stop = start + datasize - 1; lastsize = l - stop; else stop = l; start = stop - datasize + 1; count = count + 1; end end 92 else x1(:,1) = x; t1(:,1) = t; end clear t; signalsize = min(datasize, l); if displayfunc == 1 j1max = (2.442*10^7)/(signalsize^1.095); end if displayfunc == 2 j1max = (3.735*10^6)/(signalsize^.9696); end dj_min = (log2(Freqmax/Freqmin)/j1max) dj = input('Enter in a resolution: '); j1 = fix(log2(Freqmax/Freqmin)/dj); clc %*************************************************************** % END SIGNAL DIVISION SECTION %*************************************************************** for i = 1:num_divisions; %*************************************************************** % TRANSFORM GENERATION SECTION %*************************************************************** x = x1(:,i); %Call the wavelet.m file to calculate the wavelet transform [W,period,scale]=wavelet(x,dt,pad,dj,s0,j1,mother,w0); %Calculate the wavelet power spectrum wps=abs(W).^2; clear W; if i==1 start = 1; else start = overlap; end if (i==num_divisions & i~=1) stop = datasize; start = stop - (lastsize + overlap); else stop = sigsize; end wps = wps(:,start:stop); t = t1(start:stop,i); %*************************************************************** % END TRANSFORM GENERATION SECTION %*************************************************************** %*************************************************************** % WAVELET OUTPUT SECTION %*************************************************************** 93 frequency = 1 ./period; figure(i) if displayfunc == 1 contourf(t, frequency ,wps,10); end if displayfunc == 2 surf(t, frequency ,wps); shading interp; if num_divisions>1 temp = length(t); axis([t(1), t(temp) frequency(j1+1) Freqmax]) else axis([0, t(l) frequency(j1+1) Freqmax]) end end set(gca, 'layer', 'top', 'xgrid', 'on', 'ygrid', 'on'); if i == 1 v = caxis; v = 1.1*v; %v = [0,.015]; end caxis(v); if i == num_divisions colorbar; end xlabel('Time (sec)'); ylabel('Frequency (Hz)'); W0 = num2str(w0); DJ = num2str(dj); MAX_Tone_Width = num2str(round(Max_Tone_Width*10)/10); MIN_Tone_Width = num2str(round(Min_Tone_Width*10)/10); description = [mother, ', ', 'w0= ', W0, ', ', 'dj= ', DJ, ', ', 'Max Seperation= ', MAX_Tone_Width, 'Hz, ', 'Min Seperation= ', MIN_Tone_Width, 'Hz']; title(description) if i~=num_divisions disp('paused - This allows you to save the figure and close it so Matlab does not crash...') pause clc end clear wps t x frequency % M = getframe; % M1 = frame2im(M); % imwrite(M1,'test.tif','tiff'); %*************************************************************** % END WAVELET OUTPUT SECTION %*************************************************************** end end %*************************************************************** % WAVELET ANALYSIS SECTION %*************************************************************** 94 Appendix E - MATLAB sigen1.m File %This Program Generates Simple Sinusoidal Test Signals clear all close all %Creates Time Steps Rate = 1/10000; % 1/10000 Sec Sampling Rate dt= Rate; t=0:dt:3; l=length(t); %Signal Initilazation y1=0;y2=0;y3=0;y4=0;y5=0; F1=0;F2=0;F3=0;F4=0;F5=0; %Enter Frequencies F1 = 300; F2 = 500; F3 = 000; F4 = 400; F5 = 0; %Initilize Signals x1=0*t;x2=0*t;x3=0*t;x4=0*t;x5=0*t;x6=0*t;x7=0*t; %Create Signals x1(1:l*.3)=x1(1:l*.3)+sin(2*pi*F1*t(1:l*.3)); x2(l*.3:l*.6)=x2(l*.3:l*.6)+sin(2*pi*F2*t(l*.3:l*.6)); x3(l*.4:l*.7)=x3(l*.4:l*.7)+sin(2*pi*F3*t(l*.4:l*.7)); x4(l*.6:l*1)=x4(l*.6:l*1)+sin(2*pi*F4*t(l*.6:l*1)); %x5=sin(2*pi*600*t).*exp(-1*t); %x6(l*.35:l*1)=(x6(l*.35:l*1)+sin(2*pi*600*t(l*.35:l*1)).*exp(-2.5*(t(l*.35:l*1)-t(l*.35))))*.5; x6(l*.35:l*.45)=x6(l*.35:l*.45)+sin(2*pi*600*t(l*.35:l*.45)); x7(l*.48:l*1)=x7(l*.48:l*1)+sin(2*pi*600*t(l*.48:l*1)).*exp(-2.5*(t(l*.48:l*1)-t(l*.48))); %combine signals x = (x1 + x2 + x3 + x4 + x5 + x6 + x7); dd = max(x); x = x/dd; %play wav wavplay(x,1/Rate) % %write signal to wav file wavwrite(x,1/Rate,'DecayTest') disp('Output wav file as: DecayTest') figure(1) subplot(7,1,1) plot(t,x1) ylabel('Signal 1','position',[-.2 0],'rotation',0); subplot(7,1,2) plot(t,x2) 95 ylabel('Signal 2','position',[-.2 0],'rotation',0); subplot(7,1,3) plot(t,x4) ylabel('Signal 3','position',[-.2 0],'rotation',0); subplot(7,1,4) plot(t,x5) ylabel('Signal 4','position',[-.2 0],'rotation',0); subplot(7,1,5) plot(t,x6) ylabel('Signal 5','position',[-.2 0],'rotation',0); subplot(7,1,6) plot(t,x7) ylabel('Signal 6','position',[-.2 0],'rotation',0); subplot(7,1,7) plot(t,x) hold on ylabel('Test Signal','position',[-.2 0],'rotation',0); xlabel('Time (sec)') 96 Appendix F – Wavelet Analysis Plots In this Appendix are all plots produced by the Matlab wavelet analysis codes. Each picture represents a certain frequency range from 5 Hz to 6000 Hz. NOTE: the power spectrums are not identical for each picture, so the color ranges are NOT comparable to one another. 97