Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Creating Rectified-Wave Arbs
There are no Wave selections for rectified waveforms, but you can load Arb files for half- or full-wave rectified sines (Arb_HalfRectSine.DAT or Arb_FullRectSine.DAT). These were created via the Arb_From_Equation macro mini-app, which you can use to create other rectified waveforms.
You can also create your own rectified Arbs using the Daqarta Generator. There are several approaches, but the Amplitude Modulation method given below is generally the easiest to use. Four other methods are also included for completeness, and/or for special cases.
You can create half- and full-wave rectified sines (or any other regular wave) by amplitude-modulating with a square wave at the same frequency. Daqarta includes the Rect_Wave.GEN Generator setup, which produces a 440 Hz full-wave rectified sine by default. You can easily modify it for other wave types or frequencies, or for half-wave rectification.
Left Stream 0 is set to create the square wave, with a Level of 100%. Left Stream 1 generates the wave we want to rectify, also at 100% Level. This must be a wave type that has a regular Tone Frequency, which includes Arb files but not Play or any of the Noise types.
The Stream 0 and Stream 1 Tone Frequencies must be the same, here 440 Hz. (You'll need to change that in order to create an Arb file... see below.)
AM is active on Stream 1, using L.0.Stream as the AM Source. AM Depth is set to 200% (pure multiply) for the default full-wave rectification; set it to 100% for half-wave. Alternatively, you can use -200 or -100% for inverted rectified waveforms.
Daqarta's AM operation multiplies the wave to be rectified ('carrier') by the modulator using the following formula, where both waves are assumed to be sines:
sin(carrier) * [1 - Depth/2 + Depth/2 * sin(modulator)]
First consider the full-wave mode, with AM Depth at 200% (2.00). Since the modulator is a square wave whose output is just +/-1, the formula becomes:
sin(carrier) * [1 - 2.00/2 + 2.00/2 * (+/-1)]
sin(carrier) * [1 - 1 + 1 * (+/-1)]
sin(carrier) * (+/-1)
This performs an ordinary multiplication of the two waveforms. Since the square wave is at a constant +1 for the first half of its cycle this just means multiplying by unity, so the other wave passes through unaffected.
In the second half of the cycle, the square is at a constant -1, so it inverts the other wave. Since the other wave is now in the negative half of its cycle, it is inverted to positive. Thus the second half-cycle of the output is an exact copy of the first half, giving full-wave rectification.
In half-wave mode, with AM Depth at 100%, the modulating wave acts like a volume control on the wave to be rectified. The basic formula for the multiplication becomes:
sin(carrier) * [1 - 1.00/2 + 1.00/2 * (+/-1)]
sin(carrier) * [1 - 1/2 + 1/2 * (+/-1)]
So when the square wave is +1 we multiply the carrier by:
1 - 1/2 + 1/2 = 1
This just passes the first half of the carrier through unchanged, as for full wave. But when the square wave is -1 during the second half of the cycle, we multiply by:
1 - 1/2 - 1/2 = 0
This eliminates the second half of the output wave, giving half-wave rectification.
To use the above AM approach to create an Arb file, first decide how long the Arb should be. Arb files must be in sizes of 1024, 2048, 4096, 8192, or 16384 samples; you should use at least 8192 for good resolution.
Now you need to set the main Tone Freq so that one cycle exactly fills 8192 samples. At the typical Sample Rate of 48000 samples/sec, that would be 48000 / 8192 = 5.8594 Hz. You will only see an eighth of the wave on the 1024-sample trace, but that's OK... it's the file that is important.
Now go to the DDisk Controls dialog (thin button under the DDisk button in the main toolbar, above Record) and select Triggered Start. At the bottom set Units to Samples, then set Write Size Preset to 8192. Set Write PreStart to 0. Click on the DDisk button and create a Save As file name, such as HalfSine; you can use the default .DQA file type, or select another type from the drop-down list.
Click Record, and almost immediately you will be prompted to keep the new file. After you do that, your new file can be loaded as an Arb wave in any Generator setup.
The approach here is to set the sine frequency so that 8192 samples is only half of a cycle. At 48000 Hz sample rate, that would be 48000 / (2 * 8192) = 2.9297 Hz. Then record it just like the above, maybe calling it FullSine.
Note, however, that the file contains only a half-cycle of the rectified wave. That means that to generate the rectified version of any given frequency, you will need to set Tone Freq to twice that frequency.
You can also create a half-wave rectified waveform with Burst, by setting Rise and Fall to zero, Cycle to the duration of one full cycle, and High to half that value. Set Trigger to Gen Sync for best results. (If the wave does not appear stationary, go to the main Tone Freq dialog and make sure Tone Sync is set.)
To save that as an Arb, see Creating An Arb File under the above Rectified Waves - Amplitude Modulation subtopic.
This method that only creates rectified sines or triangles, via an unusual use of Burst features. Daqarta includes the Rect_Burst.GEN Generator setup, which produces a single 1024-sample cycle of a full-wave rectified sine by default. This is suitable for saving directly as a 1024-sample Arb. You can easily modify it for more samples, for half-wave sine, or half- or full-wave triangle mode.
The Wave type is set to Sine (even for triangle creation), with Tone Frequency set to 0 and Phase set to 90 degrees. This thus creates a cosine wave stuck at the origin, where its value is unity... in other words, continuous full-scale DC output.
Applying Burst to this means the burst shape becomes the output wave itself. With the Burst Shape control set to 0.5000 the Rise portion of the burst is the first quadrant of a sine wave, from 0 to its positive peak. The Fall portion is the mirror of that, from positive peak back to zero.
The two together (without any intervening High section) thus creat a positive half-cycle of a sine wave. With Rise and Fall each set to 256 samples, and Burst Cycle set to the total of 512, one complete burst cycle (positive sine half-cycle) takes 512 samples. With no Burst Lag (or Train Lag) that repeats continuously... in other words, a full-wave rectified sine.
To create a half-wave rectified sine, just set Burst Cycle to twice the sum of Rise plus Fall, so there will be one half-cycle of the sine, followed by an equal duration of samples at zero.
To create negative-going versions of the rectified waves, set the main Tone Phase to -90 (270) degrees.
You can save these waves directly as 1024-sample Arbs, or if you want higher resolution just multiply the Rise, Fall, and Cycle values by 2, 4, 8, or 16.
To create rectified triangles instead of sines, set Burst Shape to 0, which means linear rise and fall.
You can also set Burst Shape to 1.000 to get a raised sine, or set higher values to get other shapes. You can use the full set of Burst parameters, including Lag, High, and the Train settings, to get exotic waveforms for special purposes.
For many purposes you can half-wave rectify a sine, or any other wave, by setting Level to 100% and DC Offset to -100%. The large negative Offset will appear on the trace, but since sound cards are AC-coupled it will not appear on the output. The spectrum of the generated signal will be the same, except for a peak at DC due to the offset. Note, however, that this shifted waveform may not give the desired results when used to modulate other streams.
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2021 by Interstellar Research
All rights reserved