In 2010-04-16, the phase- and amplitude monitor (short: PAM) was added as an interpreter
function in Spectrum Lab. There may be multiple instances ("incarnations")
of this function running simultaneously, if CPU power and sampling rate permit.
The intended purpose of this function was to observe the fieldstrength and
phase variations of VLF transmitters for ionospheric studies, by plotting
amplitudes and phases of different transmitters in Spectrum Lab's
watch window / plotter . From
there, the data can also be exported in text files (for further post-processing).
Note: Long-term absolute phase measurements with a soundcard are only possible
if the soundcard's sampling rate is permanently monitored and corrected (drift
compensated) as explained here.
A GPS receiver with sync pulse output,
connected to the second channel of the soundcard, is the preferred method.
Together with the option
'Phases locked to GPS',
it even allows absolute phase measurements (which means the time the measurement starts
is not important, because the PAM's reference phase starts at zero 00:00:00 (midnight) GPS time.
Frequencies which are not an integer multiple of 1 / (24 hours) will result in a phase glitch at
midnight, but in most cases that's not a problem.
Basic syntax of the pam function (simple, without specifying the update interval
and signal source) :
returns the momentary carrier phase in degrees (! - not radians
- !) .
Phase measurement arbitrarily starts at 0° (zero degrees); depending
on the algorithm, the result may not be limited to +/- 180 .
The center frequency is usually specified as a 'baseband' frequency, ranging from
0 to half the sampling rate for real input or +/- half the sampling rate
for complex input (e.g. I/Q output from an SDR). By prefixing the frequency value
with 'rf:', you tell the interpreter that this is a 'radio frequency', and the 'NCO'- or 'VFO'-
frequency will be subtracted. Example:
With an external receiver or SDR tuned to 77000 Hz in USB (upper sideband),
pam1( 500, CW).phase would measure the phase on 500 Hz (baseband or 'audio' frequency);
pam1( rf:77500, CW).phase would measure the phase of a 77500 Hz 'radio' frequency signal;
with the same result because in the 2nd example, the pam-functions would subtract 77000 Hz
from the 'radio' center frequency, resulting in the same baseband center frequency.
The 'RF' offset (77000 Hz 'USB dial') is entered in SL's VFO frequency input field.
returns the momentary carrier phase in degrees, limited (wrapping around) to "one
circle" (result in range -180° ... +180°; if the phase increments
monotonously the plotted graph appears like a sawtooth) .
Similar as above, but the 'wrapping' range is two circles (revolutions),
thus the result ranges from -360° ... +360° .
Larger phase-range limits (phase(3)..phase(10)) are possible, but rarely used for plotting.
Returns an 'absolute' carrier phase, by emulating a local oscillator with reference phase
'zero' at 00:00:00 ("midnight UTC"). This may causes a phase jump once per day, but
when used together with a GPS (to measure the soundcard's sampling rate and provide
accurate timestamps), the value returned by pam.abs_phase does not suffer from 'steps'
if samples from the A/D converter are lost.
Due to the lack of an integrator ('accumulator'), pamN.abs_phase(1) will even return the
same value after quitting and re-starting Spectrum Lab (in contrast to pam.phase).
For long-term phase monitoring, if a GPS reference is available, this 'absolute phase monitor'
operates more reliable than the older ("accumulating") phase monitoring functions.
The value returned by pam.abs_phase ranges from -180° to +180°.
returns the amplitude, converted to dBfs (dB "over" full scale, thus always
a negative value)
returns the precisely measured frequency in Hz . Ideally the same as the
configured center frequency (can be used as an additional "health check").
returns the current value in the i-th frequency bin of the amplitude spectrum
of the squared narrow-band (baseband) signal for MSK phase observations. Phew.
Only used for software testing (an MSK signal should have two peaks in this array,
as explained in frqcalib.htm#MSK_signals .
In the above functions, ...
N = instance number of the phase/amplitude monitor, running from 0
(zero; default when omitted) to 9;
<f_center> = center frequency in Hertz; must be very
precise for long-term phase measurements
<modulation> : Either CW (continuous wave), followed by the filter
bandwidth in Hz; or MSK (minimum shift keying), followed by the bitrate,
like "MSK200" = MSK with 200 bits per second (a common value for many VLF
broadcasters like DHO38 ).
Extended syntax, with center frequency, modulation, update interval, and
N = instance number of the phase/amplitude monitor, running from 0 (zero;
default when omitted) to 9;
<update_interval> = update interval in seconds. Default (if not specified)
= 10 seconds .
<signal_source> = symbolic name of the source node, as shown in the
circuit diagram, for example:
L1 = left input from the soundcard;
R1 = left input from the soundcard;
L1R1 = complex signal from a software
defined radio. L1=In-phase component aka "real" part, R1=Quadrature component
aka imaginary part of a complex signal.
(Note: for complex input, only the combinations L1R1, L2R2, L3R3, L4R4, or
L5R5 are possible)
xyz : phase, ampl, etc (see basic syntax above)
returns the relative field strength of a VLF transmitter on 23.4 kHz in dB
"over full scale", using the default update interval (10 seconds), and the
default signal source ("L1").
returns the phase (in degrees) of the same signal, beginning at zero when
the measurement started.
Note that, since the program already knows the center frequency, and the
modulation / bandwidth from the previous call (1st example), it is not necessary
to specify those parameters in the argument list again (though it wouldn't
hurt to do so).
pam2(77500, CW1, 10, L1R1).phase
returns the phase (in degrees) of a continous
wave(*) signal on 77.5 kHz, observed
bandwidth 1 Hz, update cycle 10 seconds (which, by the way, also dictates
the resolution), for a complex signal tapped at L1 (for the inphase component)
and R1 (for the quadrature component). Actually, this function was used in
a test to examine the stability of the oscillator in a software defined radio,
using the German 'DCF77' longwave time signal transmitter as a reference.
pam2(77500, CW1, 10, L1).phase
Almost the same as above, but here a soundcard running at 192 kSamples/second
was used for the test.
Note: A list of VLF transmitters is in the control panel for the continuous
sample rate correction; typically one of those VLF transmitters is used as
the reference (to correct the sample rate drift). Of course, if a VLF transmitter
is used as the frequency reference, it makes no sense to measure the diurnal
phase variation of that transmitter ! More on that in the chapter titled
'Requirements for long-term phase measurements'
(*) In this context, CW really means what it says - Continous Wave. Don't
confuse "CW" with "Morse code" ! Morse code traditionally uses on-off-keying,
which is neither a 'continuous wave' in the long run, nor is it necessarily
phase coherent. Thus the phase- and amplitude monitors are pretty useless
to observe classic 'Morse' signals (on-off keying). The carrier phase of
transmitters like DCF77 can be be observed with the pam() function because
despite the amplitude modulation (75 % carrier reduction), the carrier phase
is coherent, i.e. the carrier phase doesn't jump"arbitrarily.
The basic function of a phase meter (as implemented here) is this:
Multiply the incoming signal with a local oscillator, here: a numerical
controlled oscillator with two outputs (90°)
Low-pass filter and decimate the mixed signal until the required (low) bandwidth
If the signal is MSK (minimum shift keying, as most VLF
transmitters), square the decimated signal, and examine the 'peaks' in the
spectrum at f_center +/- bitrate.
The same principle is also used in the
continuous sampling rate
Calculate the amplitude and the phase angle of the decimated signal (for
MSK: Angle of the recovered carrier signal).
There is at least one example configuration in Spectrum Lab's
configurations folder (file: PAM_MSK_Test1.usr) which uses the phase-
and amplitude monitors to plot the phase of an MSK transmitter on VLF. The
results of the pam-functions are shown in numeric form in the
watch window, or in graphic form in
the plot window .
See also: Cursor readout functions in the 'plot window'. Together with the interactive
gradient measurement, a phase plot can be used for a precise frequency offset measurement (faster than a sufficiently 'long FFT' would permit).
This turned out to be a nice tool to check the stability (long- and short-term drift) of crystal oscillators.
Requirements for long-term phase measurements
Usually, the 'reference' clock is the soundcard's internal sample rate. It
must be accurately set. Spectrum Lab offers two different ways to "calibrate"
the sample rate. For long-term phase observations, you will need the
"continuous" sample rate correction. It is possible
to use any reference frequency which can be handled by the
soundcard, for example:
- As already mentioned, a GPS receiver
with sync pulse output, connected to the second channel of the soundcard,
is the preferred method.
- In western Europe, DCF77 (on 77.5 kHz) or MSF (on 60 kHz) could be used
as a reference (when within groundwave range) to observe the diurnal phase
variations (ionospheric effects) of several VLF broadcasters.
- A list of other reference
signals can be found in the document about the sample rate detector.
See also: Watch / Plot window;
sample rate correction;
Spectrum Lab overview .