DCREM - DC removal and level scaling program 1.0 INTRODUCTION AND USE This program has been provided to enable fast scaling and DC removal from integer and floating point signal files so that they may be output in anal- ogue form using D/A convertors. Its main advantage is its speed. It can be used in integer mode on PDP 11's with EIS or EAE arithmetic units (11/40's, 11/20, 11/34). Floating point mode only works at present on 11/40's. To run the program type: R DCREM in response to Monitors .. An asterisk is printed after the program title, and a filename and switches in standard RT 11 format should be typed in. The DC re- moval and scaling may be done in place or into a new file. If only an input file is provided the scaled signal overwrites that file, otherwise it is placed in the output file. If no errors occur then the length of the file is printed for information purposes, and the first pass is then done. This pass consists of reading the input file to determine the maximum, minimum and DC levels of the file. These values are then printed on the terminal in the form: File maximum aaa @ block bbb, minimum ccc @ block ddd, DC eee In floating point mode some of these values (aaa, ccc, eee) may be replaced by asterisks if the actual value is outside the range 32767 to -32768 because of the programs inability to print them. The second pass then occurs which rereads the file to scale and remove DC as specified by the switches and write to the output file. If floating point input data is specified then a floating point to integer conversion is done as well. In all the calculations maximum accuracy is maintained and rounding done where necessary (to the nearest integer). 2.0 SWITCHES 1. If no switches are specified the input is assummed to be integer and is scaled to +/-2047 with DC removal. 2. If B switch is specified the output is packed in bytes. For this op- tion a value for /S must be specified less than 256, and since /S is specified, for DC removal /D must also be explicitly included. 3. If H switch is specified, a help listing is typed by the program. 4. If F switch is specified the program treats the input file as floating point numbers, otherwise it is always assummed to integer. 5. If S switch is specified then the input file is scaled to either the switch value or +/-2047 if no value is specified. 6. If D switch is specified the input DC level is altered to either the switch value or 0 if no value is specified. PAGE 2 7. If Z switch is specified then the last n blocks of the file are treated as zero in the scaling and DC determining process, and put to zero in the output file. n is the switch value or 1 if no value specified. 3.0 ERROR MESSAGES 1. No EIS or EAE, program won't run No integer multiply hardware is available so the program cannot run. 2. No FIS cannot do /F option No floating point hardware is available so the program cannot do the floating point option. 3. Input file driver not found The device driver for the input file cannot be found by RT11. 4. Output file driver not found The device driver for the output file cannot be found by RT11. 5. Chan in use A software error has occurred , report to author. 6. File not found The input file cannot be found, check type in and reenter if necessary. 7. No room for output file From the length of the input file the program has found that there is insufficient space for the output file on the device specified. 8. Hardware read error When reading the input file an error occurred, the program is aban- doned. 9. Hardware write error When writing to the input file an error occurred, the program is aban- doned. 10. All zero, nothing done The input file was found to consist only of zeroes. 11. Write end of file A software error has occurred , report to author. 12. Write chan not open A software error has occurred , report to author. 13. No output file name An output file driver was specified without a filename, because of the danger of destroying data this is treated as an error. 14. Illegal switch PAGE 3 A switch character was not recognised, retype file specification and switches line. 15. Out of range /Z switch value Ther is a restriction on the size of the /Z switch value that can be dealt with, this depends on the amount of memory available for DCREM, to over come this problem use program ZERO. D.H.Walesby T63D 29/11/79