Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Creating Complex Arb Waves
Complex waveforms can be created by combining up to 4 Generator Streams per channel. (Up to 8 streams on a single channel using the Multi-Channel Outputs option.) You can use such waves in place of conventional waveforms like Sine, or you can use them as modulation sources or controllers for test sequences.
But you can do much more than simple summation. One key concept is the use of Burst to isolate separate non-overlapping sample intervals from each stream. That way, when they are summed together, only one section is non-zero at any time, so the segments appear in sequence.
You can set each Level as desired, since there is no danger of clipping. In particular, you can use Level to adjust the slope and vertical alignment of each section, so the end of one splices neatly with the next.
Although for ultimate resolution you should create Arbs that are the maximum size of 16384 samples, for this example we will use only 1024 because the entire Arb waveform can be seen on the screen at the same time. (With 16384 you'd need to use Decimate with Factor set to 16, or else use Trigger Delay to view 1024-sample sections, one at a time.)
Suppose we divide the total 1024-sample Arb waveform into 4 equal sections of 256 samples each. (In reality, all that is needed is that they all total to 1024.)
Set Burst Cycle on each Stream to 1024, Rise and Fall to 0, and High to 256. Set Burst Lag to 0 on Stream 0, 256 on Stream 1, 512 on Stream 2, and 768 on Stream 3 to create 4 non-overlapping sections. Also set Reset Phase on Burst in the Tone Freq dialog for each stream.
Each stream is now independent, so you can set any Level or frequency you want in each stream segment. The trick is to adjust things to get smooth splices between segments.
Let's look at some of the tools available for creating various line segments:
For curved lines, the Sine wave is an obvious choice, and it also responds to frequency, Level, and Phase adjustments.
You can slide the raw wave back and forth within the Burst window by adjusting the Main Phase in the Tone Frequency dialog. You can slide it up and down using Stream DC Offset, with the little mode button next to it set to Burst. (If the button is left at the All default, DC Offset is applied to the entire trace, not just the Burst portion.)
A less-obvious but often better way to make straight or curved lines is to use a Sine wave with frequency set to 0 (DC) and Phase set to 90 degrees, which gives a flat line at whatever value is set via Level. Then use Burst Rise and Fall to create segments that curve smoothly between 0 and the Level value, in the Rise or Fall time. Burst Shape controls the curve... higher values are steeper near the center. A Shape of 0 gives a straight line between 0 and Level, with the slope controlled by Rise or Fall.
Note that with the DC-Burst method any Rise or Fall you use adds to the overall segment width, so if you want a fixed width you need to include these as well as High in the total.
For the first (Stream 0) segment of this example, we'll create a straight line that slopes up from 0 to 50%. The DC-Burst method is simplest: Set Tone Freq to 0 and Phase to 90 degrees. Set Level to 50%. Then, leaving Cycle at 1024, set High to zero and Rise to 256.
For the second (Stream 1) segment, we'll create 2 cycles of a sine wave that oscillates between 50% and 0. The waveform method is used here, so keep High at 256 and leave Rise and Fall at zero, Lag at 256, and Cycle at 1024. Since we want the wave to start at its maximum of 50%, set Phase to 90 degrees. Sine waves normally oscillate between positive and negative values, but we want this one to only go as low as 0. To do this, set Level to 25% and Offset to +25%, using the Burst Offset mode. To get exactly 2 cycles to fit into 256 samples, and assuming a Sample Rate of 48000 Hz, we use:
Freq = Cycles * SampleRate / Samples.
This gives 2 * 48000 / 256 = 375 Hz.
The third segment (Stream 2) will smoothly go from 50% down to 0 using a Cos^2 curve (default Burst Shape). We'll use the DC-Burst method again, so set Freq to 0 and Phase to 90 degrees. Then set High to 0 and Fall to 256, leaving Lag at 512 and Cycle at 1024. You can change the Burst Shape to get other curves.
The final segment (Stream 3) will start from 0, curve smoothly up to a peak at 100%, then back down to 0 again. We could use either the wave or DC-Burst method method here, but the latter is simpler because we don't need to calculate frequency. Again, set Freq to 0 and Phase to 90 degrees, then set High to 0 and Rise and Fall each to 128, leaving Lag at 768 and Cycle at 1024. Level should be at 100% and Offset at 0.
You can adjust Burst Shape to change the steepness. The relative widths of Rise and Fall affect the symmetry (skew) of the peak. You can insert a plateau by reducing Rise and/or Fall and adding High. You can change Level to change the height of the peak or plateau.
Note: When changing the durations of any Burst parameter, always do reductions before increases. Otherwise, Burst Cycle will automatically increase to accommodate the total, but it will not automatically decrease when you subsequently decrease the components. If you find you are not getting the shape you expected, check Cycle first to make sure that you haven't inadvertently caused it to silently increase above 1024.
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