#### Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

•  Subject
• Author
• Posted on
the following.

I created the SPICE simulation for a common collector
Colpitts oscillator. The target oscillation frequency is
500.0 MHz, and I am using the HFA3134 RF/microwave NPN
transistor, with a Ft of 8 GHz. When the raw transient
analysis data is plotted and the resolution adjusted to
clearly see individual oscillations, the waveform looks
approximately like a sine wave - 'approximately' as the
top peak of each oscillation looks a bit distorted. Using
the cursor feature of the plotting tool, the oscillation
frequency is estimated as 507 MHz. So far so good. The
transient analysis sampling interval is 25 picoseconds.

I have creted a aimple C program to compute the Discrete
Fourier Transform of a given time dependent signal, based
on sample code in Numerical Recipes in C. To test the
DFT code, I created a 450 MHz sample signal, and from the
generated power spectrum of this test signal, the main peak
is at 453 MHz. This gives me confidence that the DFT code
is working fine.

Now the interesting part. When the transient analysis data
from the above Colpitts oscillator(target oscillation
frequency 400 MHz) the highest signal peak(excluding the
0 frequency DC value) is at 1.16 GHz, which is approximately
double the signal frequency obtained by plotting the transient analysis data - please see above.

So does this mean that most of the oscillator signal energy
is concentrated at double the design oscillation frequency ?
All ideas/suggestions are welcome. Thanks in advance.

On Wednesday, 14 November 2018 06:58:32 UTC, snipped-for-privacy@gmail.com  wrote:

If the signal looks like like a slightly clipped 453MHz sine wave, most of the energy is at 453MHz, much less energy at twice that. I'm sure you can visualise what it would look like if he 2 frequencies had equal energy.

NT

On 14/11/2018 06:58, snipped-for-privacy@gmail.com wrote:

I'd be happier if it gave 450 MHz. Try feeding it a square wave at least
that way you can recognise all the harmonic components easily.

I suspect what you are seeing is some 3rd harmonic distortion from the
clipping of the sine waveform at nominally 400MHz x3 = 1.2GHz.

You might find it enlightening to display your raw waveform with a
perfect sine wave of the fundamental frequency subtracted from it.

--
Regards,
Martin Brown

On Tue, 13 Nov 2018 22:58:27 -0800 (PST), snipped-for-privacy@gmail.com wrote:

If it looks anything like a sine wave, the FT should show a big spike
at the obvious frequency. Maybe a bug in the FT code?

LT Spice does FFTs for you.

--

John Larkin         Highland Technology, Inc

lunatic fringe electronics

On 15/11/18 12:37 am, John Larkin wrote:

The first thing I look at in an oscillator simulation is the FFT.

Perhaps the OP can explain why that's not good enough?

Clifford Heath.

On Thu, 15 Nov 2018 08:45:37 +1100, Clifford Heath

LT Spice doesn't simulate oscillators very well in time domain.

At the default settings, it doesn't simulate a sine wave generator
very well.

--

John Larkin         Highland Technology, Inc

lunatic fringe electronics

On Thursday, November 15, 2018 at 1:09:10 PM UTC+11, John Larkin wrote:

is data - please see above.

Works fine for me.

I wonder how John Larkin has managed to mangle his default settings.

