DSPRelated.com
Forums

DTMF detection with Goertzel

Started by ma July 13, 2005
Hi,

(...)

>> application, I may be able to help more. Some of DTMF's constraints >> came from the relatively narrow bandwidth of the channel and the >> slowness of human dialing. How fast do you need to send your data? Do >> you have a lot of data to send? Will a Bell 202 FSK modem and a UART >> work?
maybe 8 bits FSK transmission (UART) is the best solution ? As I wrote, tone duration and transmission delays are not important, as I can use audio delay buffers. Important is to keep time synchronisation between data bit and audio stream (these bits are used to switch audio devices). Regards Roman
Roman Rumian wrote:
> Hi Jerry, > > Jerry Avins napisał(a): > >> Roman Rumian wrote: >> >>> Hi Clay, >>> >>> I have to design a tone signalling system for stereo 15-20 kHz >>> digital audio channel. The customer need 8 binary flags (on/off). >>> I think about four tones from 16 to 17,5 khz, 500Hz spaced, and >>> Goertzel detection algorithm. >>> 16 tone pairs from left and right channel give 16 states I nedd for >>> flags. >>> Is this a good idea ? >>> What is the minimal lenght of tone signal ? >>> Will be grateful for suggestions. :-) >>> >>> Best regards >>> >>> Roman Rumian >> >> >> >> Three bits determine which tone, and a fourth determines on/off. >> Without the on/off tone, you need eight tones for eight flags. I think >> that's the more reliable way. >> >> Jerry > > > hm ... you mean " three tones determine which bit and fourth on/off" ? > The problem is, that static presence of some (4 ?) tones in both (left > and right) channel are unwanted, as they take valuable mpeg bits, but > maybe short tone pulses are not safe ?
I don't see that the tones have to persist. Whenever the complete set of tones is present, the state they prescribe is entered, That state persists until a valid countermand is detected. An on/off tone can be replaced with the transmission channel. A tone (or decoded set of three tones) on the one channel raises a flag; the same tone on the other lowers it. From your answer, I suspect that I'm overlooking a constraint or obvious simplification. Am I? Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"Roman Rumian" <usun_torumian@agh.edu.pl> wrote in message 
news:dbafbh$1uj$1@galaxy.uci.agh.edu.pl...
> Hi, > > (...) > >>> application, I may be able to help more. Some of DTMF's constraints came >>> from the relatively narrow bandwidth of the channel and the slowness of >>> human dialing. How fast do you need to send your data? Do you have a lot >>> of data to send? Will a Bell 202 FSK modem and a UART work? > > maybe 8 bits FSK transmission (UART) is the best solution ? > As I wrote, tone duration and transmission delays are not important, as I > can use audio delay buffers. Important is to keep time synchronisation > between data bit and audio stream (these bits are used to switch audio > devices). > > Regards > > Roman
Hello Roman, 4 days? Ouch. I feel for you if this is a real constraint. You can certainly use multiple tones all in parallel and use only certain combinations as legal symbols. You could even go so far as to treat each frequency as a bit and then have error correction by using some frequencies as parity bits. You have more than enough bandwidth to support a lot of tones. Since you are on a clear channel, you can used arithmetically spaced frequencies and then the FFT becomes attractive as a tone decoder. I don't know the exact computational crossover between when using the FFT becomes better than a handful of DFTs via Goertzel, but I think the number is small on the order of 10 to 20 frequencies or so. You can implement a Hamming (perfect 1 bit error correction), common BCH (2 bit error correction) or a Golay (perfect 3 bit error correction) code. You won't need a fancy error corrector, just use a simple look up table that contains all of the error permuted versions of the allowed codewords. I recall for the Golay this is a table of 4096 entries. Your others will likely be much smaller. If you want your tones to not be very loud, then certainly use a long duration and have your decoder integrate over this time to afford some immunity against noise. You have the advantage of near perfect frequency and a large bandwidth. Also with parallel tones require them to all start and end at the same time. I hope this helps, Clay
On 14 Jul 2005 09:15:35 -0700, "Clay" <physics@bellsouth.net> wrote:

  (snipped)
> >Sliding Goertzel is a neat way of having the Goertel output on a sample >by sample basis. It is like having blocks where all but one sample >overlap. Hower this algo is very efficient for computing this. Think >about a DTMF dailer's digits being on for 65mSec and off for 35mSec. >You will need to be able to clearly see the off times in between >digits. What is the time for 205 samples at 8000Hz? Compare this with >35mSec. There was an article about Sliding Goertzels in Digital Signal >Processing Magazine a year or two ago. >
Hi Clay, the articles were: Jacobsen & Lyons, "The Sliding DFT", IEEE Signal Processing Magazine, DSP Tips & Tricks column, Vol. 20, No. 2, March 2003. Jacobsen & Lyons, "The Sliding DFT, an Update", IEEE Signal Processing Magazine, DSP Tips & Tricks column, Vol. 21, No. 1, Jan. 2004. The idea of a "sliding Goertzel" process was introduced to me by Keith Larson (Tex. Instruments) See Ya', [-Rick-]
Very interesting. How is it working? How is it possible to generate two pure 
tone with one trnaistor?

Old electronic techniques are so good that I like to learn as much as I can!

Best regards


