Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Generator Volume (Left / Right) (Vol or dB)
Macros: GenLdB, GenRdB
The label for the Left and Right Volume controls is on a small button between them. Initially, this button is marked 'Vol', but it changes to 'dB' when the mixer attenuators have been calibrated and Use dB selected from the Attenuator Options dialog. (The Vol/dB button opens a slider dialog that provides another way to control volume, and also allows the Left and Right controls to optionally track together. The F9 function key opens the same dialog.)
Note: If your sound card uses a custom mixer that denies access to Daqarta, the volume controls are disabled here. You must make all volume changes with the custom mixer, and they will not be stored in Generator setup (.GEN) files.
Daqarta controls volume by directly setting the sound card mixer attenuators. Each channel has two attenuators in tandem, an overall Master attenuator and one dedicated to Wave output only. Attenuator step sizes vary among sound cards, and even throughout the range of a single attenuator, but step sizes of 3 dB or more are not uncommon. This is too coarse for many applications, though it does allow control over a wide range, especially if both attenuators are used together.
Also, note that even though a typical sound card may have only 16 or 32 steps on each attenuator, Windows inserts many dummy steps (usually for a total of 192) for more apparent resolution. So, a change of only a few steps may not produce any actual change in volume.
With an uncalibrated system, the main Volume controls only adjust the Wave attenuators, and the values are simply step numbers. They move in integer values downward from 0. You will probably find it more convenient to click on the Vol button and use the slider dialog, which will also allow independent adjustment of the Master attenuators.
With dB Relative set (or with 'dB User Units' when User Units is inactive), maximum output is 0.00 dB and all other levels are negative by default. However, you don't need to enter a minus sign for direct entry; because no value can be greater than 0, negative is assumed. Scrolling up always gives greater output (less-negative dB values).
With 'dB User Units' set and User Units active, maximum output will be as specified in the User Units calibration dialog for each Left and Right Output. Here you do need to enter a minus sign for negative dB, since the User Units Factor may be greater than unity and thus allow positive dB.
Important: The dB setting will correspond to the Y-axis values if that output channel is displayed there, but this is only assured with 'dB User Units' and User Units active. The reason is that even with User Units off, the Y axis always considers the Range and External Gain settings, which may be non-unity.
As for uncalibrated controls, the calibrated controls also work by directly setting the sound card mixer attenuators. However, if 'Use Level' is set they additionally make coordinated small changes to the effective Level settings of each active component stream.
As noted above, the mixer attenuators may have steps that are too coarse for precision work. On the other hand, the individual stream Level controls provide exceptionally fine resolution, at least at high levels. For example, a setting of 99.88% is equivalent to -0.01 dB. The resolution of this system is considerably better than 0.001 dB down to settings of 50% (-6.02 dB).
The problem is that reducing the Level reduces the effective number of bits. At a setting of just under 50% the highest bit is never used, so a 16-bit DAC becomes effectively 15. Basically, a bit is lost for every 6 dB reduction obtained via Level instead of a true attenuator. By -48 dB the loss would be 8 bits. This causes increased quantization distortion since the wave is created with fewer, coarser steps.
The dB controls solve both problems by combining the best features of each system: The fine resolution of the Level system is used only to reach values between the steps of the mixer attenuators. For example, to set an overall attenuation of -0.01 dB the mixer is set to 0 dB and the effective Level is set to 99.88%. As the attenuation is increased, the effective Level is reduced further... but only until the setting reaches the next mixer step size. At that point, Level is returned to 100% and the next mixer attenuator step is set. On a sound card with 2.00 dB steps, for example, the effective Level never goes below 79.43% at any setting in the active range.
When a sound card attenuator is set to its lowest setting, it may switch into an Off mode which typically provides more than 120 dB of attenuation. The next higher step may be something like -70 dB, so Level is again used to get intermediate values. In this case Level will go as low as required, sacrificing bit resolution as needed, up to a limit set by the Max Level control.
Increased quantization at this low end is usually not a problem because most of the attenuation is still coming from the attenuator. For example, if your attenuator goes down to -70 dB and you want -82 dB, only 12 dB comes from Level. That is a loss of 2 bits of resolution, so a 16-bit card will have the performance of a 14-bit card, with quantization distortion no better than about -84 dB. But since the attenuator provides another -70 dB of non-quantizing reduction, the effective quantization distortion will be an undetectable -154 dB, completely swamped by residual noise and distortion in the rest of the audio chain.
You can still get to Off if you try to set a large-enough value, like -1000 dB (easily entered as '1k', or '-1k' in User Units mode). When you scroll up from Off, the next higher value you can reach depends upon the amount to which Level is allowed to extend the normal attenuator range. That value defaults to 96 dB, but you can set that via the Max Level control in the Atten Calibrate dialog.
All of the attenuator and Level interaction is done transparently by the dB volume control, so you can treat it like a simple attenuator with 0.01 dB resolution over the entire attenuation range. You won't see any differences in the Level control settings, even though the effective values may be changed by the volume control. For example, if Level is set to 50% and volume is set -0.01 dB below a particular mixer step, the true internal level setting will be 99.88% of the 50% setting, or 49.94%.
Note, however, that this system depends upon knowing the mixer steps exactly. If the true steps are a little bit bigger or smaller than specified, then the control response won't be smooth down to the 0.01 dB resolution of the control. A setting change of 0.01 dB thus might not give a true attenuation change of that amount for values that fall near multiples of the mixer step size.
Unfortunately, Windows has no provisions to allow a program to determine even the nominal mixer step sizes, let alone any calibrated values. Thus, Daqarta requires a custom calibration file to tell it the true attenuation for each step. You can perform this calibration yourself, using the Auto-Calibrate system. It is also possible to use a file created on another system if it uses the exact same sound card model.
Note also that when Use Level is active, a change in volume usually requires Daqarta to compute new levels in order to hit the desired dB value exactly. Sound output is stopped momentarily and restarted from the beginning with the new levels; it can not just continue where it left off. This causes a discontinuity in the waveform, which results in a click. If you use the small scroll arrows (or the sliders in the dB Slider dialog) you will get a string of clicks that may be quite annoying.
You can use the GenUpdate macro to avoid these clicks in certain situations, especially during macro control of volume or level.
GenLdB and GenRdB control the Left and Right outputs, regardless of whether they are in dB or Vol mode.
If your system is uncalibrated, or you have selected Use Vol Steps in Attenuator Options, then GenLdB=3 will set the Left Wave mixer control to the 3rd step down from maximum, shown as -3.
If your system is calibrated and Use dB is selected in Attenuator Options, then GenLdB=3 will adjust either or both Wave and Master attenuators as needed to get as close as it can to 3 dB below maximum (-3.00).
In either case the sign will always be negative, regardless of the sign you supply in the command.
With dB User Units set and User Units active, GenLdB=3 will attempt to set 3 dB in User Units. If the units are SPL, for example, the Wave and Master attenuators will attempt to set 3 dB SPL (a very soft sound). NOTE that in this User Units case, the sign is important and is not assumed to be negative.
Alternatively, GenLdB=>1 will make the Left output one volume step or one dB louder (less negative) and GenLdB=>-1 will make it one volume step or dB softer (more negative).
When using GenLdB or GenRdB in Macro IF Statements, note that they are treated as signed variables when they appear on the right. For example, IF.GenLdB=< GenRdB will be true if GenLdB is less (more negative) than GenRdB. Signed math must be used when there are multiple terms. If, for example, GenRdB is -40, then IF.GenLdB=< GenRdB - 10 will be true if GenLdB is more negative than -40.
See also Signal Generator Control Dialog
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