From: glen herrmannsfeldt on 8 Jan 2010 23:27
Jerry Avins <jya(a)ieee.org> wrote:
> By convention, we use square brackets for discrete sequences and curved
> parentheses for continuous quantities and for grouping. I would write
I thought it was C programmers used square brackets and Fortran
programmers used parentheses.
From: Jerry Avins on 8 Jan 2010 23:48
glen herrmannsfeldt wrote:
> Jerry Avins <jya(a)ieee.org> wrote:
>> By convention, we use square brackets for discrete sequences and curved
>> parentheses for continuous quantities and for grouping. I would write
> I thought it was C programmers used square brackets and Fortran
> programmers used parentheses.
We don't have subscripts at the ready, so we use brackets instead. "So
many conventions, so few fonts."
Engineering is the art of making what you want from things you can get.
From: Fred Marshall on 9 Jan 2010 00:42
> I could use some help, since I am very new to DSP. Here is my situation:
> I am recieving I/Q data at 250kHz rate, demodulating it with demodulation
> algorithm: IdQ+QdI/I^2+Q^2.
> Then storing 800 samples and using the Goertzel algorithm to detect 4
> different tones.
> Currently the DSP cannot calculate all of this and I am getting data
> overrun, I have a flag which tells me that the Goertzel is not finished on
> the block of 800 before the next block is ready, I have to continually
> detect tones. The demodulation is done every time a new frame of data comes
> in, and the Goertzel is run in the backround after 800 samples are stored
> up (double buffered). I cannot slow down the data rate and I have to detect
> 4 tones. Currently using a TMS320F28335 DSP running at 144Mhz.
> Is there a more effiecient way to detect the 4 tones, I have read about
> sliding Goertzel or sliding DFT, is this more efficient, or have I just met
> the limit of the DSP number crunching since my data rate is pretty fast.
> -Jacob Fenton
Let's see. You are sampling at 250kHz and taking 800 samples. So
that's 3.2msec of data and that gives about 312Hz resolution (1/0.0032).
The closest tones are 960Hz apart so the resolution available may
present a challenge as they are only 3 resolution cells / sample
intervals apart in frequency.
So, as a check, you would like to have a bandpass filter with transition
bands not much more than 1kHz and not much passband width.
And, I'd assume that you'd like the filter to settle down after about
250 samples or so.
The quicker the settling, the shorter the filter.
The shorter the filter, the longer the transition bands and/or larger
the stopband ripple.
Would it make sense to decimate first to get the sample rate down? I
should think so. It wouldn't take a lot of filtering do accomplish that
I shouldn't think. After all, all of the tones are in the very low end
of the range of Fs. A factor of 8 might even be possible getting you
down to 31.25kHz. A that, the highest tone would be at 78% of Fs/2.
Then you could think of a sample that's 100 samples long and a filter
that's more like 30 samples long or so.
i.e. 30 samples at 31250 is around 1msec so would have transition bands
around 1000 Hz which appears to be what you need....
Lot of arm waving here, be sure it makes sense.....
From: kevin on 9 Jan 2010 02:20
Well. I see that Fred Marshall beat me to it, but I was going to raise
a similar issue.
In the frequency domain, your bin spacing is sample rate/N, so if
you were to do an FFT (or DFTs spanning the range of interest), youd
have 250k/800 = .3125 kHz = 312.5 hz separation between adjacent
frequency outputs. So FFT output 0 (or DFT using k = 0) would
correspond to 0 hz, output 1 would be 312.5 hz, output 2 is 2 x 312.5
hz (= 625.0 hz), output 3 is 3 x 312.5 hz (= 937.5 hz), etc.
So the (fractional) DFT bins corresponding to your 4 tones are:
K1 = 7500/312.5 = 24
K2 = 8460/312.5 = 27.072
K3 = 10760/312.5 = 34.432
K4 = 12140/312.5 = 38.848
Given your sample rate and N, youve only got a few bins separation
between some of the above numbers, so your resolution is not all that
great in the frequency domain. Whether you use Goertzel, or FFT, or
DFTs or sliding DFT, your 4 tones of 7500,8460,10760,12140 are going
to be bunched up within the 14 bin span above, and you may have some
As Vladimir noted, your sample rate of 250k is way too high given that
your highest tone is 12140. You really dont need more than 25k. By
lowering your sample rate, you can improve the ability to resolve
closely spaced tones in the frequency domain.
Now if your SNR were higher, a simple suggestion would be to use only
every tenth sample, giving you a sample rate of 25k. I dont think
you can keep the same N, though, as this probably exceeds your 25 ms
time. But if you used, say N = 100 points, then your bin spacing
would be 25k/100 = 250 hz, and the 4 bins shown above would exhibit
greater separation (replace 312.5 above with 250 to get the DFT
indexes for the tones when using sample rate = 25k and N = 100).
Using 4 DFTs, each one tuned to the frequency of one of the 4 tones,
you could examine the amplitude squared output of each DFT filter and
compare to a threshold to determine if the tone is present. If you
wanted to reduce leakage effects, use a window on the data. If you
compute things carefully, you can get the windowing for free by using
look-up tables that contain the pre-computed sin/cos values needed by
the DFT, multiplied by the window points.
If you want to get an output after each input sample, then you could
use a sliding DFT and compute it for the 4 different DFT index
values. Computationally, a DFT or a sliding DFT will be similar in
terms of number of operations per sample.
Of course, you may instead want to use decimation first, followed by
the filtering operations that Fred suggested.
From: Vladimir Vassilevsky on 9 Jan 2010 14:05
> As Vladimir noted, your sample rate of 250k is way too high given that
> your highest tone is 12140. You really dont need more than 25k.
Since his bandwidth is 4.6k, he doesn't need the samplerate higher then
9.2k. Perhaps, with some creativity applied, the samplerate could be
made even lower. The tricky part is dealing with the aliasing while
demodulating FM, however this can be handled.
Heck, the signal is stationary over 25ms, that means the sample rate of
80 Hz is sufficient.
> Using 4 DFTs, each one tuned to the frequency of one of the 4 tones,
> you could examine the amplitude squared output of each DFT filter and
> compare to a threshold to determine if the tone is present.
The tone detector part is trivial and not very interesting.
DSP and Mixed Signal Design Consultant