Class C oscillators do depend on turning a single transistor on briefly, on
ce per cycle, and the Gummmel-Poon model for transistors (which is what LTS
pice mostly runs - if you could get the parameters for VBIC model you could
run that but I've never been able to) isn't great in the relevant region.

My variant of the Wien Bridge simulates fine, but gains stay more or less t
he same all the way through the cycle.

--
Bill Sloman, Sydney

On Wednesday, November 14, 2018 at 4:45:41 PM UTC-5, Clifford Heath wrote:

I totally agree with you that FT is the best way to analyze the oscillator output. The output for the
450 MHz test signal with a 0.1 nano second sampling interval is:
./fftnew test450MHzsignal out1 0.1
50003.000000    1.000000e-10    1.999880e+05
start FT real - imag value calculation
end FT calculation
search peaks and frequencies start
search peaks and frequencies end
3 highest frequencies and peaks
4.501730e+08 Hz    82429.969444
4.701718e+08 Hz    253.629068
4.901706e+08 Hz    134.808409
number of data rows read in 50003

Clearly the magnitude of the 450 MHz signal is huge
compared to the others, and the program therefore correctly  identified the frequency of the test signal.

On 23/11/18 11:05 pm, snipped-for-privacy@gmail.com wrote:

Right, but that's immediately visible in the LTSpice FFT spectrum
display. There was no need to write your own program.

On Friday, November 23, 2018 at 4:57:15 PM UTC-5, Clifford Heath wrote:

Well, I use HSpice at work, and Ngspice at home, both of which use a test file input netlist.

The C language FT code is a straightforward application
of the transform, and does any features such as radix 2
etc., Over the years I have learned the hard way that
often writing one's own code gives very tight control
over the problem at hand and avoids bothersome moments
like sitting in front of the terminal, staring at some strange results and wondering what could be going wrong.

On Sat, 24 Nov 2018 08:57:10 +1100, Clifford Heath

If you sim an oscillator in time domain, you can look at the waveform
and see the frequency. Cursor a full cycle or so and LT Spice will
show the period and its reciprocal. If your private FFT shows a
different frequency, it's wrong.

If phase noise matters, it's a pain to sim a high-Q oscillator in time
domain. You need a tiny dT and many, many cycles to get to
steady-state and have a good FFT. Crystal oscillators are really hard
to sim in time domain. It's better to analyze in frequency domain, to
maximize loop gain/freq slope, but then that misses the
amplitude-limiting nonlinearities.

--

John Larkin         Highland Technology, Inc

lunatic fringe electronics

On Sunday, November 25, 2018 at 2:06:45 PM UTC-5, John Larkin wrote:

Yes, crystal oscillators are notoriously difficult to
simulate, but there is the 'kick start" method, which,
although brute force always works(as expected). It consists of a damped high amplitude(e.g., 750 V) sine
wave signal placed in between the series capacitor
and inductor of the RLC leg of the crystal. I have used
it with HSpice at work a few years ago to analyze a 60
MHz crystal oscillator. HSpice also supports advanced
tools as Periodic Steady State, Harmonic Balance, Periodic AC etc., All SPICE queries that post on this newsgroup
are related solely to my work at home using Ngspice.
damped

On Mon, 26 Nov 2018 23:06:54 -0800 (PST), snipped-for-privacy@gmail.com wrote:

You can set the initial conditions inside the crystal model so that it
starts at full swing. Zoom the peaks to see if the amplitude is
constant, and tweak a little. But you still need a tiny time step to

HP made a digital delay generator that kick-started an XO when an
external trigger arrived. It was ugly.

Our DDGs kick start an LC oscillator at trigger time, which is much
easier. That simulates well enough.

--

John Larkin         Highland Technology, Inc

lunatic fringe electronics

On 11/27/18 2:06 AM, snipped-for-privacy@gmail.com wrote:

Switched DC on the crystal capacitance works too.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
We've slightly trimmed the long signature. Click to see the full one.
On Wednesday, November 14, 2018 at 8:38:07 AM UTC-5, John Larkin wrote:

The following is the output from the FFT program with the 450 MHz test signal and 0.1 nanosecond signal sampling time. 'out1' is the text file in which it dumps the power spectrum.
./fftnew test450MHzsignal out1 0.1
50003.000000    1.000000e-10    1.999880e+05
start FT real - imag value calculation
end FT calculation
search peaks and frequencies start
search peaks and frequencies end
3 highest frequencies and peaks
4.501730e+08 Hz    82429.969444
4.701718e+08 Hz    253.629068
4.901706e+08 Hz    134.808409
number of data rows read in 50003

Clearly, the 450 MHz peak is huge compared to the others.