Standard two-tone (700 and 1900 Hz) .wav file for testing of SSB transceivers and linear amplifiers

The mesure of linearity of SSB transceivers and linear amplifiers often requires a standard two-tone (700 and 1900 Hz) audio source. Linearity impacts both SSB fidelity and the amount of SSB splatter that causes adjacent channel interference.

Specilialized hardware can be built or purchased to generate this signal. However, here is a Scilab program that generates a .wav sound file with a standard two-tone that can be played on devices often readily available in a ham shack.

If you are only interested in the resulting .wav file, here it is.

  • Two-tone test of SSB transmitter output video
Click to enlarge
//////////////////////////////////////////////////////////////////////////////
//
// Two-Tone Test Oscillator
//
// Generate a standard two-tone (700 and 1900 Hz) .wav file for testing of
// SSB transceivers and linear amplifiers.
//
// This type of testing is almost universally used as a measure of transmitter
// linearity for amateur radio equipment. Linearity impacts both SSB fidelity
// and the amount of SSB splatter that causes adjacent channel interference.
//
//                  Copyright (C) 2012 Christophe DAVID (ON6ZQ)
//                    http://www.on6zq.be/Scilab/TwoToneTest
//
//  This program is free software; you  can redistribute it and/or modify it
//  under the terms of the GNU General Public License version 2 as published
//  by the Free Software Foundation (http://www.gnu.org/licenses/gpl.html).
//
//////////////////////////////////////////////////////////////////////////////
//
//                This program was last tested with Scilab 5.5
//                            http://www.scilab.org
//
//////////////////////////////////////////////////////////////////////////////

// A semicolon at the end of an instruction causes the result not to be displayed.

errclear;         // clear all errors
clear;            // kill variables
clearglobal       // kill global variables
clc;              // clear command window
tohome;           // move the cursor to the upper left corner of the Command Window
clf;              // clear or reset the current graphic figure (window) to default values

// stacksize('max'); // increase the size of this stack to the maximum.
stacksize(1e8);   //stacksize('max') does not appear to work on my system ;-(

//////////////////////////////////////////////////////////////////////////////

OutputFileName = '/home/cda/test/TwoToneTest.wav';
SoundDuration  =    30; // seconds
Tone1Frequency =   700; // hertz
Tone2Frequency =  1900; // hertz
SamplingRate   = 22500; // samples per second
BitDepth       =    16; // 8, 16, 24, 32 bits. number of bits each sample

//////////////////////////////////////////////////////////////////////////////

// create a matrix to contain the sound data, and initialize it with values
// from 0 to the total number of needed samples

M = 0 : 1 : (SamplingRate * SoundDuration) - 1;

printf("The matrix M has %d row(s) and %d column(s)", size(M, 'r'), size(M, 'c'))
plot(M, 'r');
legend(['M']);

input('Check the graphic window then press enter to continue.')
clf;          // clear or reset the current graphic figure (window) to default values

M1 = sind((M / SamplingRate) * Tone1Frequency * 360);
M2 = sind((M / SamplingRate) * Tone2Frequency * 360);
MT = M1 + M2;

plot(M1(1:1, 1:500), 'g');
plot(M2(1:1, 1:500), 'r');
plot(MT(1:1, 1:500), 'b');
legend(['M1';'M2';'MT']);

input('Check the graphic window then press enter to continue.')
clf;          // clear or reset the current graphic figure (window) to default values

analyze(MT, 300, 3000, SamplingRate, 8192);

// wavwrite expects values in the range [-1,1]
MT = MT / 2;

// wavwrite expects data arranged with one channel per column
wavwrite(MT', SamplingRate, BitDepth, OutputFileName)

printf('The Two-Tone Test file %s should be created by now.', OutputFileName)

//////////////////////////////////////////////////////////////////////////////