This invention relates in general to tone detection, and more particularly to a method and apparatus for detecting dial tone carried by a telephone line in a telephone system.
Various tones are used in telephone systems for both control and call status information, and are known generally as call progress tones. These tones are typically transmitted by a central office and transmitted via telephone lines to a calling party utilizing a telephone or PBX in order to inform the calling party about the status of his or her call. For instance, dial tone is a continuous tone made by combining signals having frequencies of 350 hertz and 440 hertz, and is transmitted to the calling party by the central office after recognizing that the telephone of the calling party has been taken off-hook, indicating that the central office or local exchange is ready to receive dialed digits or DTMF tones for completing the call.
Prior art dial tone detectors typically utilized bandpass filtering and threshold detection circuitry for detecting audio signals having frequencies in the range of from approximately 300-600 hertz. In the event the detected signals were of a predetermined amplitude, dial tone was deemed to be present.
However, a number of other supervisory tones (such as ring back and no such number) are comprised of signals in the same approximate range of frequencies. Thus, prior art dial tone detectors were susceptible to inadvertently detecting supervisory tones other than dial tone, as well as speech signals in the same frequency range.
Accordingly, in order to provide more accurate detection, further prior art circuits utilized a pair of bandpass filters for separating the 350 hertz and 440 hertz signals. The filters were required to exhibit steep filter skirts and be of narrow bandwidth such that extraneous noise signals were not translated as tone signals. Furthermore, the filters were required to be accurately tuned to the above described frequencies of 350 hertz and 440 hertz. Due to the tuning, steep filter skirts and narrow bandwidth requirements, the bandpass filters utilized in prior art dial tone detectors were relatively expensive, particularly after including the cost of tuning them individually prior to shipment or being placed in service.
According to the present invention, a dial tone detector is disclosed which does not require highly accurate and costly filters as noted above. A signal is received from a telephone line or conductor and applied to a zero crossing detector, for determining the periods of successive cycles of the signal. The signal is periodically compared in a threshold detector to a threshold signal for determining whether the signals are of substantial amplitude in relation to the threshold signal. In the event that signals of substance are detected, zero crossing detection is continued. The average period of the successive zero crossings is calculated by a microprocessor, and in the event the calculated period corresponds to a frequency approximating the average of the 350 hertz and 440 hertz dial tone signal, the microprocessor generates a signal indicative of the presence of dial tone having been detected.
The dial tone detector according to the present invention is inexpensive and of simple and rugged design. Unnecessary microprocessor processing time is avoided by performing the aforementioned average period calculation only in the event signals of substance have been detected.
In a preferred embodiment of the invention, the microprocessor detects whether successive zero crossings of the received signal exhibit a constant period, indicative of a single tone being present on the line, as opposed to dual tone. In the event of detection of single tone, the microprocessor does not proceed with calculation of the average period as described above, such that further unnecessary microprocessor processing time is avoided.
A better understanding of the invention will be obtained by reference to the detailed description below in conjunction with the following drawings, in which:
FIG. 1 is a schematic diagram of a circuit according to a preferred embodiment of the invention, and
FIG. 2 is a waveform diagram of a single cycle of a typical received dial tone signal.
With reference to FIG. 1, an audio transformer 1 is shown connected to tip and ring terminals T and R for connection to a telephone line comprised of tip and ring leads. A capacitor 3 is connected across a secondary winding of transformer 1 and to a source of voltage which, according to a successful prototype of the invention was +5 volts. A capacitor 5 is connected in series with a resistor 7 between the secondary winding of transformer 1 and a non-inverting input of a comparator 9 for AC coupling audio signals received from the tip and ring leads via the tip and ring terminals T and R and coupled via transformer 1.
A node connecting capacitor 5 and resistor 7 is connected via a resistor 11 to a further source of voltage which, according to the successful prototype was 2.50 volts. A pair of series connected resistors 13 and 15 are connected between the source of 2.50 volts and ground, and the node connecting resistors 13 and 15 is connected via a further resistor 17 to a terminal connected to a variable voltage output 0/5 volts of microprocessor 25, for generating one of either a logic low or high level signal (0 and 5 volts respectively), in response to execution of an internal program described in greater detail below. Thus, microprocessor 25 causes the voltage applied to the inverting input of comparator 9 to vary between one of either 2.49 volts (for performing threshold detection) and 2.50 volts (for performing zero crossing detection) as described below in greater detail.
The node connecting resistors 13, 15 and 17 is further connected to an inverting input of comparator 9, and a capacitor 17 is connected between the inverting and non-inverting inputs of comparator 9 for filtering radio frequency signals in a well known manner.
An output terminal of comparator 9 is connected to a microprocessor controlled gate 21 having an output connected to a data bus 23 of microprocessor 25, and an enable input E connected to a control line of a microprocessor control bus CTRL of microprocessor 25.
In operation, signals carried by the tip and ring leads are received on the tip and ring terminals T and R and coupled via transformer 1 so as to be applied to the non-inverting input of comparator 9 via AC coupling capacitor 5 and resistor 7.
Microprocessor 25 generates a logic low voltage signal, i.e. 0 volts on the 0/5 volt output thereof for application to resistor 17. Resistors 13, 15 and 17 function as a voltage divider such that the resultant voltage appearing on the inverting input of comparator 9 is 2.49 volts. Resistors 15 and 17 are preferably equal valued resistors, and according to the successful prototype resistor 13 was 100 ohms, and resistors 15 and 17 were each 51k ohms.
Audio signals received from the tip and ring terminals T and R are superimposed on, or summed with a 2.50 volt DC signal applied to the node connecting capacitor 5 and resistor 7 via resistor 11, for application to the non-inverting input of comparator 9.
Thus, with reference to FIG. 2, in the event the node connecting resistors 13, 15 and 17 carries a voltage of 2.49 volts DC, which is applied to the inverting input of comparator 9, then received signals having amplitudes greater than 10 millivolts cause comparator 9 to generate a succession of low level output signals corresponding to successive threshold crossings of the received signal with respect to the 2.49 volt threshold signal. The output signals are applied to the input of gate 21, which generates a succession of logic low level control signals in response thereto. Microprocessor 25 enables gate 21 and receives the control signals via data bus 23.
In the event the tip and ring leads are carrying only noise or extraneous signals having amplitudes of less than 10 millivolts, comparator 9 generates a continuous high level signal which is received by microprocessor 25 via gate 21 and data bus 23. In response, microprocessor 25 does no further processing of the received signal.
However, in the event of detection of a signal of substance (i.e. a signal having an amplitude greater than 10 millivolts) microprocessor 25 generates a logic high (+5 volt) signal for application to resistor 17. In response, the node connecting resistors 13, 15 and 17 carries a signal having a level of 2.50 volts, which is applied to the inverting input of comparator 9. Thus, comparator 9 functions as a zero crossing detector. Microprocessor 25 monitors the signals appearing on the output of comparator 9 via gate 21 and detects the length of time between three successive zero crossings, corresponding to the period of a single cycle of the received signal, in response to execution of an internal program. A source code listing of the internal program is attached hereto as Appendix A.
It is well known from elementary acoustics that a dual tone having equal amplitude parts or component signals exhibits a period which varies between the periods of the individual component signals. However, the average of successive ones of the varying periods converges to the average period of the equal amplitude components.
Thus, in the event of dial tone being received, the signal applied to the non-inverting input of comparator 9 is in the form of a signal having equal amplitude 350 herts and 440 hertz components, offset by 2.50 volts DC. In the event the two component signals are mixed equally, an average period is measured, corresponding to an average frequency of 395 hertz.
It is well known from trigonometry that the sum of two sine waves (eg. sine waves A and B in FIG. 2), having two separate frequencies is related to a product of two sine waves, the first of the multiplied sine waves having a frequency which is the sum of the two separate frequencies, and the second having a frequency which is the difference of the two separate frequencies. Thus, the summed 350 hertz and 440 hertz signals are the mathematical equivalent of a 395 hertz signal multiplied by, or amplitude modulated at a rate of 90 hertz. Hence, microprocessor 25 detects a signal (eg. resultant signal C in FIG. 2) having a period corresponding to 395 hertz which is periodically inverted, or amplitude modulated at a rate of 90 hertz.
However, in the event the tones appear in unequal proportions, wherein the dominant component signal is greater than approximately 3 decibels more powerful than the subdominant component frequency, the microprocessor 25 detects an average period approximately equal to the period of the dominant frequency component signal.
In the event two or more identical periods are detected a single tone is dominant, and the frequency of the detected single tone is calculated, or alternatively processing of the signal is aborted in order to avoid unnecessary utilization of processor time.
In the event of dual tone being received, the microprocessor averages the detected periods and generates an average period signal in response thereto. For instance, according to the successful prototype of the invention eight such detected periods were averaged. Microprocessor 25 then compares the detected average period signal with an internal table of stored periods to determine whether the detected average period corresponds to a frequency which is greater than 350 hertz and less than 440 hertz, in which case dial tone is deemed to be present on the telephone line and a signal indicative thereof is generated by miroprocessor 25. For instance, the microprocessor 25 can generate a signal for splitting and terminating the tip and ring leads T and R, or for initializing an automatic dialing circuits, etc.
In a preferred embodiment of the invention, a plurality of such simple and inexpensive dial tone detector circuits were each connected via a plurality of gates, such as gate 21 to the data bus 23, and microprocessor 25, in order that dial tone detection could be implemented simultaneously on a plurality of telephone lines.
According to the successful prototype, microprocessor 25 executed the aforementioned tone detection program every approximately 10 milliseconds, and the program required approximately 4.5 milliseconds for execution. According to one embodiment of the invention, threshold detection and zero crossing detection were implemented on alternate executions of the program. According to a second embodiment, zero crossing detection was performed during seven out of ten executions and threshold detection was performed during three out of ten executions.
Also, according to the successful prototype, the threshold detection portion of the program required that the received signal have an amplitude of greater than 10 millivolts for at least 0.25 milliseconds, in order that spurious signal transients due to lightening strikes, etc., are not detected as being signals of substance for which the period is to be detected.
A person understanding the present invention may conceive of other variations or embodiments thereof. For instance, while according to the preferred embodiment dial tone detection is described, in fact any dual tone signal may be detected according to the present invention. This, and all other such variations or embodiments are believed to be within the sphere and scope of the present invention as defined by the claims appended hereto.