SEISMIC PERIMETER INTRUSION DETECTION SYSTEM
Field of the Invention The present invention relates to perimeter protection systems.
Background of Invention Intrusion detection systems are well known in the art of perimeter protection. A physical barrier such as a fence, a wall or a trench is constructed to prevent intruders from entering the protected perimeter, including a detection system based on sensors that are activated when an attempt to pass through or tamper with the physical fence is detected. Commercially available intrusion detection systems include the following: Intelli-Flex II Cable Fence Sensor from Magal Security Systems Ltd., Israel; STI-103 Buried Seismic Intrusion Detection from Safeguards Technology Inc., USA; Defensor from Geoquip Ltd., UK; and FFT Secure Pipe from Future Fibre Technologies Pty Ltd., Australia. Intrusion detection systems can be divided into different types: systems that are co- located with the physical barrier, and detect the intruder only when he or she touches the physical barrier, and systems that can look into the area that is external to the physical barrier, and detect intruders before they reach the physical barrier. A first type of intrusion detection systems are relatively less expensive and more reliable than the second type, but their alert is often too late for proper response. The intruder may force his way through the barrier before the user of the system can respond. Another disadvantage of this type of system is that as they do not monitor the natural motion of the intruder. It is difficult for these systems to distinguish between an attempt by a human to intrude and other types of disturbance. A second type of intrusion detection systems, such as ground radar systems and video motion detection cameras, can give an earlier warning of an attempt to approach the physical barrier. However, they are very expensive and not practical for the protection of a long perimeter. A third type of reliable sensor with an early warning consists of sensors embedded outside the protected perimeter. Such a solution is often not possible due to topographic conditions, inability to protect the external sensors, and lack of ownership of the territory.
The prior art lacks an intrusion detection system that will be reliable and inexpensive, that will provide early warning when intruders are approaching a physical barrier, that will be capable of reliably identifying human intruders, and that will be installable within the protected perimeter.
Summary of the Invention It is the purpose of the present invention to provide an intrusion detection system that solves many of the problems of the prior art described above. The intrusion detection system of the present invention includes a plurality of extremely sensitive seismic sensors, spread out with a relatively high density along a strip that is deployed along the protected facility, typically within the physical barrier that protects it such as fence, wall or ditch. The sensors are capable of detecting seismic disturbances caused by the movement or impact of objects on the ground, and are sensitive enough to detect, with high probability, signals caused by walking, running, driving and crawling at a distance that is significantly beyond the physical barrier. The sensor line is preferably deployed in a layout where some of the sensors are closer to the protected perimeter than other sensors, so that there is a variance in the distances between the sensors and the perimeter of at least 1/10 of the effective detection range of the sensors. The deployment along a strip can be achieved by either deploying the sensor line in a zigzag pattern, or deploying more than one non-overlapping line along the perimeter. As the amplitude of the seismic wave in the ground decays with the distance, the output signals of the sensors that are closer to the perimeter barrier will typically be stronger than the output of the sensors that are further from the perimeter barrier, if the point of impact is external to the perimeter. If a point of impact that causes a seismic disturbance is inside the perimeter, then the signal output from the sensors that are further from the perimeter barrier will be stronger than the output from the sensors that are closer. By analyzing the outputs of all the sensors that detect a given disturbance, the system can determine if the disturbance is caused by an external object or by an internal object. This distinction enables the system to disregard internal disturbances, often caused by people walking or working inside the protected area, while being sensitive to external disturbances, possibly caused by an approaching intruder. The sensors are located relatively close to one other, so that the distance between neighboring
sensors is typically less than 1/5 of the effective detection range. This causes any seismic impact within a close distance from the sensor line to be detected by a plurality of sensors - typically five or more. Due to the variance in distances to the sensors, there is a significant variation in the sensed amplitudes, and this variance is instrumental in the calculation of an estimated point of impact. Clearly, the same sensor line can be used to protect the barrier from people approaching it from the inside - like in a prison facility. For such reverse application, the zigzag sensor line will be external to the barrier. It should be noted that arranging sensors at varying distances from the baπier could also be achieved by deploying multiple sensor lines, instead of one zigzagging line.
Brief Description of the Drawings The present invention will be more fully understood and its features and advantages will become apparent to those skilled in the art by reference of the ensuing description, taken in conjunction with the accompanying drawings, in which: Figures 1A and IB show an installation protected by a physical fence, with and without a sensor line; Figure 2 shows the propagation of a pressure wave from a disturbance source; Figure 3 shows a cross section of a sensor line comprising a water tube; Figure 4 shows a block diagram of the sensor sub-system; Figure 5 shows the response of various sensors to various disturbance sources; Figures 6A-6D show four alternatives of placement of a sensor line comprising a water tube; Figure 7 shows a simplified block diagram of the system of the present invention; Figure 8 shows the layout of human footsteps approaching a fence; Figure 9 shows a flowchart of the operation of the sensor unit; Figure 10 shows a flowchart of the operation of the data processor of the system; and Figure 11 is a time chart showing the seismic waves received in eight neighboring sensors.
Detailed Description of the Invention Reference is now made to Figure 1A which illustrates a complex 2 of structures 6, such as a military camp or a rural farm that contains several buildings and facilities, protected by a barrier such as a physical fence 4. Figure IB shows the same complex, with a sensor line 10 deployed on a strip inside the fence constructed according to the present invention. It should be understood that the term "strip" as used throughout this application refers to an imaginary strip of ground along which the line of sensors is either zigzagging between the inner and outer edges of the strip, or is laid in a plurality of passages therebetween. The term "sensor line" as used in this application refers to a physical line, such as a cable, that interconnects the sensors to each other. It should also be understood that while the preferred embodiment of this invention comprises a physical sensor line that brings electric power to the sensors and collects the data from the sensors, the invention also includes a wireless embodiment in which the sensors are powered from a local source of energy such as a battery, and the reports are transmitted wirelessly. The sensors 12 are spread along the sensor line which is laid, in a zigzag pattern, on a strip, typically at uniform distances of a few meters from each other. The layout of the sensor line is zigzagged, so that some sensors are closer to the fence then others. A seismic disturbance causes some of the sensors to detect a signal, and the amplitude of the signal in different sensors determines, through digitization, clustering and signal processing, the location of the source of the signal and an indication as to whether the disturbance originated inside or outside the fence. By eliminating disturbances that originate inside the fence, the system has an area of coverage 14 that partially extends outside of the fence, thus giving an early warning on any attempt to approach the fence from the outside. Disturbances that occur inside the fence and in and around the structures, do not cause an alert, as they are not within the coverage zone of the system. Reference is now made to Figure 2. A top view of a segment of a physical fence 20 is shown, where the protected area is to the left of the fence. A sensor strip 22 is deployed on a strip behind the fence, in a zigzagged pattern. Sensors 24, 26 and 28 along the sensor line are located at different distances from the fence and from the intruder. A footstep 30 of an intruder, outside the perimeter, causes pressure waves 32, 34 and 36 that propagate typically radically from the source 30. As the propagated energy decays with distance, sensors sense the energy at different levels, the closest sensor 28 sensing the strongest amplitude, and more
remote sensors 24 and 26 sensing weaker amplitudes. The amplitudes in the sensors indicate that the disturbance comes from outside the fence, and is therefore a valid signal. Clearly, extensive signal processing needs to be done to distinguish between real intruders and false alarms that happen outside the fence. This processing will be described hereinbelow. Reference is now made to Figure 3, showing a cross section of a sensor line and a sensor. In the embodiment illustrated in this drawing, the sensor line is made of two long water filled tubes 44 and 46 that are held tangentially to each other inside a flexible sleeve 42, and lie on the ground 40 due to their self-weight. Water is known to be a very good conductor of pressure waves and sound, and their continuity serves as an amplifier of the seismic waves to the sensors. The use of a pair of water tubes as described is preferred, as the water pressure in low places can be high, and a single tube tends to round itself and lose good surface contact with the ground. It should be noted that measures need to be taken to avoid water freezing in the tube, in locations where this would otherwise be a problem. The tube can be heated, antifreeze chemicals can be added to the water, and the water can be slowly pumped through the tube and through an external water heater. The wall of the tube is made of material that has an impedance similar to that of the ground, in order to minimize the reflections of energy back to the ground. As the impedance of the ground is not uniform, each of the two tubes can be made of different material, increasing the probability that one of them will be compatible with the ground impedance. A sensor 48, preferably a high capacitance flat piezoelectric transducer (such as 7D- 15-5400 available from Murata Manufacturing Co. Japan) that can handle very low frequency signals, or any other pressure sensitive sensor such as geophones or low frequency microphones, is held in close proximity to the water tubes and to the bottom of the sleeve 42. In this position, the transducer is sensitive both to pressure waves coming from the ground and to pressure waves coming from the flexible water tubes. Electronic circuitry and local processor 50 are located within the sleeve and in close proximity to the sensor 48, and an electric control cable 52 is installed within the sleeve 42, bringing electric power to the processor and delivering the output signals to the central processor. The cable also serves for calibration and for self-destruction of the sensors. Sensors are spread along the sensor line in a relatively high density of 1-2 meters between sensors. This high density is made practical by the relatively low cost of the sensors, and enables a multitude of sensors to respond to a given
disturbance, thus enabling the signal processor to determine if the disturbance is internal or external, and if it is an artifact or a real intrusion. It should be noted that while preferable, the sensor line does not have to comprise a water tube, and the sensors can be spread along a simple two-wire cable, the cable providing electric energy to the sensor and collecting the signals from it. Reference is now made to Figure 4, showing a simplified block diagram of the sensor circuitry of the present invention. The analog output signal from the sensor (not shown) is fed into filter 60, typically a low pass filter. After filtration the signal is amplified in amplifier 62 and then converted into a digital form in analog to digital converter 64. The digital data is fed into an RMS detector 66 that calculates the RMS value of the output signal of the sensor in a given time window following a crossing of a given amplitude threshold. If the RMS value in the time window is above a detection threshold, the RMS amplitude is passed to the message generator 72 for preparation of a message. Line availability tester 74 checks if the line 76 is available for passing the message to the controller (not shown). If the line is available, the message generator combines the sensor serial number 68 with the RMS value into a message and sends the message to the line. If the line is not available, the message generator adds a time stamp to the message from a time stamp generator 70, and waits with the extended message until the line availability tester 74 indicates that the line is available for the message. Reference is now made to Figure 5, showing the interpretation of the pulse widths from a subset of sensors. Physical fence 90 is protected by a sensor line 100 with sensors 92, 94, 96 and 98. Five different cases are illustrated. The relative pulse width of the signals at the five sensors is illustrated as length of bars A, B, C, D, and E (representing the sensors annotated by the same letters). When A>B and C>B the disturbance is to the left of the fence, and as D<A and E<A, the disturbance must be at the top of the area. These values indicate that the disturbance is in the area marked as 102. Accurate calculations based on the amplitudes in the sensors gives a much more accurate estimate of the point of impact, as programmed in the source code in appendix B. When B>A and B>C, the disturbance is to the right of the fence, and if D<B and E«B, it is at the top of the map, close to 106. When E>C and D>B, the disturbance comes from the bottom of the map, and as D>C and D>E, it is to the right of the fence, in the area marked 110.
Likewise one can see that if the disturbance comes from 108, the average response from sensors B and D is stronger than the response from sensors A, C, and D. It is clear that if the density of the sensors is such that a disturbance is picked up by several of them, it is possible to deduce the direction and estimate the location of the disturbance with better accuracy. A preferred algorithm for triangulating the location of the footstep is described in the software program that is attached, in terms of its source code, in appendix A, and in terms of its specifications, in appendix B. It should be readily apparent that other algorithms are available that could perform the required triangulation. The bandwidth of the pressure wave in the ground is too low to enable accurate measurement of time-of-arrival (TO A) and deduce the direction of the disturbance by using TO A methods such as used in the Sniper Location System as offered by SenTech, Inc. 38 Montvale Ave. Suite G80, Stoneham, MA 02180 and described in http://www.sentech- acoustic.com/page5.htm. However, on a longer scale, the time of arrival of the disturbance is valuable in analyzing the disturbances and differentiating intrusions from false alarms. Normal footsteps will be detected as periodic disturbances with 0.5-2 second intervals. Therefore, if the system will have a detection range of 20 meters, there will be over 20 detectable footsteps before the intruder reaches the fence. The typical periodic behavior of a walking person, in which disturbances are caused periodically (step after step) at a narrow range of periods (0.5 second to 2 seconds between steps), enables the data processing system to recognize, at a reasonable confidence level, an approaching intruder. When more than one sequence of footsteps is detected at the same time, the data processing system interleaves them into individual sequences, for analysis. Reference is now made to Figures 6A-6D, illustrating four alternative methods of placement of the sensor line on a ground surface. Figure 6A shows the sensor line laid on the ground, with soil covering it for camouflage and protection. Figure 6B shows the sensor line laid in a gutter, covered with concrete. Figure 6C shows the sensor line buried in the ground, and Figure 6D shows the sensor line laid on the ground and fastened to its place by a set of inverted U pegs. All of these methods are feasible and will enable the sensors to pick up the seismic signals.
Reference is now made to Figure 7, showing a simplified block diagram of the system of the present invention. Seismic sensor 122, such as a piezoelectric transducer, feeds an analog signal to a footstep detector 124 as described in Figure 4 hereinabove. When a footstep is detected a report is sent through communication unit 126 to the line connection 130 common to all the sensors and to the central data processor, the components of which are illustrated on the right side of the line. Other sensors to the left of connection line 130, illustrated without reference numerals, function in the same way as the elements at the top left of the figure. Line 130 carries reports from all the sensors to a cluster detector 137 that combines all the reports of the same footstep into a cluster. The cluster of reports is then sent to a triangulation processor 135 where the location of said footstep is calculated as described in Figure 5 hereinabove. The cluster of reports is also sent to a stepping detector 133 where the timing of the reports is checked for a match with the interval range between human footsteps. The triangulation results and the time analysis results are sent to intrusion detection unit 136 where a decision is made if this is an intrusion that needs an alert, by evaluating the parameters that were predefined as indicating a threat. The output of the intrusion detector is fed to a display 141 , and to a sound generator 134 that synthesizes an audible sound representing each footstep, that is then fed to audio system 132 for hearing. As shown in the figure, data processor 138 is comprised of the following elements: cluster detector 137, stepping detector 133 triangulation computer 135 and intrusion detector 136 The system is calibrated to confirm that the sensors are working and to calibrate the triangulation computer 135 for variations in pressure wave propagation in the ground. Calibration is effected by a set of calibration hammers 128 that are optionally centrally controlled by a calibration controller 131. As the location of the calibration hammers is known, the sensors can be triangulated and are then used to triangulate unknown threats. Once the location of sensors is known, the system can be calibrated to compensate for variations in ground fading factor, using the known location of both the location hammers 128 and the sensors 122. Reference is now made to Figure 8 showing the process of detecting and recognition of human footsteps by the system of the present invention. A person is approaching the perimeter 144 on foot, and the location of his footsteps are marked as 140 (right steps) and
142 (left steps). Sensor line 146 is placed within the perimeter and is populated with sensors 148, 150, 152 and 154 at different distances from the approaching person. As the time difference between individual steps is typically 0.5 seconds, and as the distance between the footsteps and the sensors that pick them is typically 10-20 meters, and as the speed of sound and propagation in the ground is typically 1000 meters per second, it is understood that all the sensors that detect a single foot step will detect it within less than 50 milliseconds, while the signals from the next footstep will come after at least 500 milliseconds. This makes it possible for the signal processor of the system to sort the signals reported by the sensors into clusters of single steps, and triangulate each footstep. One of the characteristics of the human footsteps is that there often is a small but systematic difference in the gait (in timing and in weight) between the left and right legs. This can be a result of a habit, or of carrying an unbalanced load, or a result of a wound or an orthopedic event. By accumulating information about the odd and even footsteps separately, the system has another possible feature that distinguishes human footsteps from other sources of disturbance. When there is a suspicion that a human intruder is approaching the perimeter of a facility, the system can trigger a short, unexpected stimulus that will be intercepted by the intruder and will cause him or her to introduce a brief change in his or her gait. This can be a flash of light from a projector, the firing of a flare, or producing a strong, sudden sound. This stimulus is likely to cause a tense human intruder to pause for a brief moment, a pause that will instantly be detected by step sequence analysis. A stimulus, such as a sudden flash of light, is not likely to cause an immediate response in an animal or in an innocent by-passer. By integration of the above mentioned information, the system can use a plurality of independent parameters in its decision making when providing an alert as to the footsteps of an intruder: 1. The direction of approach 2. The frequency of footsteps 3. The average distance of the footsteps (or the speed of walking) 4. The parity of the footsteps (right to left difference) 5. The response to a startling stimulus
The parameters can be used either by a human operator or a software program to make a relatively reliable decision. Reference is now made to Figure 9, showing the flowchart of the process in the individual sensor. An analog front end in the sensor responds to vibrations that exceed a predetermined threshold. If the sensor detects 200 a disturbance above the predetermined threshold, it determines the time of arrival and the amplitude of the disturbance. Time is measured within the accuracy that is compatible with the very low frequency of the disturbance; typically, an accuracy of 100 milliseconds is sufficient. Amplitude is measured with an accuracy that will distinguish between near and far sensors; typically, a 12 bit amplitude resolution is sufficient. When a detectable disturbance arrives, the duration, amplitude and other parameters that can rule out the possibility that the disturbance is a footstep are applied 202. If the disturbance is a valid signal, it is checked 204 to distinguish between a natural signal and a calibration pulse that is caused by the mechanical calibrators of the system discussed above. One possible way to distinguish between a natural disturbance and an artificial calibration signal, is by using a double impact for calibration, with a short delay between the two impacts that is too short to be confused with a natural footstep. The nature of the disturbance (natural or calibration), its amplitude, and the unique serial number of the sensor are combined 206 into a digital message that is sent over the communication line to the data processor. If the line is available, the message is sent without a time stamp 212, and the time of its arrival to the controller is noted as the time of the disturbance. If the line is not free, then a time stamp is added to the message 208, and it is delayed for a few milliseconds and then another attempt to send the message is made 210. Attempts are made until the sensor finds the line to be free and sends the message 212. The sensor then becomes ready for the next disturbance. Reference is now made to Figure 10, showing the flowchart of processing the sensor messages in the data processor. The messages that reach 260 the data processor are first clustered 262 by their time of arrival. The messages that come from a group of neighboring sensors at the same time are defined as a cluster and are processed to triangulate the footstep that is represented by the messages and estimate the location of the point of impact. The software first defines 264 a bounding rectangle where it will search for the source of signal. The rectangle will be bounded by the following four lines:
Y max: The north-most sensor plus the max detection range of the sensor. Y min: The south-most sensor minus the max detection range of the sensor. X max: The east-most sensor plus the max detection range of the sensor. X min: The west-most sensor minus the max detection range of the sensor. This rectangle is then subdivided 268 into cells of less than a single footstep, typically cells of 0.5 meter. The software then calculates 282, for each of the cells, a set of values giving the estimated ground attenuation from the center of the cell to each of the participating sensors. The ground attenuation is determined by the distance from the cell to the sensor and by any recorded information about the absorption coefficient of the ground between the cell and the sensor. The ground is assumed to be uniform in its signal attenuation. The software than correlates the list of estimated attenuations to the sensors with the list of amplitudes reported by the sensors, and assigns 284 a relative likelihood figure to the cell, representing the likelihood that the given cell was the source of signal. When all the cells in the search rectangle have been calculated 270, the software finds 272 the cell with the maximum likelihood, and records its location and the estimated time of the footstep. The system is then ready for the next cluster of impacts that will lead it to find the location of the next point of impact, which is likely to be the next footstep When the series of footsteps has a pause that is longer than the reasonable step-to-step delay, or where the estimated location of the footstep ceases to be a continuation of the same approach pattern, the software defines the series of footsteps as an event, ends the event 274 and evaluates the results by the parameters listed above in Figure 8. If the direction of approach, the pace rate, the distance between steps and the parity of the steps are clearly within the characteristics of human footsteps 276, the system outputs 278 an alert about an intruder, providing the location, speed of motion and direction of motion. After outputting the alert, the system resets itself 280, and enters a wait mode for receiving 260 another message from a sensor. If the parameters are not indicating 276 a human intruder with sufficient confidence, the system enables the operator to apply his or her judgment by playing an audio signal that represents each footstep with an audio clip of a human footstep, with the timing and relative
amplitude of the cluster. The operator can then apply their human instinct to decide if the disturbance is an intrusion. Additionally, the system can automatically or manually turn on a startling stimulus, as described above in Figure 8 and note if the signal shows a discontinuity that correlates with the stimulus. It should be noted that when the system is performing a calibration and the sensors are reporting that the message represents a calibration signal, the software does a reverse triangulation, by which the location of the signal source is known, and the location of the sensors is calculated by a search rectangle and cells. A single calibration message will typically not be enough to triangulate all the sensors without ambiguity, but as there are several calibration sources, they collectively provide sufficient information for triangulating the sensors. Reference is now made to Figure 11, showing typical amplitude versus time signals 300 received by 8 sensors as described in this invention, said sensors being laid on the ground a few meters from one another. As a person is walking in the vicinity of the sensors, each footstep creates a seismic impulse, such as 302. The horizontal position of each impulse represents the time of its arrival to the sensor. The height of each impulse represents the amplitude of its effect on the sensor. As can clearly be seen in the figure, the amplitudes vary between the different sensors. They also vary in the same sensor, as the person walks closer and further from the sensor. Cluster 304 shows the impulse of the same footstep, as received in the 8 sensors. While the amplitude is different between sensors, the time of arrival to all 8 sensors seems to be identical. This is due to the short time of propagation of the seismic wave to the sensors (typically 30 ms for 30 meters) compared to the large delay between footsteps (typically 500- 1000 ms). It is clearly seen in the chart that the peak amplitude for each sensor happens at a different time because the person walks closer and further from the sensors. It is also visible in this chart that as the person moves far from the sensors, the footstep's signal fades away.
The right side of the chart shows the person turning around and approaching the sensors again, running. It can be seen that the density of the footsteps is higher, as the delay between footsteps is shorter when running, and that the sensors that were last to fade (the sensors at the lower part of the chart) are the first sensors to pick the signal again when the person approaches. It will be appreciated by persons skilled in the art that the present invention is not limited by the drawings and description hereinabove presented. Rather, the invention is defined solely by the claims that follow.
Appendix A
FenceKeeper Simulator - Spec
This appendix describes the algorithm of triangulation used in this invention
Purpose
The purpose of this specifications document is to serve as a statement of understanding between the owners of the system and the software developers. The affected parties should negotiate any desired departures from the specifications described herein.
Introduction
The FenceKeeper is a perimeter defense system, which uses sophisticated known seismic technologies and proprietary algorithms in order to detect the position of a human-being, approaching to a perimeter fence.
The FenceKeeper Simulator is a software tool that simulates a scene where the FenceKeeper system (installed in a specific area) is detecting steps. The whole simulation is occurred within the computer.
Requirements 1. Select and display an area α Use "File->New... " to open a new proj ect. □ Within the opened dialog, use "Select Area" to open a standard "Open" dialog to select an image (GIF, BMP, etc.) of the desired location. □ The physical fence will be already drawn upon the image (use Paint Brush or similar). □ Insert extra information like scale of map and some administrative info like, where the project files will be kept. α When OK button of "New Project" dialog is clicked, the image will be displayed in its place on the application layout. α Use "File->Open->Project" to open "Open Project" dialog, which lets you open an existing projects, which makes available not only the location image but all other stuff related to this image (sensors information, ground information, etc.) α As usual, 4 last opened projects will be listed at the end of the File menu for quick opening. 2. Create and edit the FenceKeeper Sensor Line (FKSL) α Use "Tools->Edit Sensor Line" to get a toolbar of line editing (line width and color, erase last, erase all, erase tool, close polygon).
Erase tool is available only when the polygon is closed, just to make things simpler for implementation. α Use "Tools->Define Sensors" to open a dialog, which lets the user define the sensors parameters. When finished, the sensors will be marked on the sensors line. There should be a possibility to define more than one sensor line - typically two smooth rings, one within the other. For the system it does not matter- it is just another way to define the individual location of the sensors.
There is an option to make the sensors parameters totally "user defined", so if there is a need to add another parameter, there won't be a problem.
The "Define Sensors" dialog will be comprised from a section of global parameters, and a table of all sensors, which will allow parameters editing for a single sensor or for a group (change parameters, insert, delete). α Use "Tools->Define Ground" to open a dialog that enable the user to define ground squares and their parameters. We only need to define the square size. The system can automatically create the grid, and open a dialog to get a decay factor for each cell. There will be no more than 10X10 cells. It would be nice if I could give a value, and then click on all the cells that will receive that value, so I do not need to type 100 numbers.
This process might be involved with displaying a grid on the image for better orientation. α Use "Tools->Define Formulas" to open a dialog the enable the user to build the formulas used for both calibration and reaction, α All data from all dialogs is saved in files/database for further sessions. 3. Calibration α Use "Tools->Calibrate" to get into a calibration mode. Get a toolbar with insertion tool (to insert a calibration point), delete tool (to remove a calibration point), selection tool and intensity tool (to set the intensity of next performed insertions or selected ones). α When a new calibration point is inserted, the calibration formula is activated. α Each calibrated sensor is changing its color. As there can be many events per sensor, please use a scale of colors (playing with the RGB values) so we can see the sensor "level of calibration" and know who has enough and who needs more. α The calibration information is automatically saved. We could open it from File- >Open->Calibration in order to edit it if needed (when such file is opened, we automatically get into calibrate mode) 4. Response Simulation α Use "Tools->Response" to get into a response mode. Get a toolbar with insertion tool (to insert a calibration point), delete tool (to remove a calibration point), selection tool and intensity tool (to set the intensity of next performed insertions or selected ones). α When a new testing point is inserted and the response formula is activated. α Each activated sensor is changing its color. α The result of the formula is displayed on screen (a circle around the estimated location) the radius of the circle represents a level of confidence - the algorithm will produce that as a result of the calculation. α A log file is created for each session α The log file could be viewed from "File->Open->Response Log". The log files gets automatic names according to the date/time they were created. They, of course, could be renamed. α A log file display shows all figures relevant to the session. α There is an option to extract the testing points from a log file (through the mentioned dialog) in order to perform the same test with slightly different parameters (new formula, new sensor sensitivity, etc.) □ There should be an option to compare log files - a comparison tool.
5. Layout The layout should be based on Microsoft's Single Document Interface (SDI), which is an application with a single main window, a menu bar, a toolbar and a status bar.
6. Database XML files will be used. All access to data will be done through a mediator, which will ease the task of switching to another data source.
Appendix B
C language algorithm for triangulation of source of impact based on the amplitudes received in a set of given sensors.
//FKModelAlgos.cpp: implementation of the FKModelAlgos class.
// //////////////////////////////////////////////////////////////////////
#include "FKModelAlgos.h" #include "FKSimulator.h" #include "FKSimulator Doc.h" #include "FKModelCalcParams.h" #include "FKModelUtils.h"
FKModelAlgos* FKModelAlgos::m_Algos = 0;
//Construction/Destruction
FKModelAlgos* FKModelAlgos:: I nstance()
} if ( !m_Algos ( m_Algos = new FKModelAlgos; return m_Algos;
FKModelAlgos::FKModelAlgos()
}
{
FKModelAlgos: :~FKModelAlgos() }
{ double FKModelAlgos::CalculateRecieved ( double soundLevel, double length, double averageFading
(
} double recieved; //must be checked // recieved = soundLevel * ::pow( 2.71828, (length * averageFading; ( ( if ( length == 0( return 10000; recieved = (soundLevel * averageFading) / (length * length;( return recieved; { void FKModelAlgos::FindLocation ( CPoint& calcPointM, CArray<FKModelCalcParams*, FKModelCalcParams*>& calcParams, bool isCalc(
} CFKSimulatorDoc* pDocManager = ((CFKSimulatorApp*)::AfxGetApp())->GetDocument;() m_BestDifSquareSum = -1 ;
CPoint finalBlockRectUL; CPoint finalBlockRectBR; this->FindSearchArea (finalBlockRectUL, finalBlockRectBR, calcParams, isCalc;( double finalBlockWidth = finalBlockRectBR.x - finalBlockRectUL.x; double finalBlockHeight = finalBlockRectBR.y - finalBlockRectUL.y; double searchBlockWidth; double searchBlockHeight; CPoint searchBlockCenter; if ( isCalc( } searchBlockWidth = pDocManager->GetCalcSearchBlockSize;() searchBlockHeight = pDocManager->GetCalcSearchBlockSize;() { else } searchBlockWidth = pDocManager->GetSimSearchBlockSize;() searchBlockHeight = pDocManager->GetSimSearchBlockSize;() { for ( int indexCol = 0; (indexCol * searchBlockHeight) < finalBlockHeight; ++indexCol( } for ( int indexRow = 0; (indexRow * searchBlockWidth) < finalBlockWidth; ++indexRow
( } search BlockCenter.x = finalBlockRectUL.x + ((indexRow * searchBlockWidth)
+ (searchBlockWidth / 2;(( searchBlockCenter.y = finalBlockRectUL.y + ((indexCol * searchBlockHeight) + (searchBlockHeight / 2;(( this->CalculateRecievedAII ( searchBlockCenter, calcPointM, calcParams, isCalc;( { { { void FKModelAlgos: :FindSearchArea (CPoint& finalBlockRectUL, CPoint& finalBlockRectBR,
CArray<FKModelCalcParams*, FKModelCalcParams*>& calcParams, bool isCalc(
} CFKSimulatorDoc* pDocManager = ((CFKSimulatorApp*)::AfxGetApp())->GetDocument;() double scaleM = pDocManager->GetSca!e() / 100; CPoint currBlockRectUL; CPoint currBlockRectBR; CPoint center; CPoint centerM; CPoint onAxis; int radius; int size = calcParams. GetSize;() for ( int index = 0; index < size; ++index( } FKModelCalcParams* params = calcParams. GetAt(index;( if ( isCalc( center = params->calcElem->GetPoint;() else
center = params->sensor->GetPoint;() // radius = (int)(params->soundLevel / params->sensor->Sensitivity() / 2666.666666;( if ( isCalc( radius = 500; else radius = 50; onAxis. x = 0; onAxis.y = center, y; centerM.x = (long)((FKModeIUtils::lnstance()->Distance(center, onAxis) / 10) * scaleM
;( onAxis. x = center.x; onAxis.y = 0; centerM.y = (long)((FKModelUtils::lnstance()->Distance(center, onAxis) / 10) * scaleM
;( currBlockRectUL.x = centerM.x - radius; currBlockRectUL.y = centerM.y - radius; currBlockRectBR.x = centerM.x + radius; currBlockRectBR.y = centerM.y + radius; if ( index == 0( } finalBlockRectUL = currBlockRectUL; finalBlockRectBR = currBlockRectBR; { else } if ( currBlockRectUL.x < finalBlockRectUL.x( finalBlockRectUL.x = currBlockRectUL.x; if ( currBlockRectUL.y < finalBlockRectUL.y( finalBlockRectUL.y = currBlockRectUL.y; if ( currBlockRectBR.x > finalBlockRectBR.x( finalBlockRectBR.x = currBlockRectBR.x; if ( currBlockRectBR.y > finalBlockRectBR.y( finalBlockRectBR.y = currBlockRectBR.y; { { //Make sure that the block rect is not out of screen if ( finalBlockRectUL.x < 0( finalBlockRectUL.x = 0; if ( finalBlockRectUL.y < 0( finalBlockRectUL.y = 0; CPoint mapRectBR; mapRectBR.x = pDocManager->GetMap()->m_sizelnPix.cx; mapRectBR.y = pDocManager->GetMap()->m_sizelnPix.cy; CPoint mapRectBRM; onAxis. x = 0; onAxis.y = pDocManager->GetMap()->m_sizelnPix.cy; mapRectBRM.x = (long)((FKModelUtils::lnstance()->Distance(mapRectBR, onAxis) / 10) * scaleM;(
onAxis.x = pDocManager->GetMap()->m_sizelnPix.cx; onAxis.y = 0; mapRectBRM.y = (long)((FKModelUtils::lnstance()->Distance(mapRectBR, onAxis) / 10) * scaleM;( if ( finalBlockRectBR.x > mapRectBRM.x( finalBlockRectBR.x = mapRectBRM.x; if ( finalBlockRectBR.y > mapRectBRM.y( finalBlockRectBR.y = mapRectBRM.y;
{ void FKModelAlgos::CalculateRecievedAII ( CPoint& searchBlockCenter, CPoint& calcPointM, CArray<FKModelCalcParams*, FKModelCalcParams*>& calcParams, bool isCalc(
} CFKSimulatorDoc* pDocManager = ((CFKSimulator App*)::AfxGetApp())->GetDocument;() double length; CPoint center; CPoint centerM; CPoint onAxis; double recieved; double difSquareSum = 0; double scaleM = pDocManager->GetScale() / 100; int size = calcParams. GetSize;() for ( int index = 0; index < size; ++index( } FKModelCalcParams* params = calcParams.GetAt(index;( if ( isCalc( center = params->calcElem->GetPoint;() else center = params->sensor->GetPoint;() onAxis.x = 0; onAxis.y = center.y; centerM.x = (Iong)((FKModelUtils::lnstance()->Distance(center, onAxis) / 10) * scaleM
;( onAxis.x = center.x; onAxis.y = 0; centerM.y = (long)((FKModelUtils::lnstance()->Distance(center, onAxis) / 10) * scaleM
;( length = FKModelUtils::lnstance()->DistanceM (searchBlockCenter, centerM;( recieved = CalculateRecieved ( params->soundLevel, length, params- >averageFading;( difSquareSum += (params->recieved - recieved) * (params->recieved - recieved;( { if ( m_BestDifSquareSum == -1 || difSquareSum < m_BestDifSquareSum( } m_BestDifSquareSum = difSquareSum; calcPointM = searchBlockCenter; { {