JG
Joseph Gwinn
Wed, Nov 27, 2019 5:48 PM
Message: 8
Date: Wed, 27 Nov 2019 00:29:19 +0100
From: Jan-Derk Bakker jdbakker@gmail.com
To: Discussion of precise time and frequency measurement
time-nuts@lists.febo.com
Subject: Re: [time-nuts] A simple sampling DMTD
Message-ID:
CAEoGJM=DwGUzAuTAAw13948HuAGdZo+YSxymozDnWD07G94Oiw@mail.gmail.com
Content-Type: text/plain; charset="UTF-8"
[This thread has started about three months ago; first post with design
considerations is here:
https://www.mail-archive.com/time-nuts@lists.febo.com/msg04265.html ]
Dear all,
In the past month I have managed to get the PLL working, and found a
lightweight way to eliminate most if not all of the offset/drift.
After the discussions with Attila and Bob I have expanded the PLL bandwidth
to 0.5Hz (with a 10Hz PFD frequency I can't go very much higher). The
damping factor is 0.7 for now; I intend to do more tests on how an
increased damping affects the ZCD. To get sufficient ECD drive resolution I
have implemented a 3rd order multibit sigma/delta modulator driving a
12-bit ADC (with passive filtering and active buffering). The result of the
measured beat note period can be seen at
; peaking is shown to be limited.
With an active PLL the beat note spectrum became much narrower (compare
to
http://www.lartmaker.nl/time-nuts/DMTD%20self-noise%20input%20spectrum.pdf
). This made it possible to use a comb filter to suppress even-order
harmonics (before adding hardware notch filtering at the input).
The 1001-point FIR band pass filter is a good reference to get an idea of
the best case performance of the system, but it is computationally
infeasible to run on an 8-bit processor. While a cheap comb filter can take
a bite out of the HF noise, canceling offset/drift is harder. Early on I
was looking into ways to average all samples of a single period of the beat
note, but I had trouble finding a closed form solution to the fact that the
beat note period is never an exact integer multiple of the sampling rate.
Through numerical methods I did end up finding a good estimator for the
"leakthrough" caused by the fractional part of the beat note period (as a
function of the measured period and the phase offset), which was fairly
inexpensive to implement. This has yielded a combined "simple" signal
processing path of a differentiator, a double comb filter and the offset
estimator, which is getting very close in performance to the "ideal" band
pass filter (OADEV of 3.77e-13@tau=1s versus 3.25e-13@tau=1s for the BPF;
full plot:
for this 600000-second recording:
. OADEV past ~1000sec is severely compromised by the fact that the
measurement setup is in my home lab which sees temperature swings of up to
20 degrees C and which does get bumped from time to time. Longer runs in a
more controlled setting forthcoming).
In the radar world, the standard solution to the leakthrough problem is
to batch the data and apply a windowing function to the data in each
batch. Typically, the batches overlap such that every sample appears
in two batches. The window functions largely eliminate the splice
error due to the FFT, which is fact splices each batch into a circle,
causing a discontinuity at the splice. If the window function is very
small at the splice, there is little discontinuity power sprayed into
innocent FFT bins.
In radar, Taylor windows are used, as well as Dolph-Chebyshev if very
low sidelobes are needed.
.https://en.wikipedia.org/wiki/Window_function#Dolph%E2%80%93Chebyshev_window
Taylor is mentioned in the above D-C description, and a link is
provided.
Joe Gwinn
Re: time-nuts Digest, Vol 184, Issue 35
On Wed, 27 Nov 2019 12:00:02 -0500, time-nuts-request@lists.febo.com
wrote:
--------------------------------
>
> Message: 8
> Date: Wed, 27 Nov 2019 00:29:19 +0100
> From: Jan-Derk Bakker <jdbakker@gmail.com>
> To: Discussion of precise time and frequency measurement
> <time-nuts@lists.febo.com>
> Subject: Re: [time-nuts] A simple sampling DMTD
> Message-ID:
> <CAEoGJM=DwGUzAuTAAw13948HuAGdZo+YSxymozDnWD07G94Oiw@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> [This thread has started about three months ago; first post with design
> considerations is here:
> https://www.mail-archive.com/time-nuts@lists.febo.com/msg04265.html ]
>
> Dear all,
>
> In the past month I have managed to get the PLL working, and found a
> lightweight way to eliminate most if not all of the offset/drift.
>
> After the discussions with Attila and Bob I have expanded the PLL bandwidth
> to 0.5Hz (with a 10Hz PFD frequency I can't go very much higher). The
> damping factor is 0.7 for now; I intend to do more tests on how an
> increased damping affects the ZCD. To get sufficient ECD drive resolution I
> have implemented a 3rd order multibit sigma/delta modulator driving a
> 12-bit ADC (with passive filtering and active buffering). The result of the
> measured beat note period can be seen at
>
http://www.lartmaker.nl/time-nuts/PSD%20of%20measured%20ZCD%20period%20with%20PLL%20active.pdf
> ; peaking is shown to be limited.
>
> With an active PLL the beat note spectrum became much narrower (compare
>
http://www.lartmaker.nl/time-nuts/PSD%20of%20HP10811%20into%20the%20LTC2140%20with%20PLL%20active.pdf
> to
> http://www.lartmaker.nl/time-nuts/DMTD%20self-noise%20input%20spectrum.pdf
> ). This made it possible to use a comb filter to suppress even-order
> harmonics (before adding hardware notch filtering at the input).
>
> The 1001-point FIR band pass filter is a good reference to get an idea of
> the best case performance of the system, but it is computationally
> infeasible to run on an 8-bit processor. While a cheap comb filter can take
> a bite out of the HF noise, canceling offset/drift is harder. Early on I
> was looking into ways to average all samples of a single period of the beat
> note, but I had trouble finding a closed form solution to the fact that the
> beat note period is never an exact integer multiple of the sampling rate.
> Through numerical methods I did end up finding a good estimator for the
> "leakthrough" caused by the fractional part of the beat note period (as a
> function of the measured period and the phase offset), which was fairly
> inexpensive to implement. This has yielded a combined "simple" signal
> processing path of a differentiator, a double comb filter and the offset
> estimator, which is getting very close in performance to the "ideal" band
> pass filter (OADEV of 3.77e-13@tau=1s versus 3.25e-13@tau=1s for the BPF;
> full plot:
>
http://www.lartmaker.nl/time-nuts/DMTD%20self-noise%20OADEV%20with%20PLL%20and%20various%20filters.pdf
> for this 600000-second recording:
>
http://www.lartmaker.nl/time-nuts/600ksec%20run%20with%20PLL,%2010811%20through%20splitter.png
> . OADEV past ~1000sec is severely compromised by the fact that the
> measurement setup is in my home lab which sees temperature swings of up to
> 20 degrees C and which does get bumped from time to time. Longer runs in a
> more controlled setting forthcoming).
In the radar world, the standard solution to the leakthrough problem is
to batch the data and apply a windowing function to the data in each
batch. Typically, the batches overlap such that every sample appears
in two batches. The window functions largely eliminate the splice
error due to the FFT, which is fact splices each batch into a circle,
causing a discontinuity at the splice. If the window function is very
small at the splice, there is little discontinuity power sprayed into
innocent FFT bins.
In radar, Taylor windows are used, as well as Dolph-Chebyshev if very
low sidelobes are needed.
.<https://en.wikipedia.org/wiki/Window_function#Dolph%E2%80%93Chebyshev_window>
Taylor is mentioned in the above D-C description, and a link is
provided.
Joe Gwinn
GM
Gregory Maxwell
Wed, Nov 27, 2019 6:47 PM
in two batches. The window functions largely eliminate the splice
error due to the FFT, which is fact splices each batch into a circle,
causing a discontinuity at the splice. If the window function is very
small at the splice, there is little discontinuity power sprayed into
innocent FFT bins.
In radar, Taylor windows are used, as well as Dolph-Chebyshev if very
low sidelobes are needed.
Related to but distinct from low-sidelobe window functions are
sidelobeless windows, which I think may be particularly useful in
control-loop applications like PLLs.
The gaussian window is obviously sidelobeless, but it has infinite
support so it's not useful.
But it turns out that there exist finite windows that are completely
sidelobeless (a fourier transform of their kernel is monotone).
A triangular window convolved with a truncated gaussian window is
sidelobeless (with an appropriate choice in parameters), as is a
hann-poisson window.
While working on the problem of sinusodial modelling (
https://arxiv.org/abs/1602.05900 ), which is essentially the same
problem as PLL tracking tones in a noisy signal, I found sidelobeless
windows to work much better than even low sidelobe windows like
Dolph-Chebyshev ... but I never found a lot of coverage in the
literature.
On Wed, Nov 27, 2019 at 6:22 PM Joseph Gwinn <joegwinn@comcast.net> wrote:
> in two batches. The window functions largely eliminate the splice
> error due to the FFT, which is fact splices each batch into a circle,
> causing a discontinuity at the splice. If the window function is very
> small at the splice, there is little discontinuity power sprayed into
> innocent FFT bins.
>
> In radar, Taylor windows are used, as well as Dolph-Chebyshev if very
> low sidelobes are needed.
Related to but distinct from low-sidelobe window functions are
_sidelobeless_ windows, which I think may be particularly useful in
control-loop applications like PLLs.
The gaussian window is obviously sidelobeless, but it has infinite
support so it's not useful.
But it turns out that there exist finite windows that are completely
sidelobeless (a fourier transform of their kernel is monotone).
A triangular window convolved with a truncated gaussian window is
sidelobeless (with an appropriate choice in parameters), as is a
hann-poisson window.
While working on the problem of sinusodial modelling (
https://arxiv.org/abs/1602.05900 ), which is essentially the same
problem as PLL tracking tones in a noisy signal, I found sidelobeless
windows to work much better than even low sidelobe windows like
Dolph-Chebyshev ... but I never found a lot of coverage in the
literature.
J
jimlux
Wed, Nov 27, 2019 8:28 PM
On 11/27/19 9:48 AM, Joseph Gwinn wrote:
Message: 8
Date: Wed, 27 Nov 2019 00:29:19 +0100
From: Jan-Derk Bakker jdbakker@gmail.com
To: Discussion of precise time and frequency measurement
time-nuts@lists.febo.com
Subject: Re: [time-nuts] A simple sampling DMTD
Message-ID:
CAEoGJM=DwGUzAuTAAw13948HuAGdZo+YSxymozDnWD07G94Oiw@mail.gmail.com
Content-Type: text/plain; charset="UTF-8"
[This thread has started about three months ago; first post with design
considerations is here:
https://www.mail-archive.com/time-nuts@lists.febo.com/msg04265.html ]
Dear all,
In the past month I have managed to get the PLL working, and found a
lightweight way to eliminate most if not all of the offset/drift.
After the discussions with Attila and Bob I have expanded the PLL bandwidth
to 0.5Hz (with a 10Hz PFD frequency I can't go very much higher). The
damping factor is 0.7 for now; I intend to do more tests on how an
increased damping affects the ZCD. To get sufficient ECD drive resolution I
have implemented a 3rd order multibit sigma/delta modulator driving a
12-bit ADC (with passive filtering and active buffering). The result of the
measured beat note period can be seen at
; peaking is shown to be limited.
With an active PLL the beat note spectrum became much narrower (compare
to
http://www.lartmaker.nl/time-nuts/DMTD%20self-noise%20input%20spectrum.pdf
). This made it possible to use a comb filter to suppress even-order
harmonics (before adding hardware notch filtering at the input).
The 1001-point FIR band pass filter is a good reference to get an idea of
the best case performance of the system, but it is computationally
infeasible to run on an 8-bit processor. While a cheap comb filter can take
a bite out of the HF noise, canceling offset/drift is harder. Early on I
was looking into ways to average all samples of a single period of the beat
note, but I had trouble finding a closed form solution to the fact that the
beat note period is never an exact integer multiple of the sampling rate.
Through numerical methods I did end up finding a good estimator for the
"leakthrough" caused by the fractional part of the beat note period (as a
function of the measured period and the phase offset), which was fairly
inexpensive to implement. This has yielded a combined "simple" signal
processing path of a differentiator, a double comb filter and the offset
estimator, which is getting very close in performance to the "ideal" band
pass filter (OADEV of 3.77e-13@tau=1s versus 3.25e-13@tau=1s for the BPF;
full plot:
for this 600000-second recording:
. OADEV past ~1000sec is severely compromised by the fact that the
measurement setup is in my home lab which sees temperature swings of up to
20 degrees C and which does get bumped from time to time. Longer runs in a
more controlled setting forthcoming).
In the radar world, the standard solution to the leakthrough problem is
to batch the data and apply a windowing function to the data in each
batch. Typically, the batches overlap such that every sample appears
in two batches. The window functions largely eliminate the splice
error due to the FFT, which is fact splices each batch into a circle,
causing a discontinuity at the splice. If the window function is very
small at the splice, there is little discontinuity power sprayed into
innocent FFT bins.
In radar, Taylor windows are used, as well as Dolph-Chebyshev if very
low sidelobes are needed.
.https://en.wikipedia.org/wiki/Window_function#Dolph%E2%80%93Chebyshev_window
Taylor is mentioned in the above D-C description, and a link is
provided.
There are also some very nice low sidelobe, rectangular top, windows
like the Blackman-Harris, Nuttall, Solomon, etc.
Albrecht, 2001 has a collection of windows with max sidelobe levels more
than 200dB down.
fred harris has a great 32 page summary paper in the Jan 1978
Proceedings of IEEE which collects a bunch of the windows and their
properties. "On the use of windows for harmonic analysis with discrete
fourier transform" v66, #1, pp51-83
On 11/27/19 9:48 AM, Joseph Gwinn wrote:
> Re: time-nuts Digest, Vol 184, Issue 35
> On Wed, 27 Nov 2019 12:00:02 -0500, time-nuts-request@lists.febo.com
> wrote:
> --------------------------------
>>
>> Message: 8
>> Date: Wed, 27 Nov 2019 00:29:19 +0100
>> From: Jan-Derk Bakker <jdbakker@gmail.com>
>> To: Discussion of precise time and frequency measurement
>> <time-nuts@lists.febo.com>
>> Subject: Re: [time-nuts] A simple sampling DMTD
>> Message-ID:
>> <CAEoGJM=DwGUzAuTAAw13948HuAGdZo+YSxymozDnWD07G94Oiw@mail.gmail.com>
>> Content-Type: text/plain; charset="UTF-8"
>>
>> [This thread has started about three months ago; first post with design
>> considerations is here:
>> https://www.mail-archive.com/time-nuts@lists.febo.com/msg04265.html ]
>>
>> Dear all,
>>
>> In the past month I have managed to get the PLL working, and found a
>> lightweight way to eliminate most if not all of the offset/drift.
>>
>> After the discussions with Attila and Bob I have expanded the PLL bandwidth
>> to 0.5Hz (with a 10Hz PFD frequency I can't go very much higher). The
>> damping factor is 0.7 for now; I intend to do more tests on how an
>> increased damping affects the ZCD. To get sufficient ECD drive resolution I
>> have implemented a 3rd order multibit sigma/delta modulator driving a
>> 12-bit ADC (with passive filtering and active buffering). The result of the
>> measured beat note period can be seen at
>>
> http://www.lartmaker.nl/time-nuts/PSD%20of%20measured%20ZCD%20period%20with%20PLL%20active.pdf
>> ; peaking is shown to be limited.
>>
>> With an active PLL the beat note spectrum became much narrower (compare
>>
> http://www.lartmaker.nl/time-nuts/PSD%20of%20HP10811%20into%20the%20LTC2140%20with%20PLL%20active.pdf
>> to
>> http://www.lartmaker.nl/time-nuts/DMTD%20self-noise%20input%20spectrum.pdf
>> ). This made it possible to use a comb filter to suppress even-order
>> harmonics (before adding hardware notch filtering at the input).
>>
>> The 1001-point FIR band pass filter is a good reference to get an idea of
>> the best case performance of the system, but it is computationally
>> infeasible to run on an 8-bit processor. While a cheap comb filter can take
>> a bite out of the HF noise, canceling offset/drift is harder. Early on I
>> was looking into ways to average all samples of a single period of the beat
>> note, but I had trouble finding a closed form solution to the fact that the
>> beat note period is never an exact integer multiple of the sampling rate.
>> Through numerical methods I did end up finding a good estimator for the
>> "leakthrough" caused by the fractional part of the beat note period (as a
>> function of the measured period and the phase offset), which was fairly
>> inexpensive to implement. This has yielded a combined "simple" signal
>> processing path of a differentiator, a double comb filter and the offset
>> estimator, which is getting very close in performance to the "ideal" band
>> pass filter (OADEV of 3.77e-13@tau=1s versus 3.25e-13@tau=1s for the BPF;
>> full plot:
>>
> http://www.lartmaker.nl/time-nuts/DMTD%20self-noise%20OADEV%20with%20PLL%20and%20various%20filters.pdf
>> for this 600000-second recording:
>>
> http://www.lartmaker.nl/time-nuts/600ksec%20run%20with%20PLL,%2010811%20through%20splitter.png
>> . OADEV past ~1000sec is severely compromised by the fact that the
>> measurement setup is in my home lab which sees temperature swings of up to
>> 20 degrees C and which does get bumped from time to time. Longer runs in a
>> more controlled setting forthcoming).
>
> In the radar world, the standard solution to the leakthrough problem is
> to batch the data and apply a windowing function to the data in each
> batch. Typically, the batches overlap such that every sample appears
> in two batches. The window functions largely eliminate the splice
> error due to the FFT, which is fact splices each batch into a circle,
> causing a discontinuity at the splice. If the window function is very
> small at the splice, there is little discontinuity power sprayed into
> innocent FFT bins.
>
> In radar, Taylor windows are used, as well as Dolph-Chebyshev if very
> low sidelobes are needed.
>
> .<https://en.wikipedia.org/wiki/Window_function#Dolph%E2%80%93Chebyshev_window>
>
> Taylor is mentioned in the above D-C description, and a link is
> provided.
>
There are also some very nice low sidelobe, rectangular top, windows
like the Blackman-Harris, Nuttall, Solomon, etc.
Albrecht, 2001 has a collection of windows with max sidelobe levels more
than 200dB down.
fred harris has a great 32 page summary paper in the Jan 1978
Proceedings of IEEE which collects a bunch of the windows and their
properties. "On the use of windows for harmonic analysis with discrete
fourier transform" v66, #1, pp51-83
JB
Jan-Derk Bakker
Wed, Nov 27, 2019 10:46 PM
[snip]
The 1001-point FIR band pass filter is a good reference to get an idea of
the best case performance of the system, but it is computationally
infeasible to run on an 8-bit processor. While a cheap comb filter can
a bite out of the HF noise, canceling offset/drift is harder. Early on I
was looking into ways to average all samples of a single period of the
note, but I had trouble finding a closed form solution to the fact that
beat note period is never an exact integer multiple of the sampling rate.
Through numerical methods I did end up finding a good estimator for the
"leakthrough" caused by the fractional part of the beat note period (as a
function of the measured period and the phase offset), which was fairly
inexpensive to implement. [snip]
In the radar world, the standard solution to the leakthrough problem is
to batch the data and apply a windowing function to the data in each
batch. Typically, the batches overlap such that every sample appears
in two batches. The window functions largely eliminate the splice
error due to the FFT, which is fact splices each batch into a circle,
causing a discontinuity at the splice. If the window function is very
small at the splice, there is little discontinuity power sprayed into
innocent FFT bins.
This is an interesting approach, and one which hadn't occurred to me while
I was working on the offset/drift cancellation. After some consideration I
am afraid it will not help much in this particular case.
What I want is to filter out as much DC/LF energy before running the zero
crossing detector (ZCD) on the rising edge of the sampled sine wave. To do
this right now I also run the ZCD on falling edges, and I remember the
(sub)sample position of the current and previous falling edges. I then
average a full nominal period of the sine wave between these two falling
edges(200 samples at 10Hz beat frequency and 2ksps after the first sinc^2
filter/decimator), to determine the offset at the rising edge in between.
This is indeed mathematically equivalent to calculating bin 0 of a forward
Fourier transform with a rectangular window. Because the actual period is
not an exact integer number of samples, in practice this bin is
contaminated by spectral leakage. Windowing would help here, if it weren't
for the fact that all of my wanted signal energy is in bin 1. As any
windowing function other than the rectangular window trades side-lobe
suppression for main lobe width, the cure would likely be worse than the
disease. This could be ameliorated by averaging over multiple periods
(increasing the transform length), but that would necessarily spread the LF
noise energy over multiple bins, again making it all but impossible to get
optimal rejection.
What I've done instead is make an estimator for the leakage. For a period
of 200 +/- 1 sample, the following has an estimator error of better than
-40dB:
alpha = 0.5*perOffset^2 + (1.5 - phase)*perOffset - phase
correction = (1-alpha) * pointN + alpha * pointN1
where
correction is the estimator (in sample values)
perOffset is the difference between the measured period (199...201
samples) and the nominal period (200 samples)
phase is the estimated starting phase of the averaging interval, in
fractional samples (range: [0,1>)
pointN is the value of the sample immediately after the averaging
interval (ie sample[200], when the averaging interval is
sum(sample[0]...sample[199])
pointN1 is the value of the second sample after the averaging interval
(ie sample[201]).
This works very well, both on simulated and actual data. I am embarrassed
to admit that I cannot explain why it must be this particular formula
(and I'm very open to get hints here).
Sincerely,
JD 'if you can't do the math, run simulations and do curve fits until it
works' B.
Dear Joe,
On Wed, Nov 27, 2019 at 7:22 PM Joseph Gwinn <joegwinn@comcast.net> wrote:
> > [snip]
> > The 1001-point FIR band pass filter is a good reference to get an idea of
> > the best case performance of the system, but it is computationally
> > infeasible to run on an 8-bit processor. While a cheap comb filter can
> take
> > a bite out of the HF noise, canceling offset/drift is harder. Early on I
> > was looking into ways to average all samples of a single period of the
> beat
> > note, but I had trouble finding a closed form solution to the fact that
> the
> > beat note period is never an exact integer multiple of the sampling rate.
> > Through numerical methods I did end up finding a good estimator for the
> > "leakthrough" caused by the fractional part of the beat note period (as a
> > function of the measured period and the phase offset), which was fairly
> > inexpensive to implement. [snip]
>
> In the radar world, the standard solution to the leakthrough problem is
> to batch the data and apply a windowing function to the data in each
> batch. Typically, the batches overlap such that every sample appears
> in two batches. The window functions largely eliminate the splice
> error due to the FFT, which is fact splices each batch into a circle,
> causing a discontinuity at the splice. If the window function is very
> small at the splice, there is little discontinuity power sprayed into
> innocent FFT bins.
>
This is an interesting approach, and one which hadn't occurred to me while
I was working on the offset/drift cancellation. After some consideration I
am afraid it will not help much in this particular case.
What I want is to filter out as much DC/LF energy before running the zero
crossing detector (ZCD) on the rising edge of the sampled sine wave. To do
this right now I also run the ZCD on falling edges, and I remember the
(sub)sample position of the current and previous falling edges. I then
average a full nominal period of the sine wave between these two falling
edges(200 samples at 10Hz beat frequency and 2ksps after the first sinc^2
filter/decimator), to determine the offset at the rising edge in between.
This is indeed mathematically equivalent to calculating bin 0 of a forward
Fourier transform with a rectangular window. Because the actual period is
not an exact integer number of samples, in practice this bin is
contaminated by spectral leakage. Windowing would help here, if it weren't
for the fact that all of my wanted signal energy is in bin 1. As any
windowing function other than the rectangular window trades side-lobe
suppression for main lobe width, the cure would likely be worse than the
disease. This could be ameliorated by averaging over multiple periods
(increasing the transform length), but that would necessarily spread the LF
noise energy over multiple bins, again making it all but impossible to get
optimal rejection.
What I've done instead is make an estimator for the leakage. For a period
of 200 +/- 1 sample, the following has an estimator error of better than
-40dB:
alpha = 0.5*perOffset^2 + (1.5 - phase)*perOffset - phase
correction = (1-alpha) * pointN + alpha * pointN1
where
correction is the estimator (in sample values)
perOffset is the difference between the measured period (199...201
samples) and the nominal period (200 samples)
phase is the estimated starting phase of the averaging interval, in
fractional samples (range: [0,1>)
pointN is the value of the sample immediately after the averaging
interval (ie sample[200], when the averaging interval is
sum(sample[0]...sample[199])
pointN1 is the value of the second sample after the averaging interval
(ie sample[201]).
This works very well, both on simulated and actual data. I am embarrassed
to admit that I cannot explain *why* it must be this particular formula
(and I'm very open to get hints here).
Sincerely,
JD 'if you can't do the math, run simulations and do curve fits until it
works' B.