Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Creating Arb .DAT Files From Text
Controls: File Menu >> Convert Text File to .DAT
You can create an Arb or Play file from a list of numbers in an ordinary text file. This is especially useful when the Arb or Play is to be a control sequence instead of a waveform that you could simply record. The Expnote.DAT file was created this way.
Note that this discussion assumes the values form a complete waveform of 1024 samples or more, one value per sample. Alternatively, the Arb_From_List Macro Mini-App can create an Arb by straight-line interpolation from a short list of times and amplitudes.
The Convert Text File to .DAT option in the File Menu will prompt for the name of a plain ASCII .TXT or .CSV file. The values in the file must be in the +/-32767 range. Values outside this range will be forced to these limits. Decimal fractions will be rounded to the nearest integer.
Values 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 text 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.
Note that this process assumes a single channel, with each value being one sample of that channel. If you want to use a file created by Daqarta's own Save Trace as .TXT option, you must first manually remove (or comment out) the headers, then remove all unwanted columns. (See Text Editors with Column Support.)
If the text file is longer than 262144 bytes, the excess will be ignored. This will typically be enough for a .DAT file of 32768 values or more. Note that for Arb use, only the first 1024, 2048, 4096, 8192, or 16384 values will be accepted from any .DAT file.
As soon as the file is accepted, you will be prompted for a .DAT file name to save the converted file under. The default name will be the same as the original, with the new file extension.
The headerless .DAT file thus created will be pure 2s-complement binary 16-bit words. You may also create an Arb or Play file by any other method that produces this same format.
You can also use the Convert Text File to .DAT option to examine long lists of text values as waveform data. The resulting .DAT file can be opened and scrolled through as if it had been recorded as a DDisk file, and you can view the Spectrum of any screen, or the Spectrogram of the whole file.
Note that for Arb use, you don't really need to create a .DAT file from your text file, since text files can be loaded directly as Arb files. That capability is not available for Play, so you do need the .DAT conversion first.
Also, text files of 1024 values or less can be opened directly for viewing in high-resolution single-screen mode.
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 30 Years of Innovative Instrumentation
© Copyright 2007 - 2017 by Interstellar Research
All rights reserved