EmbeddedRelated.com
Forums

Signal strength at some fixed frequency

Started by David Ashley October 17, 2006
linnix wrote:
> David Ashley wrote: > >>linnix wrote: >> >>>>Well it's a bit more complicated, I need to determine signal presence of >>>>almost 100 different frequencies, all at the same time, not just one. >>> >>> >>>Within what time frame? What Sampling rates and processing bins? For >>>example, the 50MHz ARM can process a 10Khz signals in 3 to 4 seconds. >>>Of course, you can hook-up 100 of them to get results in 40 msec >> >>Actually now that I think about it I can probably get by with >>looking at just 24 frequencies at a time. But I need to know >>about 10 times per second whether each frequency is present >>in the signal. > > > It would need approx. 120MHz for floating points and 80MHz for > integers. Can you sample a subset and do the rest if necessary. For > DTMF, you only need to decode 8 for first harmonics and another 8 for > second harmonics (to confirm pure tones). >
It's nothing related to DTMF. The frequencies I'm interested in would have overtones/harmonics. I'm counting on just being able to look for the base frequency and ignoring the overtones, and hopefully the signal strength at the base is the main component. Integers must be faster than that...software floating point implementations would require a lot of cycles for doing each operation. -Dave -- David Ashley http://www.xdr.com/dash Embedded linux, device drivers, system architecture
David Ashley wrote:
> linnix wrote: > > David Ashley wrote: > > > >>linnix wrote: > >> > >>>>Well it's a bit more complicated, I need to determine signal presence of > >>>>almost 100 different frequencies, all at the same time, not just one. > >>> > >>> > >>>Within what time frame? What Sampling rates and processing bins? For > >>>example, the 50MHz ARM can process a 10Khz signals in 3 to 4 seconds. > >>>Of course, you can hook-up 100 of them to get results in 40 msec > >> > >>Actually now that I think about it I can probably get by with > >>looking at just 24 frequencies at a time. But I need to know > >>about 10 times per second whether each frequency is present > >>in the signal. > > > > > > It would need approx. 120MHz for floating points and 80MHz for > > integers. Can you sample a subset and do the rest if necessary. For > > DTMF, you only need to decode 8 for first harmonics and another 8 for > > second harmonics (to confirm pure tones). > > > > It's nothing related to DTMF. The frequencies I'm interested in > would have overtones/harmonics. I'm counting on just being able > to look for the base frequency and ignoring the overtones, and > hopefully the signal strength at the base is the main component. > > Integers must be faster than that...software floating point > implementations would require a lot of cycles for doing each > operation.
I replaced the floating point equation with fixed point, not considering scalings and overflows. I test it on both a Pentium and ARM, the result agrees with approx 0.2MHz per frequency (200 samples). The Algorithm is quite simple, so integer alone won't change much.
> > -Dave > > -- > David Ashley http://www.xdr.com/dash > Embedded linux, device drivers, system architecture
By pre-defining the constant, this can be implenmented in 20MHz ARM
Cortez in a second.

#define N	200	// Block size
#define R	8000.0	// kHz
#define F	900.0	// Hz

#define COSINE 0.741433

for(count=0; count<10; count++)
 for(freq=0; freq<24; freq++)
  for(index=0; index<N; index++)
    Q0 = 2 * COSINE[freq] * Q1 - Q2 + sample[index];

