Daqarta for DOS Contents



Free Registration

Contact Us
Daqarta for DOS
Data AcQuisition And Real-Time Analysis
Shareware for Legacy Systems
(Use Daqarta for Windows with modern systems)

From the Daqarta for DOS Help system:

Arb (Arbitrary) Wave:

Arbitrary waveforms allow you to simply load a file to obtain any custom waveform you desire. These files are analogous to the wavetables used for music synthesis. Each typically holds exactly one cycle of the desired waveform. The Arb Wave submenu allows up to 8 Arb files to be loaded at one time. These files are available to any component page of either DAC, and more than one page can use the same file simultaneously but completely independently.

Arb Files 0-7:

By default, the 8 Arb file locations show as simply Arb 0 through Arb 7 when Arb files are not loaded. To load a file to a particular location, move the cursor to that spot and hit ENTER. You will be prompted for the name of the file to load.

Arb files may hold 1024, 2048, 4096, or 8192 samples. If you load a file of a different size, it will be truncated to fit the largest of these. Files shorter than 1024 samples are not accepted.

Files may be either ordinary .WAV files (which includes Daqarta DDisk files), or Daqarta instantaneous or averaged waveform files. Note that these latter would need to be from N1024 mode. Array files or averaged spectra are not allowed. You may also use custom user-created .DAT files. A .DAT file is simply a series of 16-bit signed integer values in 2s-complement binary format. A special TXT2DAT utility is provided to allow conversion of plain text files to this format.

The .WAV files may be mono or stereo. If you load a stereo file, it will appear in two adjacent Arb locations. The .WAV files may be either 8-bit or 16-bit. 8-bit files will be converted to 16-bit data internally when loaded.

The actual file extensions are not important here; the loader first looks for the .WAV header, and if that is not present the file is assumed to be a .DAT file. There is no .DAT header, so all non-WAV files are assumed to be 16-bit mono. You can thus use whatever file extensions suit your needs.

Once the file is loaded, the menu location will change to show the first 7 characters of the file name instead of the Arb 0-7 default. If you load a mono file, the name will appear in all upper-case characters. If you load a stereo file, the top entry (left channel) will be upper-case, and the next (right channel) will be lower-case.

When a file is loaded, it does not become active (shown highlighted in inverse video) until you select it. Note that the loading process enters Pause mode, so you will need to unPause before you can select the file.

Arb files load into DOS memory below 640K. They share this area not only with the Daqarta program and modules, but also with special tables used by any Noise Band sources which are active.

You may delete a file to make room for another or to free up memory for more or larger Noise Band tables. To do this, that Arb must not be active. Hit ALT-ENTER with the cursor there, and you will be prompted to '(R)eplace, (D)elete, or ESC ?'.

An Arb file is assumed to hold exactly one cycle of the Arb waveform. If it contains an integer number of cycles the overall operation will be the same, but the Freq and Phase controls will be off by that same factor since a single cycle is assumed. Even more important, the resolution is reduced needlessly since there are less points per actual cycle at the output.

You can use STIM3A to create 1024-point Arb files. The best way to do that is to use the DEMO.ADC driver, which allows the STIM3A data to be treated like real-world ADC data. Make sure you have set N1024, then set the StepN step size to 1.0000 and watch the waveform as you reduce the Freq setting. Since this StepN mode will only allow an integer number of cycles per 1024 samples, it will be easy to see when you have just one. Then just save it with OutDt.

Of course, there is not much point in saving one of the standard Wave types as an Arb file. In addition to being redundant, such a 1024-sample file would not have the resolution of the native Wave types, which is equivalent to 8192 samples per cycle. But you might want to build up a composite waveform made from summing several different native Wave types, allowing faster operation and/or freeing up component pages for other uses.

You can use modulation in creating your Arb file, but you need to insure that the modulator also completes a single cycle (or an integer number) in 1024 samples. Frequency sweeps are possible as well, but these can be difficult to align so that the start and end splice properly when used as a single cycle. Often, you will be better off using a Play file instead.

Instead of recording the STIM3A output using DEMO.ADC, you might want to use a real sound card or acquisition board to record the RESPONSE of some system to a stimulus. This assumes that the response tracks the stimulus such that it completes one cycle when the stimulus does. The relative phase doesn't matter, since as long as it's exactly one cycle there shouldn't be a splice problem on playback.

Data (Interp / Round / Step):

