[time-nuts] A simple sampling DMTD

Joseph Gwinn joegwinn at comcast.net
Sat Nov 30 17:23:07 UTC 2019


Re: time-nuts Digest, Vol 184, Issue 40
On Fri, 29 Nov 2019 20:37:02 -0500, time-nuts-request at lists.febo.com 
wrote:

[snip]
> Message: 6
> Date: Fri, 29 Nov 2019 20:37:16 +0100
> From: Gerhard Hoffmann <dk4xp at arcor.de>
> To: time-nuts at lists.febo.com
> Subject: Re: [time-nuts] A simple sampling DMTD
> Message-ID: <f34ec823-04f2-a92f-b7a1-85ab165cdc6a at arcor.de>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> Am 29.11.19 um 11:45 schrieb Jan-Derk Bakker:
>> In general: as much as I like having it in my toolbox, I don't see how
>> using an FFT would be the best tool for the job in a zero-crossing detector
>> for a DMTD, let alone this particular sampling DMTD. For one, this 8-bit
>> processor doesn't have the spare cycles to run FFTs on the 32-bit data I
>> get from my CIC^2 decimator; besides that, I would only be interested in a
>> single bin (the beat frequency), where it would be more efficient to simply
>> I/Q-demodulate the samples in software (O(N) vs O(N log N)). While I admit
>> that in the latter case windowing would help, at this point I/Q
>> demodulating (effectively calculating only a single bin of the DFT) does
>> not appear to have advantages over least squares fitting the arcsine of the
>> incoming samples. Am I missing something here?
> 
> I admit that I did not follow this thread closely, but the Goerzel filter 
> is the single output line DFT , with O(n).
> 
> 
<https://www.mathworks.com/help/signal/ref/goertzel.html;jsessionid=8816f77eb76ad7dd1913c7021698>
> 
> <?? https://en.wikipedia.org/wiki/Goertzel_algorithm ??? >
> 
> If you need to simulate floats, fractional integers are easiest.
> I/Q demodulation probably requires to recreate a clean carrier if you want
> absolute phase and not only relative jumps. That sounds more like FPGA
> than 8051, or whatever the 8 bit processor of the day may be.
> 
> regards, Gerhard
> 
> 
> 
> OK, in a previous life I did build a system for geophysics, where they fed
> dangerous amounts of AC into the soil and measured the potential at
> some 50 nodes. Rubber boots required.
> Each node had a 8951 to control some switches and communicate setups.
> They were most excited when I gave them the sources so they could
> implement FFT pre-processing locally on each node themselves. 
> That required willingness to suffer.
> 
   
   
I must say that the above all seems to me to be more complex than 
needed.  

The fundamental problem to be solved is to estimate the phases of two 
beatnotes, one per channel (ref, signal under test), the phase 
difference being converted into a relative time delay.  So, we are 
estimating phase twice, against an unknown but common internal 
reference, and the key question here is how best to measure those two 
phases.  Detection of zero crossings is one way, but there are others. 

We know the frequencies of the beatnotes quite accurately, and that the 
waveforms are sine waves (which we will have band-pass filtered in 
hardware before conversion to digital data).  Here, I will assume that 
the frequencies are the same.  The only free variables are thus 
amplitude and phase; these can be estimated using least squares applied 
to successive batches of I&Q samples.  Windowing is still useful to 
reduce end splice effects, as previously discussed.  Given that we are 
working in the numerical domain, it's probably adequate to apply the 
window function to the product of the proposed match and the actual 
data, and then sum the windowed products.

As a quality check, if the estimated amplitude is too small (or too 
large), reject the phase estimate and try again.  If this condition 
persists too long or becomes too common, something is broken.

I doubt that anything of the 8-bit class is practical for this, and 
certainly not for a small-volume product, because programming effort 
increases sharply if the chosen processor is too limited.  Ardinuo and 
maybe StrawberryPi seem more like it.

As for emulation of floating point, the least-squares algorithm defined 
above can certainly be implemented in fixed-point arithmetic, called 
fractional integers above.  
<https://en.wikipedia.org/wiki/Fixed-point_arithmetic>

In the extreme, this kind of algorithm will work with data clipped to a 
few bits per sample.  The underwater sonar folk are masters of this, 
especially back in the days when signal processors were necessarily 
bespoke hardware.  The search term is "one-bit correlator" (without the 
quotes).

Joe




More information about the Time-nuts_lists.febo.com mailing list