David Ashley wrote:
> linnix wrote: > >>David Ashley wrote: >> >> >>>linnix wrote: >>> >>> >>>>>Well it's a bit more complicated, I need to determine signal presence of >>>>>almost 100 different frequencies, all at the same time, not just one. >>>> >>>> >>>>Within what time frame? What Sampling rates and processing bins? For >>>>example, the 50MHz ARM can process a 10Khz signals in 3 to 4 seconds. >>>>Of course, you can hook-up 100 of them to get results in 40 msec >>> >>>Actually now that I think about it I can probably get by with >>>looking at just 24 frequencies at a time. But I need to know >>>about 10 times per second whether each frequency is present >>>in the signal. >> >> >>It would need approx. 120MHz for floating points and 80MHz for >>integers. Can you sample a subset and do the rest if necessary. For >>DTMF, you only need to decode 8 for first harmonics and another 8 for >>second harmonics (to confirm pure tones). >> > > > It's nothing related to DTMF. The frequencies I'm interested in > would have overtones/harmonics. I'm counting on just being able > to look for the base frequency and ignoring the overtones, and > hopefully the signal strength at the base is the main component. > > Integers must be faster than that...software floating point > implementations would require a lot of cycles for doing each > operation.
What is the frequency difference of the components to be separated? You need a long enough sample of the input signal to correctly see an appreciable part of the lowest difference frequency. Please remember also that the analog input has to be correctly filtered for the Nyqvist frequency for the sample rate. -- Tauno Voipio tauno voipio (at) iki fi
Tauno Voipio wrote:
> David Ashley wrote: > >> linnix wrote: >> >>> David Ashley wrote: >>> >>> >>>> linnix wrote: >>>> >>>> >>>>>> Well it's a bit more complicated, I need to determine signal >>>>>> presence of >>>>>> almost 100 different frequencies, all at the same time, not just one. >>>>> >>>>> >>>>> >>>>> Within what time frame? What Sampling rates and processing bins? For >>>>> example, the 50MHz ARM can process a 10Khz signals in 3 to 4 seconds. >>>>> Of course, you can hook-up 100 of them to get results in 40 msec >>>> >>>> >>>> Actually now that I think about it I can probably get by with >>>> looking at just 24 frequencies at a time. But I need to know >>>> about 10 times per second whether each frequency is present >>>> in the signal. >>> >>> >>> >>> It would need approx. 120MHz for floating points and 80MHz for >>> integers. Can you sample a subset and do the rest if necessary. For >>> DTMF, you only need to decode 8 for first harmonics and another 8 for >>> second harmonics (to confirm pure tones). >>> >> >> >> It's nothing related to DTMF. The frequencies I'm interested in >> would have overtones/harmonics. I'm counting on just being able >> to look for the base frequency and ignoring the overtones, and >> hopefully the signal strength at the base is the main component. >> >> Integers must be faster than that...software floating point >> implementations would require a lot of cycles for doing each >> operation. > > > What is the frequency difference of the components > to be separated? You need a long enough sample of > the input signal to correctly see an appreciable > part of the lowest difference frequency. > > Please remember also that the analog input has to be > correctly filtered for the Nyqvist frequency for > the sample rate. >
The frequencies go from a base frequency up by a constant factor of 1.05946 in each step. That's just 2 ^ (1/12). 12 steps and you're at double the original frequency. -Dave -- David Ashley http://www.xdr.com/dash Embedded linux, device drivers, system architecture
On Fri, 20 Oct 2006 14:25:57 -0700, David Ashley
<dash@nowhere.net.dont.email.me> wrote:

>The frequencies go from a base frequency up by a >constant factor of 1.05946 in each step. That's >just 2 ^ (1/12). 12 steps and you're at double the >original frequency.
So, you're making a piano tuner, eh? Robert Scott Ypsilanti, Michigan
Robert Scott wrote:
> David Ashley <dash@nowhere.net.dont.email.me> wrote: > >> The frequencies go from a base frequency up by a constant factor >> of 1.05946 in each step. That's just 2 ^ (1/12). 12 steps and >> you're at double the original frequency. > > So, you're making a piano tuner, eh?
IIRC there's something about flats <> sharps. :-) -- Chuck F (cbfalconer at maineline dot net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net>

linnix wrote:


> > It would need approx. 120MHz for floating points and 80MHz for > integers. Can you sample a subset and do the rest if necessary. For > DTMF, you only need to decode 8 for first harmonics and another 8 for > second harmonics (to confirm pure tones).
HaHaHa. For DTMF you need 0.5 MIPS and a processor like PIC16. That's it. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
1 multiply, 1 add, 1 subtract?

on a 14-bit PIC core, (8-bit integer math) the multiply simplifies to
8bit x 8bit -> 16bit, then take bits 2-9 (shift left) to compensate for
2*cos, move to w, subtract, add.

I estimate that line would take ~20 -  45 cycles which, @ 5MIPS (20
Mhz) comes out to 4-9us. 250000 - 111100 times per second.

Vladimir Vassilevsky wrote:
> linnix wrote: > > > > > > It would need approx. 120MHz for floating points and 80MHz for > > integers.
Yes, my mistake, 20 MHz for floating point and 13Mhz for integer.
> > HaHaHa. > > > For DTMF you need 0.5 MIPS and a processor like PIC16. That's it.
For DTMF, you don't need to decode 24x10 frequencies per second. He need about 20 MIPS.