This control is at the bottom of the Arb menu. Normally, you will want to leave it in Interp mode. This means that STIM3A will interpolate between Arb file values to find the proper output value at any given instant of time, just as the normal internal Wave types do. That's especially important if you only have 1024 points in the Arb file.

But sometimes you don't really want that, but instead want to have the output go only to the nearest value from the file. That's what Round does. This might be needed, for instance, if the Arb output is used as a test cycle controller for some external system (usually with Freq set to a low value). The test might require only specific output values, so you just build a list of them and convert it to a .DAT file with the TXT2DAT utility.

The Step mode is an even more powerful extension of this concept, since instead of the Freq control it uses the Timing menu. This allows you to step very slowly through the Arb file, holding each value for a fixed time which is a selected multiple of up to 65535 sample periods. You also have the option of smoothing the steps, for example to prevent abrupt jolts to mechanical equipment being controlled.

Often you will want to use the Step Arb output to control (modulate) another component page. Suppose you are conducting vibration tests on a product, using an electro-mechanical shaker system. Each test cycle consists of several stages at different frequencies and amplitudes, then repeats.

You can set this up using a Step Arb output as the FM modulation source for the main output component page that will drive the shaker. At each step the Arb output produces a different frequency, the range of which can be adjusted via the FM deviation and the main Freq setting on the output.

If you want some stages to be longer than others, just repeat that value as many times as needed. Assign each stage a duration in samples, such that the total comes to 1024, 2048, 4096, or 8192. (But see below for a way to avoid this.)

In a similar way, a second Step Arb can be used to step through various amplitudes by using it as the AM modulation source on that same output.

In Step mode, the trace sync defaults to the Timing Step size, even if Spec or Slow are active. If you set Timing Step to the Arb size (shown on the message line when you select an Arb Wave), then the sync point will be the start of the Arb cycle. You can use the main Daqarta Trigger Delay to move the sync point forward or backward in the cycle.

Random Sequence, Constant Step Duration:

Now suppose you want to randomize this same basic test cycle, using the same amplitude sequence but presenting the frequency steps in a random order. In other words, you want to select random values from that Arb file, rather than just step through in sequence. Consider that the values in the file are the points in one cycle of the original output series, so they correspond to phase steps. For example, if there are 1024 points in the cycle, each would represent 360/1024 = 0.35156 degrees of phase.

What you really want to do is select random phases, so you use Phase Modulation with the Source set to a noise page. Use White noise for a uniform distribution of random values over a range. You can adjust the Depth of this modulator, as well as the Level of the noise source, to cover as much or as little of the full range of values as desired. If you use less than the whole range, then the main Phase controls the central value.

You can use a Gaussian source to concentrate most of the samples about one region of your Arb, while still hitting the other values occasionally.

Note, however, that you must NOT set up the Arb to use Step, since that allows no Phase Modulation option. Instead, set it to Round, and set Freq to 0. What this means is that the output will hold constant at whatever phase is selected, and the total phase will include the main Phase setting as well as the contribution from the modulation. By using Round, you will select only discrete Arb values; if you instead set Interp you can randomly include "in between" values as well.

With this setup, the duration of each random frequency is constant, set by the noise Timing Step. You thus can't control the relative duration of different frequency steps by repeating values in the Arb file. Instead, repeated values now affect the relative probability of the different constant-duration steps. Of course, since any given Arb stage is selected at random, there may be repeated runs of the same stage which effectively act as longer durations.

You can try an entertaining demonstration of this process by loading the COMPOSER.S3A setup, which creates "oriental"- sounding background music by selecting random notes from the "black keys" section of EXPNOTE.DAT Arb file. This setup also demonstrates another important feature: You can have one Arb file containing several different regions. The main Phase control selects the region, and the modulation Depth and noise Level control the width of the region that is used. There is no need to repeat anything just to get an even 1024 samples, since you can always pad the unused part of the file with zeroes.

Creating Arb Files From Text:

You can use the TXT2DAT utility program to create an Arb file from a list of numbers in an ordinary text file. This is especially useful when the Arb is to be a control sequence instead of a waveform that you could simply record. The EXPNOTE.DAT file was created this way.

TXT2DAT accepts a plain ASCII text file. The values in the file must be INTEGERS in the +/-32767 range. They may be one per line, or separated by commas, spaces, or tabs. Having one value per line makes it easy to keep track of how many you have entered, by means of the line number in your editor or word processor.

