eafesim.c SDE EA Front End filter and FADC simulation program for Pierre Auger Observatory Introduction: ------------ eafesim.c is a program intended to simulate the engeneering array SDE analog Front End and ADC stages. It can be used as stand alone program in order to analyze data from a scope or it can be used as a module inside another program with minor changes. It implements one analog stage: * A second order "almost" Bessel filter with gain -10/3, fcut=24MHz). And the ADC stage: * sampling at 25nsec. * random initial phase. * FADC integer output range (0-1023). The interface to the functions are very simple. All the functions take an array of input data and return in another array the processed data for each of the three channels. Note that the anode channels are not implemented but they can be easily implemented since there is no difference in the FE. BE AWARE that there is a gain of -10/3 (like in the real FE) so don't be surprised if the pulses become to big at the output ! ! The input file MUST have an integer number of nano seconds as sample time. If your input file already have 1nsec sampling time you don't need to use the upsample() function. Just read your file and pass the array to the filter() function. DON'T USE SUB NANO SECOND OR NON INTEGER NUMBER OF NANO SECONDS SAMPLE TIME ! To undesrtand the output data, read from the program the values of UP_SIZE and DOWN_SIZE. They show you how many points per pulse you have in both filter.dat and station.dat files according your input sample time and number of points per input pulse. Installation: ------------ Nothing to install ! ! ! Running (stand alone): --------------------- In order to run the stand alone program just compile it with: gcc -o eafesim eafesim.c You have to supply an input file called scope.dat and to modiffy the user parameters defined in the header file. With this package there is an example file scope.dat with 10 pulses in Volts, with 500 points each, at 2nsec sample time. The program generates the output of the filter in filter.dat with 1nsec sample time and UP_SIZE points each pulse. The program also generates the output of the ADC process in station.dat at 25nsec with DOWN_SIZE points per pulse. REMEMBER TO CHANGE THE INPUT PARAMETERS IN HEADER FILE ACCORDING YOUR DATA ! Running (non stand alone): ------------------------- If you are going to use the functions from inside another program, make the program create PULSE_NUM, PULSE_LENGH and SAMPLE_TIME with the correct values and calculate UP_SIZE and DOWN_SIZE. Then you don't need to include the header file. To process the data just call the functions like main() does. Questions and coments: --------------------- Christian Grunfeld - cmg@fisica.unlp.edu.ar