.‘um 1. 11—1 1' 1 ”I... 3”,...” 1 1 1 ~11» .. 1,,1- ...,,..,....; ..1 1. r 1‘..:,..: ,,.....'.,,... 1 'I n « “11119-1 ,.,..'1.\...'.11' 1 /I I j "1” 'j’.'11. .11.. - 1 m «4' .,-.f_ «I [<1 1.. 11 - 1..1.I1 ' ,_..,,-,..1.. . . '1'."' 1. .11 , 1451» “2...! 1. ..1I1 r4! 1 ‘ ”.111. "1- « "4.1,- .114»: , hum-1 .. ', ,LI.;1.. :1 ",.','..1111 1 :1 ., ,1,..~1«.1 .11 1:1 1- ,.;.’.'..1‘2, 1: ‘l’n. 1.... n. 1;- 31111.51"? u 1 .....d..(..‘ ,, ,,,..11'-¢ ._ ""51"“. L1» ”1 ‘. 41:31.” 11.:v1:1'1- “,3" . ".' 11”...” ’1 ~11 1.1.41. z}: . ,1- . ..1 '1, .-,.. ,.- .1 . ‘zuu'v o» 1 " ”‘ ' ‘V - .. 1 113:, .“ 1V T -1... 1. Tu. “11...“... .-. -- ’( u . 1- 1- ~11 1 r' 11.1.-" 1.... 2 fl“ , l. 11.: ,1 . 5.91-3.1- #11,”:er "L" wr- VII .15.: .- 11‘. ‘* .“.. .... _..11 CHI.» 1. ‘.. ”1.14: pm w ...,:,..1,~11. 13'";- 1 'V. ..,1.. M111x? . «-111 _,'.‘.:....... 1.1).- r} , ,_..1' .'11- f“: -~~uuxdnfi f11‘w 1 1.1. “r. 1.-. .11—1 11-1 , 11-1—111- 1.9.1 1 1-!” 1‘"..— -. 11‘.” a... ,,....;...‘ anon-MYJI N...” 'e A um; J-‘val uni-“I 533.:;N1 ... 1'.» :ov‘;--vu—4 .~.. 11.11“: .31 III-I .111..- .11. 1 11“.... A”, 4 11. INJNLM , , _£. 1», 11.1... ... 1n . ..,..".:. ”,1... ..-1 41-1- v» H, 1......11-1-1 1’11 _.. lllllllllllllllllllllllllllllllllllllllllllllllllllllllllll 1293 00786 9286 was This is to certify that the thesis entitled Development of a Data Smoothing Software Package with Application to Smoothing Technique Comparison presented by Daniel J. Wilson has been accepted towards fulfillment of the requirements for M.A. degree in Physical Educ. ea - ew- Major professor te flflmg’ M1 /7/7 / 0-7639 MS U is an Affirmative Action/Equal Opportunity Institution r“ "W i LIBRARY Michigan State University x J fl PLACE IN RETURN BOX to remove this checkout from your record. TO AVOID FINES return on or before date due. DATE DUE DATE DUE DATE DUE MSU Is An Affirmative Action/Equal Opportunity Institution czhlmMuna-pd DEVELOPMENT OF A DATA SMOOTHING CONIPUTER SOFTWARE PACKAGE WITH APPLICATION TO SMOOTHING TECHNIQUE CONIPARISON By Daniel James Wilson A THESIS Submitted to Michigan State University in partial fulfillment of the requirements for the degree of MASTER OF ARTS School of Health Education, Counseling Psychology and Human Performance 1989 @050 505 ABSTRACT DEVELOPMENT OF A DATA SMOOTHING COMPUTER SOFTWARE PACKAGE WITH APPLICATION TO SMOOTHING TECHNIQUE CONIPARISON By Daniel James Wilson The purpose of this investigation was to create a flexible computer software package to assist the researcher of human motion in selecting and implementing appropriate data smoothing techniques. This was accomplished by including a tutorial in the package to instruct the researcher about the proper smoothing routine for each major classification of human motion. Validation of the smoothing routines was accomplished by calculating the mean square error associated with differences in data values between raw and smooth numeric data. All smoothing routines written for this investigation were found to be acceptable at a pre-determined level of ninety-five percent mean square agreement. The smoothing routines were compared and quantitatively ranked based upon their mean square error. The routines which consistently produced the best results, in descending order were: ( 1) natural cubic spline function, (2) Chebyshev polynomial, (3) Butterworth filter, (4) least squares polynomial, and (5) fourier series. It was noted that the natural cubic spline function produced no error. m DEDICATION TOMYPARENTS ACKNOWLEDGMENTS While attempting to write this acknowledgment, I find the task of identifying all those individuals who have offered their support overwhelming. So, for those not specifically mentioned here, I offer my deepest appreciation if they should find themselves reading this manuscript. The following individuals must be acknowledged both for their invaluable assistance in the completion of this project, and for demonstrating that friendship and caring are always the best teachers. I must begin by expressing my sincere appreciation to the man who has guided my graduate career, my committee chair, advisor, and friend, Dr. Eugene W. Brown. As always, I must thank my long time mentor and friend, Dr. Douglas E. Hanson, who continually provides the role model which guides so many toward achieving their goals. I offer a special thank-you to my committee member and friend, Dr. Tyler Haynes, who shows that a love of teaching comes from a love of students. Also, I feel I must express my gratitude to Dr. Vern Seefeldt, Dr. John Haubenstricker and Dr. Rebecca Henry for providing me with the research assistantships which allowed me to pursue my graduate education. Finally, thank-you to Mr. Kaveh Abani for his assistance in the interpretation of the mathematical theory which builds the foundation of this thesis. TABLE OF CONTENTS Chapter Page LIST OF TABLES ...................................................... viii LIST OF FIGURES .................................................... ix 1. INTRODUCTION ...................................................... 1 Statement of the Problem ......................................... 2 Purpose of the Study .............................................. 3 Need for the Study ................................................. 4 Delimitations of the Study ........................................ 5 Limitations of the Study .......................................... 5 Definitions of Terms ............................................... 6 II. REVIEW OF RELATED LITERATURE ............................ 8 An Assessment of Selected Data Smoothing Techniqes ....... 8 Least squares approximation ................................ 8 Cubic spline functions ........................................ 9 Fourier series .................................................. 10 Chebyshev polynomials ...................................... 10 Butterworth filter .............................................. 1 1 Classification System for Motion Studies ....................... 12 The Past and Present of Computer Software and Future Considerations for Development ........................ 15 III. DEVELOPMENTAL METHODOLOGY AND EXPERIMENTAL PROCEDURES .................................. 17 Criterion for Inclusion ............................................. 17 Structure of the Program .......................................... 19 Developmental Procedures ....................................... 20 Least squares approximation ................................. 20 Spline functions ............................................... 22 vi Chebyshev polynomials ...................................... Fourier series .................................................. Butterworth filter .............................................. Validation of the Program ......................................... Comparison of Technques ........................................ Use of the Computer Program ................................... Summary ............................................................ RESULTS AND DISCUSSION ...................................... Data Smoothing Information Questionnaire ..................... Comparison of Smoothing Methods ............................. Validation ....................................................... Comparison of techniques ................................... Using the software package ................................ Summary ....................................................... CONCLUSIONS ....................................................... Summary ............................................................ Findings ............................................................ Implementation .................................................... Recommendations for Further Research and Development . . . REFERENCES .......................................................... GENERAL REFERENCES ........................................... APPENDIX A Data Smoothing Questionnaire .................... APPENDD( B Numeric Data ........................................ APPENDIX C Data Smoothing Software Package ............... vii 23 23 24 24 25 26 26 27 27 3O 30 31 35 35 40 40 4o 41 42 43 45 47 so 56 LIST OF TABLES Table Page 1 Literature Review Frequencies by Motion Classification ............................................................. 14 2 Summary of Data Smoothing Information Questionnaire ........... 28 3 Mean Square Difference for Exact Numeric Data ................... 32 4 Data Smoothing Routine Ranking by Motion Classification in Descending Order .................................... 33 viii Figure LIST OF FIGURES Page The Trigonometric Nature of Repeating or Oscillatory Motion ..................................................... 12 Digital Filter Black—Box Design ...................................... 13 Block Diagram of Motion Classifications ........................... 15 Flow Chart of Developmental Procedures in Creating a Software Package .................................................... 21 Main Menu of Data Smoothing Software Package ................. 36 Tutorial Menu Screen .................................................. 36 Tutorial Screen from Least Squares Approximation ............... 37 Main Screen for Inputting Data from Disk .......................... 37 Entering Drive and Filenarne for Data Retrieval from Disk ........ 38 Main Menu for Data Smoothing Techniques ........................ 38 Smoothed Data Curves from Various Data Smoothing Techniques .............................................................. 39 CHAPTER I INTRODUCTION The biomechanical analysis of human motion is a complicated and time consuming task. Our predecessors, uu'lizing qualitative observation techniques, realized the complexity of analyzing human motion and sought to develop quantitative techniques (Bates, 1973; Hoffman and Warsham, 1971; and Ward, 1971). These quantitative methods were developed to help solve the problem of reducing human movement to a speed which could be effectively analyzed. Human movement often occurs far too rapidly to be observed and accurately analyzed with the naked eye. This is especially true in sports skills in which the goal of performance is to produce maximal velocity, acceleration, and/or force. With the advent of the high speed motion picture camera, technology gave the researcher a new tool to assist in capturing movement. The development of this electronic "eye" to assist researchers derives its origin from the early sequential still photographs taken by Muybridge in order to make general statements as to the nature of human and animal motion. The plates presented in his book, Animgs in Motion (c1899), include brief descriptions of body segment reactions to various every-day tasks. From this beginning, the high speed motion picture camera has evolved into an invaluable tool for the collection of film data used in biomechanical research. With the development of the high speed motion picture camera, a powerful new device for the investigator of human motion, also came new problems in the analysis and interpretation of data. Two major complications faced the investigator. The first problem came in the form of overwhelming amounts of data which had to be organized and interpreted. Recorded images collected by means of high speed motion picture photography needed to be converted into cartesian coordinate values. The advent of electronic digitzers, instruments which could electronically convert points located on projected film images into coordinate data, effectively bridged the gap between the acquisition of data and the subsequent transformation of that data to a usable electronic form. From film taken at one hundred frames per second, a typical rate used by researchers who analyze sports skills and physical activities, three-thousand or more body segment coordinate pairs could be generated in the analysis of just ten seconds of filming. The investigation of movement through high speed motion picture techniques was made practical by the invention of the digital computer. The ability of the digital computer to store, retrieve, display, and analyze vast amounts of data made it an invaluable tool in biomechanical research. The impact of the computer on data processing in general is best stated by Blakesley: CHAPTER I INTRODUCTION The biomechanical analysis of human motion is a complicated and time consuming task. Our predecessors, utilizing qualitative observation techniques, realized the complexity of analyzing human motion and sought to develop quantitative techniques (Bates, 1973; Hoffman and Warsharn, 1971; and Ward, 1971). These quantitative methods were developed to help solve the problem of reducing human movement to a speed which could be effectively analyzed. Human movement often occurs far too rapidly to be observed and accurately analyzed with the naked eye. This is especially true in sports skills in which the goal of performance is to produce maximal velocity, acceleration, and/or force. ‘ With the advent of the high speed motion picture camera, technology gave the researcher a new tool to assist in capturing movement. The development of this electronic "eye" to assist researchers derives its origin from the early sequential still photographs taken by Muybridge in order to make general statements as to the nature of human and animal motion. The plates presented in his book, Animals in Motion (c1899), include brief descriptions of body segment reactions to various every-day tasks. From this beginning, the high speed motion picture camera has evolved into an invaluable tool for the collection of film data used in biomechanical research. With the development of the high speed motion picture camera, a powerful new device for the investigator of human motion, also came new problems in the analysis and interpretation of data. Two major complications faced the investigator. The first problem came in the form of overwhelming amounts of data which had to be organized and interpreted. Recorded images collected by means of high speed motion picture photography needed to be converted into cartesian coordinate values. The advent of electronic digitzers, instruments which could electronically convert points located on projected film images into coordinate data, effectively bridged the gap between the acquisition of data and the subsequent transformation of that data to a usable electronic form. From film taken at one hundred frames per second, a typical rate used by researchers who analyze sports skills and physical activities, three-thousand or more body segment coordinate pairs could be generated in the analysis of just ten seconds of filming. The investigation of movement through high speed motion picture techniques was made practical by the invention of the digital computer. The ability of the digital computer to store, retrieve, display, and analyze vast amounts of data made it an invaluable tool in biomechanical research. The impact of the computer on data Processing in general is best stated by Blakesley: "In the broadest and simplest concepts, computers have their greatest value in extending man 's mental capacities in two interrelated areas. Computers are useful where: (1) significant time- c-onsuming, repetitious, and voluminous operations of data and facts exist; and (2) where not so simple, but significantly more complex calculations and logical determinations are to be made." (1967, p. 185). The second point made by Blakesley applies to the analysis of high speed motion picture data. Kinematic and kinetic calculations of body segment parameters are complex. Minimizing the possibility of human error by using the capabilities of the digital computer to perform mathematical calculations further decreases the burden placed on the researcher. The second problem arising from cinematographical analysis of human movement is related to the transfer of information into usable form. In order to obtain usable data from film, the images must be transformed into a series of coordinates by use of an electronic digitizer. This process introduces a "noise" component into the numerical data values obtained. Noise can be defined as: "Error present in data collected that is unrelated to the process being studied" (Rodgers and Cavanagh, 1984). Error is introduced into the data by a variety of sources. These include the inherent vibration of high speed motion picture cameras and noise produced through human error (e.g., subjective selection of reference points). In the process of electronicly digitizing points on a projected image of the body, a certain amount of subjective judgement is needed in order to locate body landmarks. Consistently choosing the exact location of a selected body landmark is a demanding task for even the most experienced and persistent investigator. The noise created by these potential sources of errors, while perhaps not evident within the raw positional data, may become magnified when they are applied to high-order derivatives, characteristic of certain data smoothing techniques. If researchers are to extract meaningful kinematic and kinetic analyses from cinematographic data, appropriate data smoothing methods which minimize inherent errors associated with derived values is critical. Statement of the Problem The problem of this investigation was to create and validate a versatile general purpose computer program for data smoothing that could also be used to compare various smoothing techniques. The program was designed to assist researchers in minimizing the influence of "noise" associated with the cinematographical analysis of human movement by guiding them in analyzing the output from various data smoothing techniques. The process of carrying out this study was divided into two parts: (1) the design and development of a computer program that could be used to smooth numeric data, and (2) the validation of the program through comparisons of various smoothing techniques applied to biomechanical data. The first part of the plan was carried out through the development of a general purpose computer software package on an IBM AT personal computer in the BASIC programming language. BASIC was selected because of the universal familiarity among researchers and ease of learning for those not trained in computer programming. The package breaks down the smoothing process into component parts. The parts of the package include: (1) a tutorial to assist the researcher in selecting a proper data smoothing technique; (2) an input/output routine allowing for varying internal/extemal storage formats to assure maximal flexibility in data entry; (3) a menu for selection of different smoothing techniques and; (4) kinematic descriptions of data including graphic displays of position, velocity, and acceleration. The package is designed in this fashion because of the critical need for selecting the appropriate smoothing technique. Flexibility of input and output of data are maintained in view of this program being part of a larger proposed software package for the complete kinematic and kinetic analysis of biomechanical information. The input/output routines link these individual packages together and varying internal storage formats may occur through different programmers. It is a function of this package to allow for versatility of format. The second part of this plan was validation. Validation of the data smoothing routines was accomplished by comparison of the mean percent error between the generated numeric data values and the resultant smoothed data. Zernicke, Caldwell, and Roberts (1977) utilized a similar method in determining the mean percent error when comparing force platform data of typical human gait. In their study, a 95.25 percent mean agreement was reached based upon these comparisons. For the purposes of the current investigation, a ninety-five percent mean agreement has been established to determine acceptability of the smoothing routines. Purpose of the Study The purpose of this study was to create a flexible computer software package to assist the researcher of human motion in selecting and implementing appropriate data smoothing techniques. This was accomplished by including a tutorial in the package to instruct the researcher about the proper smoothing method to select for each Classification of motion. All routines in the package are menu—driven to guide the investigator in the use of each program. This will aid researchers, coaches, and M L...- 4 educators in making more precise kinematic descriptions of movement from cartesian coordinate data generated from high speed film. The program will serve as the second phase of a three part process (data acquisition, data smoothing, and data analysis) in biomechanical investigation utilizing high speed motion picture photography. Need for the Study The smoothing of biomechanical data, as a research topic, takes its origins from the mathematical subject of numerical analysis. Since biomechanics is a relatively new field of study, the amount of investigation specifically related to data smoothing is limited to relatively few studies. Among the researchers who have attempted to develop computer programs for data smoothing, the approaches have been diverse, creating problems in generalizing results from one program to another. This lack of continuity between software packages comes in many forms. The input/output format is the first problem that arises in these programs. Since each investigator has his/her own style of computer programming, the corresponding methods of input and output are unique to that author. This can create problems in comparisons of output generated by different programs. With a more universal approach to the design of these procedures, the opportunity for comparison of analyses of various computer programs is created. The actual kinematic and kinetic output from these programs is a second problem. Each researcher develops specific routines needed in the interpretation of his/her own data. Therefore, the ability to compare and contrast results may not be available since these calculations may not have been performed. The problem being addressed most prominently within this investigation is the selection of the proper smoothing technique for the data being analyzed. This step is often taken for granted because researchers develop smoothing routines specific to a type of data being collected. If researchers are to make the information gained through biomechanical investigation available to coaches and educators in the field, they must make the tools suitable for their use. A selection of smoothing routines, together with a tutorial to aid users in their selection, is a logical solution to this problem. The need for the study, then, becomes the design and development of a computer program for data smoothing which can be used by researchers, coaches, and educators. It is to be designed to allow the user to analyze the results of the cinematographical data. Comparisons become critical in demonstrating the selection of appropriate techniques. 5 Delimitations of the Study The following delimitations refer to the development of the computer program: H . The program is written in the BASIC computer language specifically for an IBM or IBM compatible microcomputer. N . Kinematic calculations performed within the program are for motion in one plane at a time. U) . Availablility of memory size specific to a microcomputer restrict the number of data points allowable. .5; . Graphic comparisons of only two curves at one time are allowable, due to memory space availablity on some microcomputers. Ur . Classifications of motion given in this study are not those typically found in physical activity, but are laboratory conditions developed to allow for testing. The data generated for each classification contains no error, thus facilitating direct comparison. Limitations of the Study Human motion occurs in a three dimensional space. Using cinematographical techniques, it is possible to study motion either from a two or three dimensional perspective. Because of the nature of photographic techniques, three dimensional analysis of movement is a complicated process. However, through the use of proper analytical tools, three dimensional investigation should be utilized when appropriate. The problem which arises in high speed cinematography is that a single camera can only record within a plane of motion (x,y coordinate system). It is through the use of multiple cameras that a three dimensional view of the action being investigated can be accomplished (x, y, z coordinate system). The single plane of action captured by each individual camera in a study employing multiple cameras can be converted into three dimensional coordinates by the use of a direct linear transformation routine (Shapiro, 1978). Although this process will not be used in this study, a detailed discussion of this procedure can be found in Walton (1981). Definition of Terms Terms defined in this section are primarily based on those given by Rodgers and Cavanagh (1984.) Acceleration. The rate of change of velocity with respect to time, mathematically, the second time derivative of displacement and the first time derivative of velocity. This term applies to both linear ( straight line), and angular (curved path) motions. BASIC. Beginner's All-Purpose Symbolic Instructional Code. Derivatives. Quantities obtained by the process of differentiating a given curve or function. The most commonly used derivatives are of displacement (x) where first derivatives dx/dt = velocity, and second derivative (PX/dt2 = acceleration. Differentiation. A technique of calculus for finding the rate of change of a quantity. Digitizer. A device that is capable of acquiring planar coordinates in numerical form. In biomechanics, the most frequent use of a digitizer is to convert the location of body markers on the projected image of a film into numbers that can be processed by a computer. Displacement. The change in the position (linear or angular) of a body. Force. A vector quantity that describes the action of one body on another. Integration.A technique of calculus for determining the area enclosed between a curve and the x-axis. This can result in either a single value or a new curve derived from the varying function. Integration can be performed either graphically, mathematically, or numerically. It is the inverse process of differentiation. Kinematics. The description of motion. Kinetics. The study of the forces that cause motion. Noise. Error present in data collected that is unrelated to the process being studied. Some noise is almost always present in data collected in biomechanics and most other fields (e.g., vibration). Smoothing. A class of techniques for reducing the effects of noise. Software. Sets of instructions called programs that cause a computer to execute certain operations. Vector. A quantity that has both direction and magnitude. Velocity. A measure of a body's motion (linear or angular)in a given direction. 7 Because velocity has both magnitude and direction, it is a vector quantity that can be positive, negative, or zero. CHAPTER H REVIEW OF RELATED LITERATURE This chapter has been structured to present a detailed review of smoothing methods being applied in biomechanics research that utilizes high speed cinematography. A three part approach has been selected to give a logical sequence to the presentation of this information. The first section will give an assessment of each technique to be incorporated in the computer software package, including a brief description of the method and the main considerations for its use. Part two includes a flow diagram of motion classifications and a frequency table based on a review of research articles in biomechanics which incorporate the use of specific data smoothing routines. The third part is a discussion of the past and present state of data smoothing software and future considerations for computer application development. An Assessment of Selected Data Smoothing Techniques Several investigations have addressed problems associated with data smoothing. Generally, these studies have focused on a particular smoothing method. The development of a general purpose computer software package incorporates several of these routines. Therefore, each data smoothing technique selected will be reviewed. A brief description of each method will be given, followed by a discussion of its relative merits and considerations for utilizing the procedure. Least-squares approximation The least-squares approach to curve fitting involves developing rn equations (the normal equations) which minimize the sum, S, of the squares of the deviations of the equation: S = 2 [yr -p(ti )lz, (2-1) where Z is the summation of i from 1 to n (n = number of coordinate data pairs). The In equations can be solved sirnutaneously to yield the coefficients for a least-squared fit of a polynomial of degree m to a set of empirical data (Wood, 1982). The popularity of local least-squares approximation techniques has resulted from their simplicity of 9 application, and the convienience of this procedure in determining linear approximations (Burden and Faires,1985). With this technique, smoothed data values and corresponding derivatives can be directly obtained from experimental data. Also, if the nature of the data is known or can be assumed to have its mean distributed in a linear manner, the values obtained from a linear least-squares routine are unbiased estimates for the equation that describes the line of best fit through the mean (Dodes, 1978). Decisions made in applying the least-squares approximation technique includes: (1) the degree (m) of the approximating polynomial, (2) the number of data points (n) to include in the smoothing and differentiation formula, and (3) the number of repeat applications of the smoothing algorithm prior to the use of the differentiation formula (Wood, 1982). The degree of the approximating polynomial (m) should be less than four according to Hershey et a1. (1971). However, larger degree polynomials may be necessary when greater error is present within the data. Selection of the number of data points (n ) and repetitions are at the discretion of the investigator. It should be kept in mind, however, that over smoothing is possible with a large n (number of data points) or number of repetitions. Cubic spline functions Mathematically, a spline function is a group of cubic polynomials arranged so that adjacent curves join each other with continuous first and second derivatives (Dodes, 1978). These polynomials are "pieced" together at points in time (t ) called "knots" (xj ; j =l,2 ....... n ). The resulting cubic spline function consists of n -1 cubic polynomials of the form: g=pj=aj+bj—- H - -4.913 I \1 50¢ -26.99.99 -35. 3699 -46.655?9 -59.313?9 -74.037?3 -91.125 l h-hMEJL-Jfidt . 'L'IIJQO‘C- -4.B -110.592 -5.100001 ~132.651 -5.400001 -157.4b41 -5.700001 -135.1931 -6.0QOOOI -216.0001 -6.300001 -250.0471 —é.300002 -237.4962 -6.900002 -328.5092 -7.200002 -37?.2433 -7.500002 >-421.8754 -7.800002 -474.552 -3.100003 -531.4415 —8.400002 -592.7045 -8.7000O2 -658.5036 -?.000003 -729.0003 -9.300003 -804.3578 -9.600003 -334.7369 -9.900003 -970.3001 -10.2 -1061.209 -10.5 -1157.b26 -10.S -1259.713 -11.1 -1367.633 -11.40001 -1431.S46 -11.70001 -1601.615 -12.00001 -1723.002 -12.30001 -1360.369 -12.60001 -2000.373 -12.70001 -2146.692 -13.20001 -2299.971 -13.50001 -2460.37S -13.30001 ~2623.075 ~14.10001 -2303.22 -14.40001 -2985.983 -14.70001 -3176.527 -15.00001 -3375.005 -15.30001 -3581.‘82 -15.60001 -3796.421 CONSTANT HARHONIC DATA 2 .9092975 4 -.7563026 6 -.2794155 3 9993532 10 -..5440212 12 - 536573 14 9906074 16 - 237903 13 - 7509373 2) 9129452 22 3351309503 24 - 9055734 26 .7625535 23 .2709058 30 - 9880317 32 .5514267 34. .5290327 36 -.9917739 33 2963636 40 .7451132 2 -.9165216 44 1.7701935-02 46 .9017884 43 -.7632547 50 -.2623749 52 .9866276 54 -.5537391 56 -.52155_1 53 .9928726 60 -.3043107 62 -.7391307 64 .9200261 66 -2.6551!SE-02 68 -.3979273 70 .7733907 72 .2533234 74 -.9851463 76 .5661076 73 .5139735 30 -.?938387 32 .313239 34 .7301904 36 -.9234585 :33 .0333983 90 .3939966 92 -.7794661 94 -.245252 96 9335373 93 -.5733319 100 -.5063657 102 .9948269 104 -.3216224 106 -.7271425 108 .9263136 54 55 VARYING HARHONIC DATA 1 -.4161469 2 -. o .4 7 -.1455 3 -.9111303 13 .1367372 14 -.7596379 19 .4030321 20 -.5477293 “— 25 .6469194 " 2» -.2921338 31 .3342224 32 4327675542 37 .9550737 33 2.66643 43 9793434 44 .525322 49 9649661 50 7421543 55 .3532202 56 .8993669 61 .6735071 62 .9858966 67 .4401431 68 .9m904 73 .1717173 74 9217512 79 -.1103872 so 776686 85 -.3836935 96 .5697504 91 -.6264445 92 .3174237 97 -.3l92883 98 3.932033342 103 -.9463631 104 -.2409591 109 -.9990209 110 -.5025443 115 -.9715922 116 -.7240973 121 -.3667671 122 -.3379639 127 -.6923953 12 -.9311056 133 -.4633289 134 -.9960879 139 -.1973136 140 —.9317224 145 3395944502 146 -.7931365 151 .3590443 15 -.5913697 157 .6055279 153 -. 3424943 APPENDIX C 56 100 OIM X1( 500),Y1(500),NP(100),PH$(100),TV(100) : UP 200 _DIM BF1(1) ,BF2(1),C31(1), I332(1),CP1(1),CP2(1),F31(1),F32(1),L31(1),L82(1) 300 REM: 400 REM: 1000 REM: ALL OTHER PROGRAMS BRANCH TO THIS POINT. 1100 REM: 1200 REM: 1300 KEY OFF 33 00 REM: 3900 CLS 4000 LOCATE 1,15 4100 PRINT “#***************§******44*******§**************§*§*§*" 4200 LOCATE 2,15 4300 PRINT "* *" 4400 LOCATE 3,. 4500 PRINT "*" : COLOR 0,7 : LOCATE 3,30 : PRINT "DATA" : CO 5 : COLOR 0,7 : PRINT "SMOOTHING" : COLOR 7,0 : LOCATE 3,45 "PROGRAM” : COLOR 7,0 : LOCATE 3,67 : PRINT "*" 4600 LOCATE 4,15 4700 PRINT ”* *" 4800 LOCATE 5,15 4900 PRINT "*" : COLOR 0,7 : LOCATE 5,22 : PRINT "SCHOOL OF HEALTH EDUCATION, CO UNSELINO“ : COLOR 7,0 : LOCATE 5,67 : PRINT "*" 5000 LOCATE 6,15 5100 PRINT "* *" 5200 LOCATE 7,15 5300 PRINT "*" : COLOR 0,7 : LOCATE 7,26 : PRINT ”PSYCHOLOGY & HUMAN PERFORMANCE ": COLOR 7,0 : LOCATE 7,67 : PRINT "4" 5400 LOCATE 8,15 5500 PRINT TAB(15) "*" TAB(67) "*" 5400 LOCATE 9,15 5700 PRINT "*":COLOR 0,7:LOCATE 9,29:PRINT"MICHIOAN STATE UNIVERSITY"=COLOR 7,0: LOCATE 9,67 : PRINT "*" 5300 LOCATE 10,15 5900 PRINT “4 *" 6000 LOCATE 11,15 6100 PRINT ”§***&**********4*&************#**§*§************#***§“ 6200 LOCATE 13, 6300 PRINT "TUTORIAL.. ...... ........................... 1“ 6400 LOCATE 14,19 6500 PRINT "INPUT DATA................................. 2“ 6600 LOCATE 15,1?’ 6700 PRINT "SAVE. 9DATA TO DISK.......................... 3" 6300 LOC'ATE 16, 6900 PRINT "VIEW yOATA AT TERMINAL ....... ...... ......... 4" L0 , O : OR R C PRINT 7 : LOCATE 3, 3 UL 0 7 : 5 57 7000 LOCATE 17,19 7100 PRINT "SMOOTH DATA.. ...... .,...................... 5" 7200 LOCATE 13,19 7300 PRINT ”SEND DATA TO PRINTER....................... 6" 7400 LOCATE 19 19 7500 PRINT ”GRAPH DATA......... ........... ............. 7" 7600 LOCATE 20,19 7700 PRINT "EXIT PROCRAM....... ............ ............ E" 7300 LOCATE 22,27 7900 INPUT "YOUR SELECTION PLEASE: ",N$ 8000 IF N$ = "1" THEN OOSUB 9300 3100 IF NS = "2" THEN CHAIN ” :3.INPUT",1000,ALL 3200 IF NS = “3” THEN CHAIN "A: .SAVE",1000,ALL 3300 IF NS = "4" THEN CHAIN ”A:C.VIEW",1000,ALL 8400 IF N$ = "5" THEN CHAIN "A' .3MOOTH",1000,ALL 3500 IF NS = "6" THEN CHAIN ”A . PRINT“,1000,ALL 8600 IF NS = "7" THEN CHAIN ”A:S.ORAPH",1000,ALL 3700 IF N$ = "3" THEN OOSUE 41000 8800 ERS = ”A:S.MAIN" : LN = 9000 3900 CHAIN "A=S.ERROR",1000,ALL 9000 OOTO 1400 9100 LOCATE 10,54 9500 REM: TUTORIAL SUBROUTINE FOR EXPLANATIONS OF HOW TO USE THE M. 9700 REM: ROUTINES & PROCEDURES IN THIS PROGRAM. 9800 REM: 9900 LOCATE 1,25 10000 PRINT "DATA SMOOTHING PROGRAM“ 10100 LOCATE 2,32 10200 PRINT "TUTORIAL" 10300 LOCATE 3,25 10400 PRINT "4*****§§§*4§**§**§***§" 10500 LOCATE 5,20 10600 PRINT “PLEASE SELECT ONE OF THE FOLLOWING:” 10700 LOCATE 7,15 10300 PRINT "NHAT IS DATA SMOOTHINO...................... 1" 10900 LOCATE 8,15 11000 PRINT “HOW DO I INPUT DATA ..... . ..... .............. 2” 11100 LOCATE 9,15 11200 PRINT “HOW DO I SAVE DATA ...... .................... 9” 11300 LOCATE 10,15 11400 PRINT ”HON DO I VIEU DATA ..... ............ ..... .... 4" 11500 LOCATE 11,15 11600 PRINT ”HOW DO I PRINT DATA ..... ... ....... ..... ..... 5” 11700 LOCATE 12,15 11300 PRINT "HOW DO I ORAPH DATA. ..... ........ ...... ..... 6 11900 LOCATE 13,15 12000 12100 12200 12300 12400 12500 12000 12700 12800 12200 13000 13100 13200 13300 13400 13500 13600 13700 13300 13900 14000 14100 14200 14300 14400 14500 14600 14700 14300 14900 15000 15100 15200 15300 15400 15500 15000 15700 15500 15900 16000 16100 10200 16300 58 PRINT "CHEBYSHEV POYNOMIALO. ..... ................. 7" LOCATE 14,15 PRINT "LEAST SOUARES APPROXIMATION... LOCATE 15,15 PRINT "FOURIER SERIES.............................. 9" LOCATE 16,15 PRINT "CUBIC EPLINE FUNCTION...................... 10" LOCATE 17,15 PRINT “BUTTERwORTH FILTERING...r ...... ....... ...... 11" LOCATE 15,15 PRINT "RETURN TO MAIN MENU........................ 2" LOCATE 21,25 INPUT "YOUR CELECTION PLEASE:”;N$ . . . . . . . u . . . . . . LII IF N5 = "1" THEN OOSUB 14300 IF N5 = "2" THEN OOSUB 17100 IF NS = "3" THEN OOSUB 21900 IF N$ = "4" THEN OOEUB 23900 IF N5 = "5" THEN OOSUB 25900 IF N$ = ”6" THEN OOSUB 27300 IF NS = “7" THEN OOSUB 29300 IF N$ = "8" THEN OOSUB 31900 IF NS = "9” THEN OOSUB 34200 IF NS = "10” THEN OOSUB 36100 IF NS = "11" THEN OOSUB 38400 IF NS = "12" THEN GOTO 1000 CLS = REM: INPUT ERROR OOSUB 9300 OOTO 9300 CLS REM: REM: *§***§*4§***#**§*******4*§§******§4*%********#******* REM: 4 wHAT IS DATA SMOOTHING * REM: 4%***§§4**********&§***************************§***** REM! LOCATE 1,25 PRINT "WHAT 15 DATA SMOOTHING?" LOCATE 2,25 PRINT ”**§*§****##*§*§**a§****” LOCATE 5,1 PRINT " Data SMOOthing is a may OF FiTtering Out “noise” FPOm raw data PRINT PRINT "The assumption made is that the data Fit a predetermined shape and" PRINT PRINT "that by Fitting the assumed shape t0 a “best-Fit“ with the Paw data 59 14400 PRINT 16500 PRINT "a smooth curve will'result.” 16600 LOCATE 22,24 16700 INPUT ”PRESS ANY KEY T0 RETURN TO MENU“,CB$ : GDTO 3300 16300 CLS 16900 LOCATE 22,24 17000 INPUT "PRESS ANY KEY TO RETURN TO MENU",ED$ = GDTD 9300 17100 CLS 17200 REM: 17300 REM: *§*****¥******************#**4**4**#e#****ee**%**#*** 17400 REM: * HUN DC! I INPUT UATA‘? 17500 REM: *****************************?*********************** 17600 REM: 17700 LOCATE 1,25 17300 PRINT "HOW DO I INPUT DATA?" 17900 LOCATE 2,25 13000 PRINT "****#***************" 13100 PRINT 2 PRINT 13200 PRINT " Inputting data is done by Following the instructions given an the screen.“ 13300 PRINT 13400 PRINT ”This can be done by either inputting Frdm the terminal or 5k. II 13500 PRINT 13600 PRINT ”When inputting From the terminal several important questions will b e asked.” 13700 PRINT 13300 PRINT "First, you will be asked to input a two line header For the File. T his will 13900 PRINT 19000 PRINT “be used to tell you which File you are using when either viewing or printing" 19100 PRINT 19200 PRINT “the File. Second, you will be asked to input the number 0F pairs of points” 19300 PRINT 19400 PRINT ”you will input. This is critical since the data is treated seperate ly as the" 13500 PRINT 19600 PRINT "number 0F entries beneath each header or pair. Third, you will be a +. n r-m a di 19700 LOCATE 22,23 19300 INPUT ”PRESS ANY KEY TO VIEW NEXT SCREEN",C;$ : CL3 19900 PRINT : PRINT 20000 PRINT ”to input the headers For the pairs. These will be placed above the 60 20100 PRINT 20200 PRINT ”later when viewing or printing the data. Fourth, you will be asked to tell" 20300 PRINT 20400 PRINT "whether the time interval is a constant. This is very common in Bio mechanical" 20500 PRINT 20600 PRINT "research. IF the interval is not constant you may now merely enter the time" 20700 PRINT 20300 PRINT "value, the X-coordinate, & the Y‘coordinate For each set oF values. 20900 PRINT 21000 PRINT "indicate the end oF your input enter ”E“ as prompted." 21100 PRINT 21200 PRINT " When inputting From a disk, you will give the disk drive ID & 21300 PRINT 21400 PRINT "Filename as explained in the program. The program will then automat 21600 PRINT "input the File & tell you how many pairs oF data points were in the File." 21700 LOCATE 22,23 21800 INPUT "PRESS ANY KEY TO RETURN TO MENI",CC$ : SOTO 9300 21?00 CLS 22000 REM: 22100 REM: §*§**&*****#§**§*u******§*************§********§*§*** 22200 REM: * HOW DO I SAVE DATA? # 22300 REM: ******4***#*§***§*******§***********#**********§§**§* 22400 REM: 22500 LOCATE 1,25 22600 PRINT "HON DO I SAVE DATA?" 22700 LOCATE 2,25 22300 PRINT "*********4**§*§§*§§” 2900 PRINT : PRINT 23000 PRINT ” Saving data to a disk is quite simple. First, you indicate whe ther the" 23100 PRINT 23200 PRINT "data being saved is to be used by this program or by the DATA ANALY SIS program." 23300 PRINT 23400 PRINT “ Second, you indicate which data File is to be saved. You then mere ly give the" 23500 PRINT 23600 PRINT "disk drive ID & Filename to be saved under 0 the rest is done autom 61 atically.” 23700 LOCATE 22,24 23300 INPUT "PRESS ANY KEY TO RETURN TO MENU",OO$ : OOTO 9300 23900 CLS 24000 REM: 24100 REM: ************#********%*******§*§*§****§#************* 24200 REM: * HON DO I VIEW DATA? * 24300 REM: ********************o#***********§*************4*§**s 24400 REM: ' 24500 LOCATE 1,25 24600 PRINT ”HON DO I VIEW DATA?" 24700 LOCATE 2,; S 24300 PRINT "****§****i**§******" 24900 PRINT : PRINT 25000 PRINT " Viewing the data at the terminal is done to check the values o F the“ 25100 PRINT 25200 PRINT "indicated File. By simply indicating which File you wish to view, t he computer" 25300 PRINT 25400 PRINT "will set up the File For you with your header, pair headings, time values" 25500 PRINT 25600 PRINT ", and X-Y coordinates." 25700 LOCATE 22,24 25300 25900 26000 26100 26200 26300 26400 26500 26600 26700 26300 26900 27000 g the 27100 INPUT ”PRESS ANY KEY TO RETURN TO MENU",OE$ : GOTO 9300 CLS REM: REM: ****§*&*******§*********§*****§****#**#*****§*oooee** REM: * HON DO I PRINT DATA? * REM: ****§¢**§******§**************sooe**%*§*e§***§******e REM: LOCATE 1,25 PRINT "HOW DO I PRINT DATA?" LOCATE 2,25 PRINT “**********o*oeooooae" PRINT : PRINT PRINT ' Printing out your data File is a very simple process. By givin PRINT 27200 PRINT "computer which File you wish to print, it will automatically print out the File" 27300 PRINT 27400 PRINT ”with the appropriate File description, pair headings, & X-Y coordin es. 27500 LOCATE 22,24 27600 27700 27300 27900 23000 23100 23200 23-300 23400 23500 INPUT ”F'RESB ANY KEY TO RETURN TO MENU”, 00$ = GOTO 3300 INPUT "PRESS ANY KEY TO RETURN TO MENU",C [Izs : OOTO 1400 CLS REM: REM: §I*************§****#§%§***#***§§****#****%******§*** REM: * HON DO I GRAPH DATA? * REM: ***&**seeo**aos*4aaeee«seeo#****#**********e**4****** REM: LOCATE 1,25 PRINT "HON DO I GRAPH DATA"'“ LOCATE 2,25 PRINT “§§*§**#§#§§fi**¢**§%é” 29300 PRINT 23900 pRINT You will" 29000 PRINT 29100 PRINT u must then" 29300 PRINT r within” 29400 PRINT 29500 PRINT 29600 29700 29300 29900 30000 30100 30200 30300 30400 30500 30600 30700 30300 ch data 30900 PRINT 31000 PRINT irll 31100 31200 ell 31300 31400 d and" 31500 PRINT 31600 PRINT 0F the data. 31700 LOCATE 3 300 INPUT 31900 CLS 32000 REM: 32100 REM: 32200 REM: 32300 REM: 32400 LOCATE 32500 PRINT INPUT CLS REM: REM: REM: REM: PRINT PRINT PRINT PRINT PRINT PRINT PRINT PRINT LOCATE 62 PRINT Graphing ” data is done by answering the appropriate questions. “he graphing the X-Y coordinates For a certain File against time. Yo "tell the computer which File is to be graphed & also which data pai "that File, as it can only graph one pair at a time." LOCATE 22,24 "PRESS ANY KEY TO RETURN TO MENU",CO$ : OTO 9300 G «a*ea****4§*§*¢*§***§*§***§*******e*******a*******a*# * FINITE DIFFERENCE TECHNIQUE * ***§*a*aa4*»***§*******§********a**§§**************§* 1,24 "FINITE DIFFERENCE TECHNIQUE" LOCATE 2,24 "l§******%*****##***§***§§**” PRINT The Finite diFFerence technique is based upon the idea that ea "point when considered against the points on either side oF it & the "corresponding time values can be ’smoothed’ to better Fit within th "proportion on either side oF itselF. Each value is therFore weighte "multiplied by a constant to give a better Fit to the overall shape 22,24 "PRESS ANY KEY TO RETURN TO MENU”,CC§ : OOTO 3300 *§***§*§-§**§ii-‘l'*flnfl-‘lf-IHI'*‘INI'4-#41")?*********§****#*#******** * LEAST SQUARES APPROXIMATION * §***§**#4*******§*****#****#***#********************i 1,24 "LEAST SQUARES APPROXIMATION” 63 32600 LOCATE 2,24 PRINT "*********§***§*********§***“ PRINT : PRINT PRINT Least squares approximation is based upon the idea that every has" ‘ ‘ PRINT PRINT "a certain deviation From its true value (an error va1ue), the Ieast squares“ 33200 PRINT . 33300 PRINT "technique takes into account the deviations oF all data points a at tempts to" 33400 PRINT V 33500 PRINT "minimize the error. This method is highly recommended For Biomechan 33600 PRINT 33700 PRINT "data as it is Very powerFuT at giving a smooth curve representation of a set“ 33300 PRINT 33900 PRINT "oF data points.“ 34000 LOCATE 22 24 34100 INPUT ”PRESS ANY KEY TO RETURN TO MENU",CC$ : GOTO 9300 34200 CLS 34300 REM: §***********%*********#******§****§*******é*#*§**** 34400 REM: * FAST-FOURIER TRANSFORM * 34500 REM: ***§u****§**4§******#****§******4********§*#******* 34600 REM: 34700 LOCATE 1,29 34800 PRINT "FAST-FOURIER TRANSFORM" 34900 LOCATE 2,29 35000 PRINT "**§*§#****#***w***é§**" 35100 PRINT : PRINT 35200 PRINT “ The Fast-Fourier transForm is a trigonemetric may to smooth da ta based" 35300 PRINT 35400 PRINT "on the concept of harmonic ana1ysis. The sine and cosine waves when graphed" 35500 PRINT 35600 PRINT ”are a smooth, harmonic curve. Based on this concept, the raw data r on through" 35700 PRINT 35300 PRINT "this transForm give a smooth representation of the raw data." 35900 LOCATE 22,24 36000 INPUT ”PRESS ANY KEY TO RETURN TO MENU",CC$ : GUTU 9300 36100 0L3 39200 REM: oeeo»**o**#*****§§*o***§*******4*§4§****§******% 36300 36400 36500 36600 36700 36300 64 CUBIC SPLINE FUNCTIONS * REM: * REM: *eeeeeeeeeeeee*********e*ee*********%*******ee*e REM: LOCATE 1,2? PRINT "CUBIC SPLINE FUNCTIONS" LOCATE 2,29 . 36900 PRINT "**********************" 37000 PRINT : PRINT _ 37100 PRINT " Cubic spline Functions attempt to represent the een data" 37200 PRINT 37300 PRINT gh these" 37400 PRINT 37500 PRINT t 0F data" 37600 PRINT 37700 PRINT echnique“ 37800 PRINT 37900 PRINT some other" 33000 PRINT 33100 PRINT 38200 33300 38400 33500 33600 33700 33800 38900 INPUT CLS REM: REM: REM: REM: REM: intervals betw “points with a Function or equation representing a smooth line throu "points. By taking the equations and using them through an "points we can then represent the curve through those “does introduce more error in the terms as it “techniques." LOCATE 22,24 "PRESS ANY KEY TO RETURN TO MENU",CC$ : COTO 9300 *********************%*§******§********************** * BUTTERNORTH FILTERING * ********#***e*****************§*******%**********§**e points. entire se This t is not as powerFul as 39000 39100 39200 39300 39400 39500 LOCATE 1,29 PRINT "BUTTERNORTH FILTERING" LOCATE 2,29 PRINT PRINT PRINT " ********************* ” : PRINT " Butterworth Filtering is an extension or special case 1 processing" 39600 39700 PRINT PRINT ct ’noise’ 33800 39900 PRINT PRINT en when " 40000 PRINT 40100 PRINT "Extensively used in engineering, Filtering oF data is “From the signal. This noise crmes From the natural "using electronic signals to record data. These Filters done to interFerence oF signa extra giv sort through 65 the data" 40200 PRINT 40300 PRINT "and pull out the true signal by giving a smooth picture oF what the data may" 40400 PRINT 40500 PRINT "look like. The butterworth Filter uses this concept to smooth the r aw data" 40600 PRINT' 40700 PRINT "into what seems to be a smooth representation oF the data." 40300 LOCATE 22,24 40900 INPUT "PRESS ANY KEY TO RETURN TO MENU",CC$ = OOTO 9300 41000 CLS : REM : EXIT PROGRAM 41100 LOCATE 4,15 41200 PRINT “********************4********************************" 41300 LOCATE 5,15 41400 PRINT TAB(15) "*" TAB(67) “*" 41500 LOCATE 6,15 41600 PRINT "*" : COLOR 0,7 : LOCATE 6,30 = PRINT ”DATA SMOOTHING PROGRAM" : COLOR 7,0 : LOCATE 6,67 : PRINT "*" 41700 LOCATE 7,15 41300 PRINT TAB(15) "*" TAB<67> “*" 41900 LOCATE 3,15 42000 PRINT “*" : COLOR 0,7 : LOCATE 3,20 : PRINT "SCHOOL OF HEALTH EDUCATION, C OUNSELINO” : COLOR 7,0 : LOCATE 3,67 : PRINT "4" 42100 LOCATE 9,15 42200 PRINT TAB(15) "e" TAB(67) 4*" 42300 LOCATE 10,15 42400 PRINT "*" : COLOR 0,7 : LOCATE 10,26 : PRINT "PSYCHOLOGY o HUMAN PERFORMAN CE" : COLOR 7,0 : LOCATE 10,67 : PRINT "*" 42500 LOCATE 11,15 42600 PRINT TAB(15) "*" TAB(67) "*" 42700 LOCATE 12,15 42300 PRINT "*" : COLOR 0,7 : LOCATE 12,29 = PRINT "MICHIGAN STATE UNIVERSITY" = ':0LOR 7,0 : LOCATE 12,67 : PRINT "*0. 42900 LOCATE 13,15 43000 PRINT TAB<15> "*" TAB<67> "*" 43100 LOCATE 14,15 43200 PRINT "*****************************4****e*******##**#**e***" 43300 LOCATE 16,20 43400 PRINT ”DID YOU REMEMBER TO SAVE YOUR DATA!!!" 3500 LOCATE 13,13 43600 PRINT "RETURN TO MAIN MENU.... ............ ....... 1” 43700 LOCATE 19,13 43300 PRINT "EXIT PROGRAM... ..... ... ...... . ........... . 2" 43900 LOCATE 22,27 44000 INPUT "YOUR SELECTION PLEASE: ",3$ 66 44100 IF S5 = "2" THEN GOTO 44300 44200 SOTO-1400 44300 KEY ON 44400 END 1000 1100 1200 1300 1400 1500 1600 1700 1300 1900 2000 2100 2200 2300 2400 2500 2600 2700 2300 2900 3000 3100 3200 3300 3400 3500 3600 3700 3300 3900 4000 4100 4200 4300 4400 4500 4600 4700 4300 4900 5000 5100 5200 5300 5400 5500 5600 67 CL3 REM: REM: SUBROUTINE TO INPUT DATA (1) INPUT DATA FROM TERMINAL REM: (2) INPUT DATA FROM A DISKETTE REM: REM: THE DATA POINTS ARE INPUTTED IN THE FORMAT: REM: REM: ._ X-COORDINATE Y-COORDINATE REM: LOCATE 5,30 PRINT "INPUTTING DATA" LOCATE 6,23 PRINT "FOR DATA SMOOTHING" LOCATE 7,23 PRINT "******************" LOCATE 9,20 PRINT "PLEASE SELECT ONE OF THE FOLLOWING:" LOCATE 11,15 PRINT "INPUT DATA FROM TERMINAL.... ....... ...... 1" LOCATE 12,15 PRINT "INPUT DATA FROM A DISK.. ..................... 2" LOCATE 13,15 PRINT "RETURN TO MAIN MENU... ......... . ......... .3" LOCATE 15,25 INPUT "YOUR SELECTION PLEASE:";N$ IF N$ = ”1" THEN OOSUB 4200 IF N5 = ”2“ THEN OOSUB 17200 IF NS =- "3" THEN CHAIN "A:S.MAIN",1000,ALL CLS : REM: INPUT ERROR ER! ' "A:3.INPUT" : LN = 4100 CHAIN “ :3.ERROR“,1000,ALL GOTO 1000 CLS REM: ***§**************************4********** REM: * INPUTTING DATA FROM THE TERMINAL * REM: *********4*4***************************** LOCATE 5,25 PRINT "INPUTTING DATA FROM TERMINAL" LOCATE 6,25 PRINT "*******************+********" IF DP > 1 THEN OOTO 15600 LOCATE 3,19 PRINT “ENTER PAIRS OF DATA POINTS WHEN PROMPTED" LOCATE 10,13 PRINT "AFTER TEN PAIRS HAVE BEEN ENTERED, THEY CAN BE REVIEWED" LOCATE 12,15 PRINT “YOU MAY ENTER A TWO LINE HEADER FOR DATA DESCRIPTION" 5700 5800 5900 6000 6100 6200 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9800 9900 68 LOCATE 17,25 INPUT "READY TO BEGIN..........(Y/N) ";st IF YN$ = "N" THEN OOTO 4200 CLS = REM: INPUTTINC DATA DESCRIPTION LOCATE 5,1 INPUT "ENTER FIRST LINE OF DESCRIPTION PLEASE: ”;D1$ LOCATE 7,1 .‘ INPUT "ENTER SECOND LINE OF DESCRIPTION PLEASE: "gDES HC = 100 : REM: HEADER CHECK FOR VIEWING DATA. CLS LOCATE 5,25 PRINT "THIS IS HON YOUR HEADER LOOKS=" LOCATE 6,25 PRINT "******************************" LOCATE 10,1 PRINT D13 LOCATE 11,1 PRINT 02$ LOCATE 15,23 INPUT "IS THIS CORRECT. ......... (Y/N) "gYN$ IF YNS = “N" THEN OOTO 6000 CLS : REM: INPUT PAIRS OF DATA POINTS. LOCATE 5,14 INPUT "HON MANY PAIRS OF DATA POINTS WILL YOU HE INPUTTING ",NP LOCATE 8,19 PRINT "ENTER DATA HEADERS FOR PAIRS NHEN PROMPTED" LOCATE 10,24 PRINT "EX: PAIR 1=RIOHT ANKLE ’R.ANKLE’" LOCATE 15,1 FOR I = 1 TO NP PRINT "HEADER FOR PAIR # “:1 INPUT " =9",PH$(I) = PH$(I) = LEFT$HN THEN VN=VN+ IF HALTs = "E" THEN HN=1 : COTO 9700 OOTO 9700 CLS : REM: INPUT CONSTANT TIME INTERVAL VALUE. LOCATE 10,22 INPUT "ENTER CONSTANT FOR TIME INTERVAL =:",TC FOR II = 1 TO 100 TV(II) = TC NEXT II OOTO 9700 CLS : REM: DATA CHECK FOR PAIRS. IF VN>HN THEN VN=VN+10 ELSE VN=VN+,CP1(1),CP2(1),FSl(1),FS2(1),L31(1),L32(1) 24700 DP = 1 24300 OOTO 17200 1 000 1 100 1200 1300 1400 1500 1600 1700 1300 1900 2000 2100 2200 2300 2400 2500 2600 2700 2300 2900 3000 3100 3200 3300 3400 3500 3600 3700 3300 3900 4000 4100 4200 4300 4400 4500 4600 4700 4rur 4900 5000 5100 5200 5300 5400 5500 5600 5700 5300 5900 6000 6100 é200 6300 73 CLS REM: REM: 4***********+***********§**§******************§*****# REM: * SAVING DATA TO A DISK SURROUTINE REM: ******§**************§***********+****§************** REM: LOCATE 5,30 PRINT "SAVING DATA TO" LOCATE 6,32 PRINT "A DISKETTE” LOCATE 9,20 PRINT"PLEASE SELECT ONE OF THE FOLLOWING:" LOCATE 11,12 PRINT ”SAVE DATA TO A DISKETTE........................... 1“ LOCATE 12,12 PRINT ”SAVE DATA IN FORMAT FOR DATA ANALYSIS PROGRAM..... 2 LOCATE 13,12 PRINT “RETURN TO MAIN MENU............................... 3" LOCATE 14,25 INPUT“YOUR SELECTION PLEASE:";NS IF N$ = "1" THEN GOBUB 3900 IF N$ = "2" THEN BOTO 1000 IF N$ = "3" THEN CHAIN "A:S.MAIN",1000,ALL CLS : REM: INPUT ERROR ERS = "A:S.SAVE" : LN = 3800 CHAIN "A:3.ERROR”,1000,ALL GOTO 1000 CLS : REM: SAVING DATA TO A DISKETTE SUBROUTINE. LOCATE ,25 PRINT ”SAVING DATA TO A DISKETTE" LOCATE 2,25 PRINT "*********§*******4§§§§§**" LOCATE 4,30 PRINT "SAVE TO DISK:" LOCATE 6,15 PRINT "BUTTERWORTH FILTERING BMOOTHED DATA..........(BF)" LOCATE 7,15 PRINT ”CUBIC SPLINE SMOOTHED DATA........... ..... ...(CE)” LOCAT 3,15 PRINT "CHEBYSHEV POLYNOMIAL SMOOTHED DATA...........(CP)" LOCATE 9,15 PRINT "FOURIER SERIES SMOOTHED DATA.............. LOCATE 10,15 PRINT ”LEAST SQUARES SMOOTHED DATA..................(L3)“ LOCATE 11,15 PRINT "RAW DATA.... ..... .............. ..... ...... LOCATE 12,15 PRINT ”RETURN TO MENU.............z.................(MM)” LOCATE 14,15 PRINT "MAKE YOUR SELECTION BY ENTERING THE TwO DIOIT CODE" LOCATE 15,12 PRINT “IF YOU wOULD LIKE THE RESULTANT VELOCITY OR ACCELERATION” .(FS)" .(RO)” 74 6400 LOCATE 16,13 6500 PRINT "FROM THE DATA PLACE AN (A) OR (V) IN FRONT OF THE CODE” 6600 LOCATE 13,12 6700 PRINT "EX: TO 3AVE RESULTANT ACCELERATION FROM THE SMOOTHED DATA” 6300 LOCATE 19,27 6900 PRINT "BY CUBIC 3PLINE FUNCTION:“ 7000 LOCATE 20,34 7100 PRINT "ENTER: "3 : COLOR 0,7 : PRINT "AC3" : COLOR 7, 7200 LOCATE 22,23 7300 INPUT "YOUR SELECTION PLEASE:",30$ 7400 REM: 7500 REM: THE DATA HILL BE SAVED WITH THE TIME-VALUE BEINO 7600 REM: FOLLOWED BY X & Y COORDINATES. 7700 REM: 7800 DIM T1(DP),T2(DP) 7900 IF 30$ = "BF” THEN FOR I = 1 TO DP : T1(I) = BF1(I) NEXT I : OOTO 9000 3000 IF 30$ = “C3" THEN FOR I = 1 TO DP : T1(I) = C31(I) NEXT I : GOTO 9000 3100 IF 30$ = "CP" THEN FOR I = 1 TO DP : T1(I) = CP1(I) NEXT I : GOTO 9000 3200 IF 303 = "F3" THEN FOR I = 1 TO DP : T1(I) = F31(I) NEXT I : GOTO 9000 3300 IF 30$ = "R0" THEN FOR I = 1 TO DP : T1(I) = X1(I) : NEXT I 3 GOTO 9000 8400 IF 305 = “L3" THEN FOR I = 1 TO OR : T1(I) = L31(I) NEXT I : GOTO 9000 3500 IF 30$ = "ABF" OR 305 = ”AC3" OR 30$ = "AFD" OR 30$ 0R 30$ = ”ARD" THEN FOR I = 1 TO DP : T1(I) = AC1(I) NEXT I : OOTO 9000 3600 IF 305 = “VBF” OR 30$ = "VCS" OR 30$ = "VFD" OR 30$ OR 309 = "VRD" THEN FOR I = 1 TO OR : T1(I) = VC1(I) NEXT I 3 OOTO 9000 8700 IF sns — "MM" THEN ERASE T1 : ERASE T2 : GOTO 1000 3300 REM: INPUT ERROR : 00309 700 3900 OOTO 1000 9000 REM: 9100 REM: ENTER FILE NAME & DISK DRIVE. 9200 REM: 9300 CLS 9400 LOCATE 5,20 9500 PRINT "ENTER YOUR FILE NAME & DISK DRIVE ID” 9600 LOCATE 7,21 9700 PRINT "ACCORDING TO THE FOLLONINO FORMAT” 9300 LOCATE 10,15 9900 PRINT "EX: FOR DISK DRIVE ’A’ AND FILENAME ’3AVE’=" 10000 LOCATE 12,25 0 STORED FIRST T2(I) = BF2(I) : T2(I) = C32(I) ' T2(I) = CP2(I) : T2(I) = F32(I) : T2(I) = Y1(I) : T2(I) = L32(I) : "APE" OR 30$ = ”ALS" : T2(I) = AC2(I) "VFS" OR 305 = "VLS" : T2(I) = VC2(I) 10100 10200 10300 10400 10500 10600 10700 10800 10900 11000 11100 11200 11300 1.1400 (1500 11600 11700 11300 11900 12000 12100 12200 75 PRINT "ENTER: "; : COLOR 0,7 : PRINT "A=3AVE" : COLOR 7,0 LOCATE 20,25 INPUT "FILE NAME PLEASE: “,Fs LOCATE 22,15 INPUT uDOES THIS FILE ALREADY EXIST. .............. (Y/N)",YN$ IF YN$ = "v" THEN OPEN F$ FOR APPEND AS #2 ELSE OPEN Fs FOR OUTPUT AS #1 IF YNs = “N" THEN wRITE #1,NP : REM: NP = NO. OF HEADERS. IF YNs = "N" THEN HRITE #1,Dl$ IF YNs = "N" THEN NRITE 31,025 FOR 00 = 1 TO NP IF VNs = "N“ THEN wRITE #1,PH$(JJ) NEXT 00 FOR II = 1 TO DP IF YN$ = "v" THEN uRITE #2,TV(II),T1(II),T2(II) IF YNs = "N" THEN wRITE #1,TV(II),T1(II),T2(II) NEXT II IF YN$ = "v" THEN CLOSE #2 ELSE CLOSE #1 ERASE T1 : ERASE T2 CLS : REM: DATA SAVED. LOCATE 10,15 INPUT ”DATA SAVED, PRE33 ANY KEY TO RETURN TO MAIN MENU",CC$ CHAIN "A:3.MAIN",1000,ALL 76 1000 CL3 1200 REM: 1400 REM: 54*********************************************%***** 1600 REM: 9 VIEwINO DATA AT THE TERMINAL * 1300 REM: **********************************§****************** 2000 REM: 2200 DIM T1(DP),T2(DP) : REM: TEMPORARY ARRAYS. 2400 LOCATE 1,25 2600 PRINT "VIEWING DATA AT THE TERMINAL" 2500 LOCATE 2,25 3000 PRINT "*********§******************" 3200 LOCATE 4,35 3400 PRINT "VIEW" 3600 LOCATE 6,15 3300 PRINT "BUTTERNORTH FILTERING SMOOTHED DATA..........(BF)" 4000 LOCATE 7,15 4200 PRINT "CUBIC SPLINE SMOOTHED DATA...................(C3)" 4400 LOCATE 5,15 4600 PRINT "CHEBYSHEV POLYNOMIAL SMOOTHED DATA...........(CP)" 4800 LOCATE 9,15 5000 PRINT "FOURIER SERIES SMOOTHED DATA.................(FS)" 5200 LOCATE 10,15 5400 PRINT "LEAST SQUARES SMOOTHED DATA............ ..... .(LS)" 5600 LOCATE 11,15 5800 PRINT "RAN DATA.....................................(RD)" 6000 LOCATE 12,15 6200 PRINT "RETURN TO MENU...............................(MM)" 6400 LOCATE 14,15 6600 PRINT “MAKE YOUR SELECTION BY ENTERING THE TWO DICIT CODE" 6800 LOCATE 15,10 7000 PRINT "IF YOU NOULD LIKE TO VIEN THE RESULTANT VELOCITY OR ACCELERATION" 200 LOCATE 16,10 7400 PRINT "FROM THE DATA PLACE AN (A) 0R (V) IN FRONT OF THE CODE" 7600 LOCATE 15,10 7800 PRINT "EX: TO VIEW RESULTANT ACCELERATION FROM THE DATA SMOOTHED" 5000 LOCATE 19,15 3200 PRINT "BY LEAST SQUARES APPROXIMATION" S400 LOCATE 20,30 5600 PRINT "ENTER: ": : COLOR 0,7 : PRINT "ALS" : COLOR 7,0 3300 LOCATE 22,25 9000 INPUT "YOUR SELECTION PLEASE:”,SD$ 9200 IF 30$ = “BF" THEN FOR I = 1 TO DP = T1(I) = BF1(I) : T2(I) = BF2(I) : NEXT I : OOTO 11400 9400 IF 30$ = "CS“ THEN FOR I = 1 T0 DP : T1(I) = 031(1) : T2(I) = 532(1) : NEXT I : GOTO 11400 9600 IF 305 = “OP" THEN FOR I = 1 TO DP : T1(I) = CP1 : T2(I) = CP2(I) : NEXT I : OOTO 11400 7300 IF 30$ ”F3" THEN FOR I = 1 TO 0P : T1(I) = F31(I) 3 T2(I) F32(I) : 1 0000 10200 10400 10600 10800 11000 11200 11400 11600 11300 11301 12000 12200 12400 12600 12300 13000 13200 13400 13600 13300 14000 14200 14400 14600 14300 15000 15200 15400 15600 15300 16000 16200 16400 16600 16300 17000 17200 77 NEXT I : OOTO 11400 IF 80$ = "LS" THEN FOR I = 1 TO OR : T1(I) = L31(I) : T2(I) = L32(I) : NEXT I : OOTO 11400 IF 30$ = "R0" THEN FOR I = 1 TO DP : T1(I) = X1(I) : T2(I) = Y1(I) : NEXT I : OOTO 11400 IF 505 = "ABF" OR 305 = "ACS" OR 30$ = "AFD" OR 50$ = "AFB" OR 30$ = "ALB" OR 305 = "ARD" THEN FOR I = 1 TO OR : T1(I) = AC1(I) : T2(I) = AC2(I) : NEXT I : OOTO 11400 IF 305 = "VBF" OR 30$ = "VCS" OR 305 = "VFO" OR 30$ = "VF5” OR 505 = “VLS” OR 30$ = "VRD" THEN FOR I = 1 TO DP : T1(I) = VC1(I) : T2(x) = VC2(I) : NEXT I : OOTO 11400 IF 80$ = "MN" THEN ERASE T1 : ERASE T2 : CHAIN "A:3.MAIN",1000,ALL REM: INPUT ERROR : COSUE 700 GOTO 1000 CLS 00300 13400 L1 = 1 : NH=DP/NP : REM: NH = NO. OF ENTRIES UNDER EACH HEADER. PRINT "NH: "gNHg" 0P: ";0P;” NP= "gNP IF NH >= 10 THEN L2 = 10 ELSE L2 = NH LOCATE 1,32 : COLOR 0,7 : PRINT ”FILE DESCRIPTION” : COLOR 7,0 IF HC = 100 THEN LOCATE 3,1 : PRINT 01$ IF HC = 100 THEN LOCATE 4,1 : PRINT 02$ IF HC 4) 100 THEN LOCATE 3,1 : PRINT “PRESENT FILE HAS” IF HC C} 100 THEN LOCATE 4,1 : PRINT "NO FILE DESCRIPTION” LOCATE 6,1 FOR OJ = 0 TO NP—l PRINT TAB((UU+1)*20+3) PH$(JU+1); NEXT JO LOCATE 7,1 : PRINT TAB(2) "TIME VALUE"; FOR dd = 0 TO NP—1 PRINT TAB((OJ+1)*20+1) "X" TAB((JU+1)*20+12) "Y"; NEXT JO LOCATE 9,1 FOR II = L1 TO L2 : PRINT TAB(3) PT(II); TC=0 FOR KK = II TO DP STEP NH PRINT TAB<R20+10) T2(KK); TC = TC + 1 NEXT KK NEXT II : PRINT IF L2 = NH THEN GOTO 17600 LOCATE 22,20 INPUT "PRESS ANY KEY TO VIEN NEXT SCREEN",CC$ L1 = L1 + 10 IF NH }= L2 + 10 THEN L2 = L2 + 10 ELSE L2 = NH 78 17400 CLS 3 GOTD 12200 17600 LOCATE 22,15 17800 INPUT "END OF DATA--PRE33 ANY KEY TO RETURN TO MENU",CC$ 13000 ERASE T1 : ERASE T2 : ERASE PT 13200 BOTO 1000 13400 REM: 13600 REM: SET UP TIME VALUES. 13300 REM: 19000 DIM PT (DP+1) 19200 FOR I = 1 TD UP 19400 PT(1) = 0 19600 IF TIC = 2 THEN PT(I+1) = PT(I) + TV(I) ELSE PT(I) = TV(I) 19300 IF PT(I) <} 0 THEN PT(I) = (INT(PT(I)*1000))/1000 20000 NEXT I 20200 RETURN 1000 1100 1200 1300 1400 1500 1600 1700 1300 1900 2000 2100 2200 2300 2400 2500 2600 2700 2300 2900 3000 3100 3200 3300 3400 3500 3600 3700 3300 3900 4000 4100 4200 4300 4400 4500 4600 4700 4300 4900 5000 5100 5200 5300 5400 5500 5600 5700 79 CLS REM: REM: ****§Rfi%*********%§**************§****************** REM: 5 DATA SMOOTHING TECHNIQUES * REM: 5554***%******************************************** REM: LOCATE 5,25 PRINT "DATA SMOOTHING TECHNIQUES" LOCATE 6,25 PRINT "*******%*********%*******" LOCATE 3,20 PRINT "PLEASE SELECT ONE OF THE FOLLOWING:” LOCATE 10,15 PRINT "CHEBYSHEV POLYNOMIALS......... ..... . ............ 1" LOCATE 11,15 PRINT "LEAST 550ARE5 APPROXIMATION.. ................... 2" LOCATE 12,15 PRINT "FOURIER 5ERIE5 ....... . .................... ...... 5" LOCATE 15,15 PRINT "CUBIC SPLINE FUNCTION ................... . ....... 4" LOCATE 14,15 PRINT "BUTTERuORTH FILTERING... ..... . ......... ......... 5" LOCATE 15,15 PRINT "CALCULATE VELOCITY OF RAN DATA... ............... 6" LOCATE 16,15 PRINT "CALCULATE ACCELERATION OF RAN DATA .............. 7" LOCATE 17,15 PRINT "RETURN TO MAIN MENU.................. ......... .. 5" LOCATE 20,25 INPUT "YOUR SELECTION PLEASE:”;N$ IF N5 = "1" THEN GOSUB 5000 IF N5 ="2" THEN OOSUB 10300 IF NS = "3" THEN OOSUB 23000 IF N5 = "4" THEN OOSUB 23600 IF N5 = "5" THEN OOSUB 33600 IF N0 = "6" THEN VV$ = "RD” : OOSUB 50000 : OOTO 1000 IF N5 = "7" THEN AAs = "RD” : OOSUB 55000 : GOTO 1000 IF NS = "3" THEN CHAIN "A:5.MAIN",1000,ALL REM: INPUT ERROR : OOSUB 700 GOTO 4000 CLS REM: REM: ********5******4*544********#****************555*5545 REM: * CHEBYSHEV POLYNOMIAL * REM: §**%**#*****%*4**%*#4%*****%****%******#*%****%****** REM: LOCATE 5,25 PRINT "CHEBYSHEV POLYNOMIALS” 3005 3010 3015 3020 3021 3022 80 LOCATE 6,25 PRINT "§********§******§#***“ LOCATE 10,20 PRINT "PLEASE SELECT ONE OF THE FOLLOWING:" LOCATE 12,15 PRINT "SMOOTH WITH CHEBYSHEV POLYNOMIALS................. 1" LOCATE 13,15 PRINT "CALCULATE VELOCITY OF SMOOTHEO OATA............... LOCATE 14,15 PRINT ”CALCULATE ACCELERATION OF SMOOTHED DATA... LOCATE 15,15 PRINT "RETURN TO MAIN MENU............................... LOCATE 20,20 INPUT "YOUR SELECTION PLEASE: ",NS M u a . u I u . s 1,1 {- IF NS = "1” THEN OOSUB 7300 IF NS = ”2” THEN VV$ = "FD" : OOSUB 50000 : COTO 5000 IF NS = “3" THEN AA$ = "FD" : GOSUB 55000 : OOTO 5000 IF NS = ”4" THEN CHAIN "A=5.MAIN", 1000,ALL REM: INPUT ERROR : GOSUB 700 BDTU 5000 CLS : ERASE 0P1,CP2,FSI,F32,CSI,C32,BFI,BF2,L81,L52 DIM CP1(DP),CP2(DP) CLS : LOCATE 5,17 : INPUT "PLEASE INPUT THE DEGREE OF THE PDLYNUMIAL =:",PD PI = 3.141592 : N = PD DIM C1(N),C2(N),F1(N),F2(N) CLS : LOCATE 10,25 : COLOR 0,7 PRINT ”CHEBYSHEV POLYNOMIAL ROUTINE NORKINC....." : COLOR 7,0 OOTO 9000 : REM:FLAO=9 : REM:OOTO 13100 STUPID = 1 FLAO = 9 : IF STUPID >= 3 THEN COTO 3350 ELSE OOTO 14600 FLAO = O : A = PT(1) : B = PT(DP) BMA = .5 * (B - A) BPA = .5 * (B + A) FOR K 1 TO N Y = COS(PI * (K — .5))/N IF STUPID = 2 THEN F1(K) = C(l) + C(2) * (Y*BMA+BPA) + C(3) * (Y*BMA+BP C(4) * (Y*BMA+BPA) IF STUPID = 3 THEN F2(K) = C(1) + C(2) # (Y*BMA+BPA) + C(S) * (Y*BMA+BP C(4) * (Y*BMA+BPA) = 5UM1 + F1(K) # COS((PI * (J-1)) * ((K - .5)/N)) 3UM2 = 5UM2 + F2(K) * COS((FI * (J-1)) * ((K - .5)/N)) 81 11600 LOCATE 13,15 11700 PRINT "CALCULATE VELOCITY OF SMOOTHED DATA....... ..... .. 2“ 11300 LOCATE 14,15 11900 PRINT "CALCULATE ACCELERATION OF SMOOTHED DATA.......... 3“ 12000 LOCATE 15. 12100 F'RINT ”RETURN TO MAIN MENU......... ...... ............... 4" 12200 LOCATE 20,20 2300 INPUT ”YOUR SELECTION PLEA'SE: ”,NS 12400 IF N5 "1" THEN OOSUB 13000 12500 IF N$ "2" THEN VVS = COSUB 50000 : OOTO 10300 12600 IF NS "3" THEN AA$ = ”LS" OOSUB 55000 : COTO 10300 12700 IF NS — "4" THEN CHAIN "A:S.MAIN",1000,ALL 12300 REM: INPUT ERROR : OOSUE 700 12900 OOTO 10300 13000 CLS : ERASE CP1,|3P2,FS1,F'32,I-:1 C'32,BF1, BF2,L51,LS2 13100 DIM L31(DP),LS2(DP) : GD'SUB 22000 13200 NH = DP/NP : REM: NH = NO. OF ENTRIES UNDER EACH HEADER. 13300 KK = 5 : REM: NUMBER OF COEFFECIENTS. 13400 STUPID = 1 3500 DIM C(6) : REM: ARRAY OF COEFFECIENTS TO BE FOUND. 13600 DIM A(6,7): REM: TEMPORARY ARRAY. 13700 REM: 3300 REM: THIS ORDER MAY BE SET UP SO THAT IT CAN BE INPUTTED TO SET 13900 REM: THE BEST POSSIBLE FIT. WE CHOOSE A 4TH ORDER HER FOR REASON 14000 REM: OF LESS COMPUTER MEMORY. 14100 REM: 14200 REM: RESULTING POLYNOMIAL WILL BE OF THE FORMAT: 14300 REM: 14400 REM: Y = C(1) + C(2)*X + C(3)*X“2 + C(4)*X“3 + C(5)*X“4. 14500 IF STUPID >= 3 AND FLAO = 0 THEN COTO 21500 14550 IF FLAC = 9 AND STUPID } 1 THEN OOTO 3030 14600 REM: 14610 CLS : LOCATE 10,20 : COLOR 0,7 14620 PRINT "LEAST-SQUARES APPROXIMATION NORKINO.....” : COLOR 7,0 14700 REM: LOAD THE A-ARRAY. 14300 FOR II = 1 TO DP STEP NH 14900 FOR L = 1 TO KK 15000 FOR M = 1 TO KK 15100 51 = 0 : 32 = 0 15200 FOR I = II TO (II+NH-1) 15300 SI = SI + PT(I)“(L‘1) * PT(I)A(M—1) 15400 IF STUPID = 1 THEN ‘ 2+PT(I)“(L-1)*X1(I) ELSE 3 S2+PT(I)A(L-1)*Y1(I) 15500 NEXT I 15600 A(L,M) = 51 15700 A(L,KK+1) S2 _-..‘__.. 15300 15900 16000 16100 16200 16300 16400 16500 16600 16700 16300 16900 17000 17100 17200 17300 17400 17500 17600 17700 17800 17900 13000 13100 13200 13300 13400 13500 18600 13700 13900 13900 13000 19100 19200 19300 19400 19500 19600 19700 12-00 19900 20000 20100 20200 20300 NRON 82 NEXT M NEXT L REM: SOLVE THE EQUATION SYSTEM BY THE CHOLESKY METHOD REM: USING PARTIAL PIVOTINO. = KK : NCOL = KK + FOR K = 1 TO NRON PIVOT = A(K,K> : IL = K FOR L = K+1 TO NRON , IF ABS(A(L,K)) 4 ABS(PIVOT) THEN OOTO 16900 PIVOT = A(L,K) IL = L NEXT L IF IL = K THEN OOTO 17400 FOR LL = 1 TO NCOL TEMP = A(K,LL) A(K,LL) = A" LOCATE 10,15 PRINT "LEAST OOOAREO SMOOTHEU OATA..................(LO>" LOCATE 11, 15 PRINT "RAN OATA.....................................(RO)" LOOATE 12,15 PRINT ”RETURN TO MENU...............................(MM)” mmME14J5 PRINT ”MAKE YOUR SELECTION BY ENTERINO THE THO OIOIT CODE" LOOATE 15,12 PRINT "IF YOU NOULO LIHE THE RESULTANT VELOCITY OR AOOELERATION" OxAm m,w ' PRINT "FROM THE DATA PLACE AN (A) OR (V) IN FRONT OF THE CODE” LOOATE 13,12 91 1400 PRINT "EX: TO PRINT RESULTANT ACCELERATION FROM THE SMOOTHED DATA" 1600 LOCATE 1?,27 1300 PRINT “BY CUBIC SPLINE FUNCTION" 2000 LOCATE 20,34 2200 PRINT "ENTER: “; : COLOR 0,7 : PRINT "AC3" : COLOR 7,0 2400 LOCATE 22,23 2600 INPUT "YOUR SELECTION PLEASE:”,3D$ 2300 REM: 3000 REM: THE DATA WILL BE PRINTED WITH THE X—COORDINATE BEINO SAVED & THE 3200 REM: Y-COORDINATE WILL BE REPLACED WITH THE SMOOTHED VALUE. 3400 REM: I 3600 DIM T1(DP),T2(DP) : REM: TEMPORARY ARRAYS. » 3300 IF SOS = "BF" THEN FOR I = 1 TO DP : T1(I) = BF1(I) : T2(I) = EF2(I) : NEXT I : OOTO 16000 -4000 IF SDS = ”CS" THEN FOR I = 1 TO DP : T1(I) = C31(I) : T2(I) = C32(I) : NEXT I : GOTO 16000 14200 IF EDS = "CP" THEN FOR I = 1 TO DP : T1(I) = CP1(I) : T2(I) = CP2(I) : NEXT I : GOTO 16000 14400 IF EDS = "F3” THEN FOR I = 1 TO DP : T1(I) = F81(I) : T2(I) = F32(I) : EXT I : GOTO 16000 14600 IF ODS = "L3" THEN FOR I = 1 TO DF : T1(I) = L31(I) : T2(I) = L32(I) : EXT I : OOTO 16000 14300 IF SD$ = "RD" THEN FOR I = 1 TO DP : T1(I) = X1(I) : T2(I) = Y1(I) : EXT I : GOTO 16000 15000 IF SD$ = "ABF" OR SOS = "AC5” OR 5D$ = "AFD" OR 3D$ = "AFS" OR SOS = "ALB“ OR SDS = "ARD" THEN FOR = 1 TO DP : T1(I) = AC1(I) : 2(1) = AC2(I) : NEXT I : GOTO 16000 15200 IF 30$ = ”VBF" OR 5D$ = "VCS" OR ODS = “VFD” OR SD$ = "VFS" OR 3D$ = ”VL3" OR 506 = ”VRD” THEN FOR I = 1 TO DP : T1(I) = VC1(I) : T2(I) = VC2(I) : NEXT I : OOTO 16000 15400 IF SOS = "MM” THEN ERA3E T1 : ERASE T2 : OOTO 1000 15600 REM: INPUT ERROR : OOSUB 700 15300 OOTO 1000 16000 REM: 16200 REM: SEND ARRAY TO PRINTER. 16400 REM: 16600 CL3 1%300 DIM PT(DP+1) : PT(1) = 0 17000 NH = DP/NP : REM: NH = NO. OF ENTRIES UNDER EACH HEADER. 17200 LOCATE 10,15 17400 COLOR 0,7 : PRINT ”REMEMBER TO ALICN PAPER TO TOP OF A SHEET" : COLOR 7,0 17600 LOCATE 10,53 17300 COLOR 0,7 : PRINT "!!'" : COLOR 7,0 13000 LOCATE 22,20 13200 INPUT ”PRE'J ANY KEY TO BEGIN PRINTING”,CC$ 13400 LOCATE 1,32 : LPRINT "FILE DESCRIPTION" : LPRINT 13600 IF HC = 100 THEN LOCATE 3,1 : LPRINT 01$ 92 IF HC = 100 THEN LOCATE 4,1 : LPRINT 02$ IF HC i} 100 THEN LOCATE 3,1 LPRINT "PRESENT FILE HA3" IF HC 5} 100 THEN LOCATE 4,1 LPRINT "NO FILE DESCRIPTION" LOCATE 6,1 FOR OJ = 0 TO NP - 1 LPRINT TAB<=T1=T2 NEXT I FOR I = (NHiIS-(NH-1)) TO NH*18-1 FOR J = 1+1 TO NH*18 IF T1(I) >= T1(d) THEN COTO 16800 TEMP = T1(d) Tl(d) = T1(I) T1(I) = TEMP NEXT 4 NEXT I FOR I = (NH*18-(NH-1)) T0 NH*IS FOR J = 1+1 TO NHRIS IF T2(I) >= T2(J) THEN OOTO 17600 TEMP = T2(J) T2(J) = T2(I) T2(I) = TEMP NEXT 8 NEXT I REM: SET MIN-MAX VALUES. XMIN = T1(NH*I3) XMAX = T1(NH*I3-(NH-1)) 3 XRANOE = XMAX - XMIN YMIN = T2(NH*I3) YMAX = T2(NH*IS-(NH-1)) = YRANOE = YMAX — YMIN REM: SCALE COORDINATES. IF XMIN }= 0 THEN 18900 FOR I = (NH*I3-(NH-1)) TO NH*I5 01(I) = Ol(I)+ABS(XMIN) NEXT I OOTO 19200 FOR I = (NH*IS-(NH-1)) TO NH*IS 01(1) = Ol(I)-XMIN NEXT I 19200 19300 19400 19500 19600 19700 19800 19900 20000' 20100 20200 20300 20400 20500 20600 20700 20800 20900 21000 21100 21200 21300 21400 21500 21600 21700 21300 21900 22000 22100 22200 22300 22400 22500 22600 22700 22800 22900 23000 23100 23200 23300 23400 23500 23600 23700 23800 23900 IF YM OOTO IN >= FOR I 62(1) NEXT 20000 FOR I VJ2(I) XOON YCON 1F CH REM: XMIN2 XMAX2 YMIN2 YMAXZ REM: NEXT = 150 = 150 FOR 1 01(1) 01(1) 02(1) 02(1) NEXT ECK = FOR 1 NEXT FOR I NEXT SET M = T1 T1 T2 T2 SCALE 97 0 THEN OOTO 19700 (NH*IS-(NH-1)) TO NH*18 02(I)+A88(YMIN) I (NH*IS-(NH-1)) TO NH*IS :2(I)-YMIN I (XMAX-XMIN) (YMAX-YMIN) (NH*IS-(NH-1)) TO NH*IS 61(I)*XCON 150 - 61(1) GZ(I)*YCON 150 - 02(1) II II II II ll\\ I 1 THEN GOTO 25500 = (NH*SI-(NH-1)) TO NH*8I-1 FOR J = I+1 TO NH*SI IF T1(I) >= T1(J) THEN GOTO 21500 TEMP=T1(J) T1(J)=T1(I) T1(I)=TEMP NEXT 4 I = (NH*SI-(NH-1)) TO NH*81 FOR J = I+1 T0 NH*SI IF T2(I) >= T2(J) THEN GOTO 22800 TEMP=T2(J) T2(d)=T2(I) T2(I)=TEMP NEXT 8 I IN-MAX VALUES (NH*SI) (NH*81-(NH—1)) (NH*SI) (NH*8I-(NH-1)) CODRDINATES. 1F XNINZ }= 0 THEN OOTO 23600 GOTO FOR I 03(1) NEXT 23900 FOR I 03(1) NEXT (NH*31-(NH-1)) TO NH*SI 83(1) + ABS(XMIN2) I (NH*SI-(NH-1)) TO NH*SI 03(1) - XMIN2 1 IF YMIN2 }= 0 THEN GOTO 24400 24000 24100 24200 24300 24400 24500 24000 24700 24000 24900 25200 25300 25400 25500 25600 25700 25800 25900 26000 26100 26200 26300 26400 26500 26600 26700 26300 26900 27000 27100 27200 27300 27400 27500 27600 27700 27300 27900 23000 23100 23200 98 PM I=(MfiM-MH%Y)TDNMSI 04(1) = 04(1) + AEE