"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message 
news:Be-dnam7ncuTu0XfRVn-gQ@comcast.com...
> Mark wrote: >> Speaking of DTMF, > >> I actually have a Bell 247B DTMF decoder (discrete transistors, pot >> cores, and relays) still in serivce in a ham radio link in my >> basement... > > No, but I remember that the original DTMF touch-tone phones > used a one transistor circuit to generate them. They wanted > to minimize the number of the least reliable component. > > -- glen >
"ma" <ma@nowhere.com> wrote in message 
news:_vfCe.143826$Vo6.33279@fe3.news.blueyonder.co.uk...
> Very interesting. How is it working? How is it possible to generate two > pure tone with one trnaistor? > > Old electronic techniques are so good that I like to learn as much as I > can! > > Best regards > > >
It is a dual mode oscillator. The Hartley Osc uses an inductor with a center tap and capacitor and this feedback network is a 180 degree phase shifter. The transistor itself also provides 180 degrees of phase shift. So for a dual mode osc., just connect two feedback networks in parallel. This can be quite easily done in DSP as well. Clay
Interesting!
Can it be extended to several frequncy?
How pure is each frequncy?
How can it be implimented in DSP?
best regards

"Clay S. Turner" <Physics@Bellsouth.net> wrote in message 
news:4ciCe.43325$ag7.11070@bignews4.bellsouth.net...
> > "ma" <ma@nowhere.com> wrote in message > news:_vfCe.143826$Vo6.33279@fe3.news.blueyonder.co.uk... >> Very interesting. How is it working? How is it possible to generate two >> pure tone with one trnaistor? >> >> Old electronic techniques are so good that I like to learn as much as I >> can! >> >> Best regards >> >> >> > > It is a dual mode oscillator. The Hartley Osc uses an inductor with a > center tap and capacitor and this feedback network is a 180 degree phase > shifter. The transistor itself also provides 180 degrees of phase shift. > So for a dual mode osc., just connect two feedback networks in parallel. > This can be quite easily done in DSP as well. > > Clay > > >
"ma" <ma@nowhere.com> wrote in message 
news:pdzCe.161621$Vj3.94795@fe2.news.blueyonder.co.uk...
> Interesting! > Can it be extended to several frequncy? > How pure is each frequncy? > How can it be implimented in DSP? > best regards >
Hello Ma, Yes you can extend to many frequencies but some practical issues arise. The tones are as pure as your math allows. A simple example: Single tone generator (biquad design) y(z) 1 ---- = ------------------------ x(z) 1 - 2cos(a) z^-1 + z^-2 This transfer equation can be found by many methods, but a DSP oriented one is to find the z transform of cos(at) or sin(at). Then the numerator is changed to 1 to simplify things. All the numerator does is scale the output and adjust the phase of the impulse response. Hence we have made an all pole filter. Another way to look at it is we have found the 2nd order linear prediction coefficients of a sinusoid. They are: 2 cos(a) and -1 Now a dual tone oscillator may be found by simply adding together two z transforms (i.e., summing two oscillators) and finding the new common denominator. Again the resulting numerator may be changed to just 1. The 4 feedback coefs are: 2(cos(a) +cos(b)) -2-4cos(a)cos(b) 2(cos(a)+cos(b)) -1 Here a= 2pi*f1/fs and b= 2pi*f2/fs and fs is the sampling rate. So you can implement a 4th order all pole filter to generate two simultaneous tones. The 4 initial values will determine the amplitudes and phases of the sinusoids. Of course most would rather implement two 2nd order oscillators and simply sum their outputs. But as you can see multifrequency generation is possible with a single filter structure, and I have even implemented this method for generating DTMF, MF and MFC tones. I was able to save a few cycles this way and I was using two 40MHz DSPs to handle an E-1 trunk. Since the tones' durations were short, amplitude control was not needed. I used a 24 bit DSP so a 45mSec or 100mSec tone burst was well tamed. For fun you ought to look at changing the 4th order all pole design to a lattice filter design. If you recall many speech algorithms use LPC analysis and use lattice filters since an all pole filter model is commonly used for the vocal tract. So an LPC-10 model could create 5 simultaneous frequencies. Clay
Hello Clay,


many thanks for help ! :-)))

Kind regards

Roman
Clay S. Turner napisa&#4294967295;(a):

> Hello Roman, > > 4 days? Ouch. I feel for you if this is a real constraint. You can certainly > use multiple tones all in parallel and use only certain combinations as > legal symbols. You could even go so far as to treat each frequency as a bit > and then have error correction by using some frequencies as parity bits. You > have more than enough bandwidth to support a lot of tones. Since you are on > a clear channel, you can used arithmetically spaced frequencies and then the > FFT becomes attractive as a tone decoder. I don't know the exact > computational crossover between when using the FFT becomes better than a > handful of DFTs via Goertzel, but I think the number is small on the order > of 10 to 20 frequencies or so. You can implement a Hamming (perfect 1 bit > error correction), common BCH (2 bit error correction) or a Golay (perfect 3 > bit error correction) code. You won't need a fancy error corrector, just > use a simple look up table that contains all of the error permuted versions > of the allowed codewords. I recall for the Golay this is a table of 4096 > entries. Your others will likely be much smaller. If you want your tones to > not be very loud, then certainly use a long duration and have your decoder > integrate over this time to afford some immunity against noise. You have the > advantage of near perfect frequency and a large bandwidth. Also with > parallel tones require them to all start and end at the same time. > > I hope this helps, > > Clay
Hi Jerry,

Jerry Avins napisa&#4294967295;(a):
(...)
> > I don't see that the tones have to persist. Whenever the complete set of > tones is present, the state they prescribe is entered, That state > persists until a valid countermand is detected. An on/off tone can be > replaced with the transmission channel. A tone (or decoded set of three > tones) on the one channel raises a flag; the same tone on the other > lowers it. From your answer, I suspect that I'm overlooking a constraint > or obvious simplification. Am I?
No. It seems resonable, but I am afraid, that have to send all 8 inputs state simultaneously. What then ? Serial transmission and then parallel buffer ? Best regards Roman