Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
The following is from the Daqarta Help system:
Speech and music
Musical instrument tuning
Contact us about
Generator Output Bits (Left / Right)
Macros: GenBitsL, GenBitsR
The default here is 16 bits, which is the maximum resolution Daqarta supports, and is guaranteed to be available on all Windows sound cards. You may reduce that to simulate operation on another system, or to experiment with special effects like dither for increasing resolution. The Dither Demonstration topic uses this to show how added noise can reduce distortion at low sound levels in audio systems.
Note that the Bits control provides a simulation of lower-bit systems... it still uses the full 16-bit range of the sound card, but makes it "chunkier" by allowing only discrete steps.
The Bits setting determines the number of possible output steps (voltage levels) in the waveform via 2^(Bits). At the default of 16, there are 2^16 = 65536 possible levels, while at 3 bits there are only 2^3 = 8. Since the full 16-bit range is still used, the simulated 3-bit steps are each 65536 / 8 = 8192.
This simulation allows the Dither Demonstration and similar experiments to be done at normal listening levels. Otherwise, you would need to set the Stream Level to a very low value so the selected Generator waveform only used the desired number of bits on the 16-bit system. A one-bit step on a 16-bit system is 1/65536 of the full-scale range, which is just over 0.0015%. At such low levels, listening tests may be confounded by ordinary system or room noise.
A 16-bit audio system uses two's complement signed binary format, which runs from +32767 to 0 to -32768. Notice that regardless of the Bits setting, the total 2^(Bits) number of steps is always even, and one step must be waveform zero. This means the the allowable negative range is always one step larger than the positive range.
This tiny deviation from perfect symmetry would be undetectable on a 16-bit full-scale waveform display. Note, however, that the Daqarta Generator only uses +/-32767 in 16-bit mode, maintaining a symmetrical swing by leaving the -32768 level unused.
A true 3-bit system would have steps from +3 to 0 to -4, but as noted earlier the simulation will have steps of 8192 each:
+3 * 8192 = 24576 +2 * 8192 = 16384 +1 * 8192 = 8192 0 -1 * 8192 = -8192 -2 * 8192 = -16384 -3 * 8192 = -24576 -4 * 8192 = -32768
Notice that this is conspicuously asymmetrical; the maximum positive full-scale value is only 3/4 of the normal range. (The 16-bit to 3-bit conversion makes no attempt to rescale the original signal to +/-3.) The waveform thus has an effective negative DC offset value added to it, which is visible on the waveform display, and as a 0 Hz component on the Spectrum display.
Although you can't hear DC, and in fact sound card outputs are AC-coupled so they don't pass DC anyway, you may nevertheless want to generate a low-Bits signal that is symmetrical about zero. To do that, determine the step size as a percent of full-scale: 1 / 2^(Bits), which for 3 bits (8 steps) would be 12.5%. Set the Stream Offset to that value, and reduce the Level so the total is 100% or less.
GenBitsL=12 sets the Left Output Bits to 12. Alternatively, GenBitsL=>1 increments and GenBitsL=>-1 decrements the current value.
GenBitsR works the same way for Right Output Bits.
See also Signal Generator Control Dialog.
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2022 by Interstellar Research
All rights reserved