If you use a word processor or spreadsheet to create this, make sure you save it as .TXT or .CSV (Comma-Separated Variable), not .DOC, .RTF, .HTM, or any native word-processor format.

You can add comments to your file by starting them with a semicolon (;). The remainder of the line will be ignored.

To use TXT2DAT, you invoke it from the DOS command line and give the full name, including extension, of the target file, as in:

    TXT2DAT myfile.txt

It doesn't matter what extension you use; it doesn't have to be .TXT, as long as the file actually contains ASCII text. The original file will remain unchanged, and a new file will be created with the same main file name but a .DAT extension.

The .DAT file thus created will be pure 2s-complement binary. You may also create an Arb file by any other means that produces this same format.

TXT2DAT is limited to raw text files no more than 65535 bytes in length. This should be adequate for Arb files up to the limit of 8192 values, though you may not have much room for comments in the largest files. Note that TXT2DAT does not do anything to force the resultant file to any particular length; it is up to you to insure that the raw file contains 1024, 2048, 4096, or 8192 values for use as an Arb file.

If you invoke TXT2DAT with no parameters, a short summary of the above usage description will be displayed.


This is a 1024-point Arb file created with the above TXT2DAT utility. It contains 7 separate sections, holding values corresponding to musical intervals and an exponential curve.

This file is intended for use with Arb Freq set to 0 Hz, and the main Phase set to select the desired section of the file. You then use Phase Modulation to cause the output to run through the selected values. The modulator Source can be another component page, perhaps one of the Noise Waves used in Step Timing mode to randomly select values from the Arb at some desired rate.

The Arb Wave can be set to Round to insure that only discrete table values are selected, as you might want to do if they are used to play musical notes, or to Interp to allow a smooth curve to be generated for exponential control of a frequency sweep.

The output of the phase-modulated Arb page would typically be used to modulate another page, such as via FM to play notes or sweep frequencies using the exponential response provided by the Arb.

The seven sections are:

     Degrees             Description
   0.0 to  38.7      111 semitones (all keys)
  39.0 to  61.5      65 white keys (C-scale)
  61.9 to  77.7      46 black keys (pentatonic)
  78.0 to 100.5      65 natural minor scale
 100.9 to 123.4      65 harmonic minor scale
 123.8 to 143.1      56 whole-tone scale
 143.4 to 360.0      616 frequencies at 1/72nd-octaves

The Phase Modulator Depth and the source page Level must be adjusted to keep the excursion within the desired range. These two controls act in tandem. If you want to select only the last section of this Arb file, for example, it comprises 616/1024 or about 60% of the full 360 degree range. If you set the modulating source Level to 60%, then (assuming that its wave normally covers the full range of values from negative to positive full-scale) this represents the desired extent of the Arb cycle. So you would set the Arb Phase to the middle of the range (about 251.7 degrees) and set the Phase Modulator Depth to 50% to swing +/-50% of the Source amount in each direction.

The COMPOSER.S3A Setup File:

This setup demonstrates one use of the above EXPNOTE.DAT file. It "composes" music that has a traditional Oriental flavor, using the Pentatonic scale equivalent to the black keys on a piano keyboard. This is also the scale that is used in certain traditional folk styles of the British Isles, American Mountaineers, and Native Americans. You may thus be able to modify the setup to sound more like one of these, or you may experiment with other tunings.

COMPOSER uses a White Noise source (page B) to supply random values that are then used to select random notes from the proper range of EXPNOTE.DAT (page C), which are in turn used to modulate the frequency of a Ramp Wave (page D) to get the actual notes. Burst is used on the ramp, set to give a different duration than the random note changes to make it more interesting. To add still more dynamics, the ramp slope is modulated by a slow random souce (page A).

Additional modulation could be used, such as by adding AM to the page D output at a 3-7 Hz "tremolo" rate, or adding a similar AM to the random note frequencies of page C to provide "vibrato". All of this uses only DAC 0; DAC 1 is still free for a second instrument "voice".

The basic setup plays a very long "song"... it doesn't repeat for over 100 billion years! Here is a quick summary:

A spectrogram of COMPOSER.S3A in action is available from the screen shots index page.


Questions? Comments? Contact us!

We respond to ALL inquiries, typically within 24 hrs.
25 Years of Innovative Instrumentation
© Copyright 1999 - 2006 by Interstellar Research