Quardrature Direct Fourier Transform

Discussion in 'Electronic Design' started by Luhan Monat, May 31, 2004.

1. Luhan MonatGuest

Hi,

I've been using this method for tone decoding on several projects so far...

http://members.cox.net/berniekm/qdft.html

Since I am nearly 100% self educated in electronics and such, I have no

2. Jim ThompsonGuest

Very interesting! Care to elaborate on your circuitry?

...Jim Thompson

3. Activ8Guest

it's a PIC12F675. an 8 pin job. I guess you have to sample the hell
out of the tones to find the peaks. First you'd have to filter out
the high and low tones though.

4. Allan HerrimanGuest

" The resultant sums are then 'vector added' by taking the 'square
root of the sum of the squares'."

The DFT is defined with a complex output, which means that the real
and imaginary parts are left as is; there is no square root operation
in a DFT per se.

You might want to use a sqrt to find the magnitude. However, if
converting to dB, it's better to just sum the squares of the two parts
then take 10.log(), rather than 20.log(sqrt()).

As for your invention: this technique is well known. I posted a
tutorial [about something that was essentially equivalent] to comp.dsp
a few years ago.
http://www.dspguru.com/comp.dsp/tricks/alg/cpxdown.htm

Don't be discouraged though; this is an excellent idea, and you did
well to think of it by yourself.

Regards,
Allan.

5. Allan HerrimanGuest

Also, if comparing the magnitude against a threshold, it is much
cheaper to compare the square of the magnitude against the square of
the threshold, as this avoids a sqrt operation needed to find the
magnitude.

Also look at this family of cheap rectangular to magnitude
approximations:
http://www.dspguru.com/comp.dsp/tricks/alg/mag_est.htm

Regards,
Allan.

6. Tim WescottGuest

I designed a radio for my Master's thesis in 1990 that used this sort of
gimmick to decode 400 baud MSK on a Motorola 6811 -- it worked very
well, being only a dB or two below theoretically optimal performance.

7. Luhan MonatGuest

Hi Jim,

Circuitry - two 22k resistors from the A/D input to + and ground
respectively, and a 0.1 uf cap from the source to the A/D input.

8. Luhan MonatGuest

No, I just time the samples for the tartget frequency. You dont
actually have to find the peak since the computations use both sine and
cosine - just like regular old FFT.

9. Luhan MonatGuest

I can't say I've seen it used before, but I think it's a clever idea --
taking the usual 'correlation' approach and breaking it down to just 4
samples per period! Have you compared the performance against other, say,
DTMF decoders? I would suspect it's not quite as good, but given how
parsimonious its CPU requirements are, I'd say it's still a big 'win!'

I'd be particularly interested in comparing the performance to a straight
'bandpass filter using coefficients of 0/+/-1' approach. This doesn't
require the computation of I^2+Q^2 (which seems like it would be adequate
for your needs, right? The square root, as others have pointed out, is
rather slow to perform and is usually approximated anyway.), but needs
(noticeably) more than 2 additions or subtractions per period.

11. Fred BloggsGuest

Yes- you are about 22 years behind the curve- this type of processing is
known as quadrature sampling with digital mixing:

Considine,V. "Digital Complex Sampling" Electronics Letters, 19, 4 Aug 1983
Components", IEEE Transactions Aerospace and Electronics Systems, Vol.
AES-20, No.6, November 1984
Rice,D. and Wu, K.,"Quadrature Sampling with High Dynamic Range", IEEE
Transactions Aerospace and Electronic Systems, Vol. AES-18, No.4, Nov 1982
Pellon,L.E.,"A Double Nyquist Digital Product detector for Quadrature
Sampling", IEEE Trans. Signal Processing, Vol.40,N0.7, July 1992

12. Luhan MonatGuest

Wow, only 22 years! Looks like I'm catching up.

13. maxfooGuest

That should get you an honorary doctorate degree from the prestigious 'S.E.D.'

14. Bill SlomanGuest

The basic idea is definitely older - colour TV encodes the colour
information as sine and cosine components of the colour carrier (which is
something like 5MHz). The original systems used analog decoding in
quadrature to demodulate two separate colour signals from the 5MHz carrier.
IIRR RCA (America) and EMI (UK) patented identical systems at much the same
time, one describing it as "sine and cosine" as the other as "quadrature".

When the matter came to court, the lawyers couldn't be persuaded that the
systems were identical .....

15. Fred BloggsGuest

The idea here is not quadrature decoding per se but digital quadrature
decoding using a single sampling channel. The impetus for this
development was the shortfall in the analog circuitry available at the
time for maintaining the quadrature in phase and amplitude across the
requisite bandwidth at the required precision.

16. Bill SlomanGuest

Seems odd. Quadrature sampling with high dynamic range isn't going to
use a single stage flash A/D converter, and every other kind of fast
A/D needs a sample and hold in front of it to sample the signal to be
converted at the desired time and hold it stable through the various
sorts of successive approximation steps.

So how does digitisation get around the shortfall in the analog sample
and hold that is doing the actual sampling?

(Yes, I know, talking to myself...)

I took a look at the above mentioned approach, and the results are somewhat
depressing... the 'slowest' case is the bandpass filter at 697Hz (for DTMF),
and this ends up requiring 105 additions and 105 subtractions for every
input if I spec things out such that I get 20dB suppression of 660Hz/710Hz.
I have a suspicion that these numbers aren't particular better (and might
actually be worse) than Luhan's method... although it's unclear to me just
what the actual frequency response of his method turns out to be.

---Joel

18. Luhan MonatGuest

Sample and hold functions are built into the PIC A/D circuitry.

19. Fred BloggsGuest

I cannot speak for the 1982 era SH's- but they are no longer a
limitation in modern times- with sampling apertures at under 100ps and
much faster than the actual A/D pipelined conversion rate.

20. Bill SlomanGuest

This is very common - we've had complaints here that the only way to
get a really good sample-and-hold function these days is to buy a fast
A/D converter.

Burr-Brown used to sell 12- and 14-bit accurate sample and holds, with
aperture times of the order of a few tens of nanoseconds, but they
stopped selling them some years ago. I had copies of the data sheets
in the late 1980's, but I can't find them in the Texas Instrument list
of obsolete parts (Texas Instruments took over Burr-Brown a couple of
years ago).