Matthias,

On 2022-05-02 17:12, Matthias Welwarsky wrote:
Dear all,

I'm trying to come up with a reasonably simple model for an OCXO that I can
parametrize to experiment with a GPSDO simulator. For now I have the following
matlab function that "somewhat" does what I think is reasonable, but I would
like a reality check.

This is the matlab code:

function [phase] = synth_osc(samples,da,wn,fn)
# aging
phase = (((1:samples)/86400).^2)*da;
# white noise
phase += (rand(1,samples)-0.5)*wn;
# flicker noise
phase += cumsum(rand(1,samples)-0.5)*fn;
end

There are three components in the model, aging, white noise and flicker noise,
with everything expressed in fractions of seconds.

The first term basically creates a base vector that has a quadratic aging
function. It can be parametrized e.g. from an OCXO datasheet, daily aging
given in s/s per day.

The second term models white noise. It's just a random number scaled to the
desired 1-second uncertainty.

The third term is supposed to model flicker noise. It's basically a random
walk scaled to the desired magnitude.

What you have shown is 2 out of the standard 5 noise-types. The Leeson model describes how 4 noise-types can be generated, but in addition to that the Random Walk Frequency Modulation is included. For standard, see IEEE Std 1139. For Leeson model, see David Leeson articles from special issue of Feb 1966, as I believe you can find on IEEE UFFC site. The Wikipedia Allan Deviation article may also be of some guidance.

Noise-types:

White Phase Modulation - your thermal noise on phase

Flicker Phase Modulation - your 1/f flicker noise on phase

Because we have oscillators that integrate inside the resonators bandwidth, we also get their integrated equivalents

White Frequency Modulation - your thermal noise on frequency - forms a Random Walk Phase Modulation

Flicker Frequency Modulation - Your 1/f flicker noise on frequency

Random Walk Frequency Modulation - Observed on disturbed oscillators, a random walk in frequency, mostly analyzed for finding rare faults.

You have only modelled the first two. This may or may not be relevant depending on the bandwidth of your control loop and the dominant noise there. It may not be relevant. The phase-noise graph will illustrate well where the power of the various noise-types intercept and thus provide a range over frequency for which one or the other is dominant. You control loop bandwidth will high-pass filter this for your locked oscillator, and low-pass filter for your reference oscillator/source. The end result will be a composit of both. The Q-value / damping factor will control just how much jitter peaking occurrs at the cut-over frequency, and the basic recommendation is to keep it well damped at all times.

The ADEV variant of this is similar.

Now, to simulate flicker you have a basic problem, whatever processing you do will end up needing the full time of your simulation data to maintain the slope. You can naturally cheat and do a much reduced setup that only provides the 1/f slope of PSD at and about the area where it dominates. Notice that this can occurr both for the FPM and FFM cases. Also notice that if we respect the model, these should be completely independent.

Simulation wise, you can turn WPM into WFM by integration, and FPM into FFM by integration. Similarly the WFM becomes RWFM through a second integration. Just source each of these independent to respect the model.

The Leeson model for an oscillator does not have these fully independent, but for most uses, simulate fully independent, and you will not make more fool of yourself than anyone else usually does, present company included.

As you see, flicker and random-walk is not the same thing. Often "random walk" implies Random Walk Frequency Modulation.

Another thing. I think the rand function you use will give you a normal distribution rather than one being Gaussian or at least pseudo-Gaussian. A very quick-and-dirty trick to get pseudo-Gaussian noise is to take 12 normal distribution random numbers, subtract them pair-wise and then add the six pairs. The subtraction removes any bias. The 12 samples will create a normalized deviation of 1.0, but the peak-to-peak limit is limited to be within +/- 12, so it may not be relevant for all noise simultations. Another approach is that of Box-Jenkins that creates much better shape, but comes at some cost in basic processing.

As an example, the following function call would create a phase vector for a
10MHz oscillator with one day worth of samples, with an aging of about 5
Millihertz per day, 10ps/s white noise and 10ns/s of flicker noise:

phase = osc_synth(86400, -44e-6, 10e-12, 10e-9);

What I'd like to know - is that a "reasonable" model or is it just too far off
of reality to be useful? What could be changed or improved?

As I've stated above, I think it misses key noise-types. I really wonder if the flicker noise model you have is producing real flicker noise.

Using Bob's suggestion of using real data is not bad, noise simulation is hard and a research field in itself. My quick and dirty methods get you started at relatively low cost, except for flicker, flicker always hurt.

Cheers,
Magnus
_______________________________________________
time-nuts mailing list -- time-nuts@lists.febo.com -- To unsubscribe send an 
email to time-nuts-le...@lists.febo.com
To unsubscribe, go to and follow the instructions there.

Reply via email to