On Wed, 15 Feb 2012 06:50:13 -0600, Fender123 wrote:
> Thanks all for bearing with me.
>
> But, my original question was about improving Goertzel application for
> FSK, and whether my suggestion makes sense or not, or other related
> suggestion.
>
>
> I am aware of alternate signal chains, but that is not what I asked
> about. Perhaps some of you guys should consider running for office ;-)
>
> My example was taken from 'relaxed' V.21 which is similar to the old
> Bell 103 that Tim/Kevin mentioned. I am also wondering how to take it
> further for higher-shift FSK like that used in CallerID.
>
> Still, I am interested to learn, or at least hear views on, how far
> Goertzel can be pushed, and with what techniques.

Well, you mentioned that you were a newbie, and I think the consensus is
that a Goertzel isn't the best way to approach this -- which is why we
were trying to steer you away from it.
The Goertzel algorithm was invented as a way to (essentially) implement a
single-bin DFT on computers with a certain sort of sparse computing
resources. It requires little storage, but does require at least two
multiplies and two or three additions (if someone has the exact number --
chime in).
It constrains you to starting your "DFT" at a certain point and ending it
at a certain other point. Depending on whose literature you read, it
also may or may not constrain you to setting the bin frequency to an
integer fraction of the total time (you don't have to do this). In a
demodulator application this means that your data clock synchronization
will be complicated by the use of the algorithm compared to using some
sort of band-pass filter technique.
Contrast that to the two alternatives that have been proposed: the single-
point sliding-window DFT, and an IIR bandpass filter.
The DFT (sliding-window or not) does not contain any feedback, so quite
unlike the Goertzel algorithm the quantization error in the multiplies
and additions does not build up. So a single-point DFT can have much
lower precision (in fact, my first experience with serious digital modem
building involved a DFT whose 'multiplies' were to take the incoming
samples and add them to an accumulator, subtract them, or ignore them,
meaning my effective coefficients were restricted to the set {-1, 0, 1}
-- and it worked damn fine). Making the DFT into a sliding-window DFT is
as easy as pi, and takes only 64 words of storage -- and storage is way
cheaper these days than it was when the Goertzel was invented.
I'm pretty sure that a non-sliding-window DFT -- on the surface -- is
going to use similar ALU resources to the Goertzel: unless you have phase
synchronization you'll need to collect both an inphase bin and a
quadrature bin, so the DFT will require two multiplies and two
accumulates. To make the thing sliding-window you'll need a 32-point
delay on two vectors and two subtractions, plus all the ALU operations
involved in the indexing, so it'll be "bigger". But -- the DFT can do
all of this with much reduced precision, so depending on your processor
you may save big with a DFT (obviously, if you have a 32-bit processor
you're not going to save much).
The big advantages that you get from the use of the DFT is that the code
is more clear and the precision needs are reduced. The fact that you're
demodulating at the expected signal frequency is obvious from the
template that you put into the demod vector, as opposed to the Goertzel
where you're basically building an undamped IIR filter that responds to
one frequency by "magic". The precision issue has been explained.
The big advantage that you get by using the sliding window DFT is that
the filter forgets what's happened one bit-period earlier. This means
that you can just take the magnitude of the filters' responses, subtract
them, and treat the result as an NRZ binary stream, to be synchronized to
and decoded like any other baseband stream. So your clock recovery is
completely separated from your data recovery.
I mentioned that the Goertzel is an IIR filter: it is. A Goertzel is
basically a 2nd-order bandpass (or lowpass filter, depending on the
algorithm details) whose coefficients are chosen such that it has zero
damping. As such, by itself, it is hardly less complicated than a 2nd-
order bandpass filter _with_ damping (in the obvious realization the
Goertzel has one "multiplication" by 1 that needs to be less than 1 in
the damped case). If you use a damped IIR filter (and choose the damping
ratio wisely), you gain the same advantage that you do with the sliding
window: the filter forgets what has happened to it in the past, letting
you just sample for magnitude of response and separate your clock and
data recovery tasks.
But shove that all aside: yes, you can use a Goertzel. Yes, you can
increase the sampling rate and either taper the window (which will boost
your complexity) or take other measures. One thing you could do is go
ahead and design the Goertzel for a fractional frequency, and at the end
of the Goertzel's window you can use both states to determine the
magnitude. You could, for instance, sample at 61050Hz, which makes all
the necessary ratios (sampling/baud, sampling/mark frequency and sampling/
space frequency) into integers.
But doing so is kind of like putting a Model A Ford engine into a Ford
Pinto (I've seen pictures), or building your stereo receiver out of
vacuum tubes, or plowing your garden with an ox: it's feasible, it works
as well as it ever did, but it doesn't work as well as the modern
alternatives.
So, if you really must use Goertzel, my recommendation is that you use
the Goertzel with a fractional period (i.e., just go ahead and set the
coefficients to 2 * cos(2 * pi * 1650/9600) and 2 * cos(2 * pi *
1850/9600)), then use both states of the thing at the end of a bit period
to determine the amplitude in the Goertzel, and have fun.
But when you come back asking how to do bit clock synchronization --
expect to be criticized for choosing the Goertzel.
--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?
Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com