C++ Builder - Sampling
Sampling the Analog Realworld with an Analog-to-Digital (AD) Converter |
||
How does the computer* sense and perceive the world around it? How do we sense and perceive the world around ourselves? Some representations of that world are ANALOG** or continuous, while others are DIGITAL** or discrete. As humans, we perceive colors ranging across a continuous ANALOG spectrum; yet we name individual colors on that spectrum with discretely different words. Natural language is DITIGAL. Our emotional atttachment to another person may similarly range across an ANALOG spectrum, yet we may dichotomize those feelings as the DIGITAL states of "love," "indifference" and "hate." With similar DIGITAL logic we may conclude that a "friend" of a "friend" is a "friend," and a "friend" of an "enemy" is an "enemy." Translations from ANALOG to DIGITAL and from DIGITAL to ANALOG are foundational to human perception, to our emotions, our language and our reasoning. In like manner they are foundational to the senses and perceptions of the world in which computers are imbedded. Much of the realworld is perceived as ANALOG; it comprises relatively continuous, smooth, changes in the intensities of things (variables), with no apparent jumps or gaps. For both humans and computers, problems arise when the samples do not accurately represent the state of the changing world. * In this context we are only considering digital computers like PCs and Macs. Analog computers are much more elegant and efficient for certain realworld applications, but that's another story... |
||
Let's say we have an ANALOG sensor that is converting an ANALOG SIGNAL, say DISTANCE, into an ANALOG voltage, ranging from -10 to +10 volts over time. The graph of VOLTAGE versus TIME is shown above. The SIGNAL is represented by the GREEN curve outlining the ORANGE fill color inside. The rate at which we DIGITALLY SAMPLE the signal is represented by the INTERVAL between SAMPLES, and the intensities of the SAMPLES are represented by the voltages at the sampled points in BLUE. How does the sampling rate effect the perception of the event in the realworld? Too fast a sampling rate may provide unneeded detail and cost valuable computational resources. Too slow a sampling rate may miss important changes but save valuable computational resources. We should should always adjust the sampling rate to provide an adequate representation of the realworld signal we wish to collect. The sample INTERVAL must be significantly smaller than the EVENT we wish to sense and perceive. |
||
We cannot know if a DYNAMIC EVENT is increasing or decreasing in intensity, | To know this, we need a memory of at least one previous sample.
|
|
We cannot count individual DYNAMIC EVENTS. | To know this, we need a memory of at least one previous sample.
|
|
This technique is used in a number of applications we have on our website, for example: FLOCKING: To signal the initiation of an encounter between individuals forming a couple, specifically the lastNN and lastMouseOver. It could be added to the following applications: THEREMIN: With a higher sampling rate to signal a change in the note at which time the last note is turned off and a new sustaining note is turned on. Currently the sampling rate is slow, resulting in a uniform beat, with the same note repeated if the distance has not changed.
|
||
|
||