Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Sound Card Long-Duration Tests and Sound Exposures
The simplest and most powerful way to create long tests is with macros. The basic idea is to use a WaitTime command to wait for the time you want the test to start, then use whatever commands you need to begin the test (such as Gen=1 to start a sound exposure), then WaitSecs or another WaitTime to set the duration of the test, followed by commands to end the test and save any needed data (such as the actual times the test started and ended).
You can put these commands into a macro that runs in a loop if you need the same test repeated on a regular basis, such as hourly, daily, weekly, certain days of the week, or monthly. WaitTime can awaken your system from Standby, Sleep, or Hibernation as needed when it is time for the next test.
Here is an example of a macro that performs a one-hour test. Let's call it _HourTest:
Gen=1 ;Sound On Msg="1 Hour Test ;Show msg IN PROGRESS" Field2=d ;Start date Field3=t ;Start time WaitSecs=1:00:00 ;Wait one hour Gen=0 ;Sound off Field4=t ;Stop time Msg= ;Clear msg A.SaveDQA= ;Save data
To use this, you'd first run a setup macro that loads the desired Generator setup, sets the Label for each Field, sets Auto-Increment for file names, and sets the initial name (possibly from a Subject ID Field).
If the setup macro then ran @_HourTest, a single test would start immediately and end in one hour.
But suppose you want to run _HourTest at noon every Monday, Wednesday, and Friday. In that case, add WaitTime=Mo,We,Fr@12:00:00 as the first line of _HourTest, and then have the setup macro run it in a loop via @_HourTest=5G. (The 5G sets the loop to run "forever". It is just an easy way to enter a maximal value, which Daqarta will limit to 2^32 - 1 or 4294967295. At 3 times a week this will run for 27.5 million years.)
You can use the Burst option of the Generator to provide timed sound exposures or test cycles. The Burst can be applied to control any of the waveform or noise sources that the Generator can create, including those with other modulation. You can use Stream Modulation to allow a Burst stream to control another stream, or a cascade of streams that have their own shorter Bursts... or anything else.
The overall test cycle time can be up to 2^32 - 2 samples, which is over 27 hours at a 44100 Hz sample rate, or 24.86 hours at 48000 Hz. Alternatively, the test can run a single cycle and stop.
This allows the test or exposure to run unattended for long periods, such as overnight. For example, suppose the test will be very loud, and you want to run it only after everyone has gone home. You don't want to stay late to start the test, and you don't want to have to come back to shut it off after the specified duration.
Burst Lag allows you to specify the time before the output begins. If it is 4:30 PM when you set up the test and you want it to start at midnight, you would set a Burst Lag of 12 - 4.5 = 7.5 hours. Set the samples/seconds button to 'secs', but then enter 7:30:0. Daqarta will accept that and display it as 27000 seconds.
Now let's say you want the test to run for 4 hours and then shut off. Set Burst High to 4:0:0 and it will show 14400 seconds.
Set Rise, Fall, and Shape as desired. If you want the sound to start and stop abruptly, just set Rise and Fall to zero. If you want to ramp it up and down linearly, you can set Shape to 0 (linear) and specify the desired ramp times in Rise and Fall.
The final step is very important: To insure that the sound shuts off and stays off indefinitely, set Train Cycle (at the very bottom of the dialog, not Burst Cycle) to maximum. You can enter '5G' (5 Giga-seconds) to be assured of this. 5G is a good general-purpose value, because it will produce the same maximal results in either Samples or Seconds mode. (The maximum of 2^32 - 1 samples equals 4.294967295 Giga-samples, so 5G will exceed that as well.)
The Train Cycle control normally specifies how long the overall cycle should last, but when Daqarta sees this maximal value it assumes you want it to last indefinitely. Essentially, Daqarta runs through the normal burst stages and then continually repeats the final "off" or "dwell" portion.
Alternatively, you can set Train Cycle to 24:0:0 if you want the test to repeat once per day, every day, at the same time (from midnight to 4:00 AM in the above example).
But sometimes you may want a more complex test cycle. If you want (say) 30 minutes on and 30 minutes off, each hour for 4 hours, set Burst Lag to 0, High to 30:0, and Burst Cycle to 60:0 to get the basic on-off cycle. Then set Train Count to 4 to get the total number of cycles. Set Train Cycle to maximum if you only want to do this once, or set it to 24:0:0 to repeat daily. You can use Train Lag to set the delay before the whole process begins the first time. (As in the original single-cycle test, enter the number of hours between now and when you want the first cycle to start.)
This assumes that the test is only a single stream. If you have multiple independent streams, perhaps on separate Left and Right outputs, you would set Burst on each stream as needed.
You can use multiple streams to achieve much more complex tests. For example, you might want several repetitions of one sound (say, a particular tone or other wave), followed by one long blast of White noise at a different level. You can easily do this by having one stream for the tones and one for the noise. The tone stream would have Train Count set to give the desired number of bursts, while the noise stream would have a Train Count of 1 but would have Train Lag set to allow time for the whole series of tones to elapse before the noise came on. Both streams would have Train Cycle set to maximum if only one entire test cycle is desired.
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