Current Language
×
Vietnamese (Vietnam)

Select a language:

Toggle Menu
Current Language
×
Vietnamese (Vietnam)

Select a language:

Contact us

Live Chat with Tek representatives. Available 6:00 AM - 4:30 PM

Call

Call us at

Available 6:00 AM – 5:00 PM (PST) Business Days

Download

Download Manuals, Datasheets, Software and more:

DOWNLOAD TYPE
MODEL or KEYWORD

Feedback

Replicating Real-World Signals with an Arbitrary Function Generator (AFG)


Introduction

Electrical signals surround us in everyday life, from our phones, cars and computers, to our own bodies. The majority of products we use require some sort of electrical input signal to function. As technology advances, these required signals also become more complex and varied. For example, wearable health devices, like heart rate monitors, must be able to accurately measure a biological signal and use that signal to extract information for the user. The one thing all these devices have in common is the expectation to function correctly in various situations and conditions. This is accomplished by testing devices with a wide range of possible input signals.

replicating real world signals with AFGs

As we strive to integrate more technology into our bodies and lives, we are met with the realization that the signals that drive our biologic functionality are unique and complex. Mimicking said signals during product testing can be difficult or expensive, as our test equipment is now required to replicate the original source (such as a human heart). Common test equipment, such as power supplies, may not be able to provide the versatility needed for thorough testing. Also, in many cases it may be useful to add noise or other anomalies to the signals to test devices under real-world and stress conditions.

Arbitrary function generators (AFGs) are a cost-effective solution to this problem. AFGs have the capability to recreate complex waveforms and can have editing tools to alter existing waveforms to eliminate the need for finding sources for every situation. AFGs are also compact, saving space in labs, and they can have multichannel functionality, allowing the user to sync multiple waveforms for the device.

Recreating the real-world signals needed for this testing can be done by a variety of different ways. This app note will review some methods that don’t require learning special software or writing code.  We will also look at the Tektronix AFG31000 arbitrary function generator, which offers unique capabilities for creating signals. The 4 methods of creating real-world signals we will examine are:

  1. Using data or equations in Excel
  2. Using ArbExpress software on the PC
  3. Using ArbBuilder software on the AFG31000
  4. Using captured signals from an oscilloscope

The following sections will explore these different approaches to creating waveforms by walking through a real use case for each one.

Using Data or Equations in Excel:

Excel is a great tool for building custom arbitrary waveforms from numerical data collected by another instrument, or from an equation since it provides advanced built-in mathematical functions and can handle a large number of waveform points. Excel spreadsheets can be saved as CSV files, which can be read by some AFGs. As an example, an action potential waveform can be created using data in Excel.

An action potential is a difference in voltage generated by neuron cells to convey information. Action potentials can be measured using a patch clamp and amplifier. The data collected can be saved in CSV format and opened in Excel. In Figure 1, we have graphed the action potential waveform from simulated data.

neuron action potential in excel

Figure 1: Neuron Action Potential in Excel

Excel also has the capability to use mathematical formulas to manipulate data. For example, the neuron action potential pulse can be reduced by 20% to create a failed action potential shown in Figure 2.

failed neuron action potential in excel

Figure 2: Failed Neuron Action Potential in Excel

At this point, you can save the Excel spreadsheet as a CSV file to a USB drive and transfer the file to your AFG. On the AFG3100, the CSV file is opened in software called ArbBuilder as shown in Figure 3 and discussed in its own section. 

neuron action potential ArbBuilder

Figure 3: Neuron Action Potential in ArbBuilder

Using ArbExpress software on the PC:

ArbExpress is PC-based software that generates waveforms for Tektronix signal-source instruments. This tool is especially useful for sending waveforms remotely to an AFG and for large waveforms (>1 million points). The user can create new waveforms, edit existing waveforms and load waveforms from a Tektronix oscilloscope. Multiple files can be opened at the same time, simplifying the process to create waveforms for two channel applications, like testing an I2C LED driver or CAN bus. The signals can be transferred directly to an Arbitrary Waveform Generator (AWG), or an AFG that is connected to the PC.

ArbExpress can open existing waveform files (.wfm, .tfwx, etc.) as well as CSV files. To open an existing file, click File and then Open. Select the file format to be opened and then select the desired file. To load a waveform from a Tektronix oscilloscope, go to the Communication menu. The user can then directly import from scope or use the scope acquisition wizard to walk the through connecting and acquiring the signal.

New waveforms can be generated by either using an equation or using a standard waveform. ArbExpress can generate the following standard waveforms: Sine, Square, Triangle, Pulse, DC, Exponential Rise, Exponential Decay, Noise, Sinc, Sweep, Multi-Tone, and Lorentz.

When a waveform is opened in ArbExpress, the editing tools become available. The tools are boxed in red in Figure 4, which shows an I2C clock waveform that was captured on the oscilloscope.

using ArbExpress to edit clock waveform

Figure 4: Using ArbExpress Tools to Edit I2C Clock Waveform

The tools allow the user to draw freehand or horizontally/vertically, place single points, edit the point table or cut, copy and paste sections of a waveform. The Math menu allows the user to combine different functions, for example adding noise to an I2C data waveform as shown in Figure 5. ArbExpress displays a preview of the resulting wave, eliminating the need to open and close the window.

add noise to data waveform

Figure 5: Add noise to I2C Data Waveform

Once the waveform is complete, the user can connect the AFG to their PC via a USB cable and start communication in ArbExpress by clicking the File Transfer and Control button. The waveform file can be sent directly to the AFG by clicking the Send to Arb button. ArbExpress is capable of creating waveforms using up to 128 million points. These waveforms are used in the sequence mode on the AFG31000.

Using ArbBuilder software on the AFG31000:

ArbBuilder is built-in software on the AFG31000 that allows the user to easily create custom arbitrary waveforms with up to one million points, using the front-panel touch screen. It also enables importing .csv files directly onto the AFG without the need of going through a PC first.

ArbBuilder can be found on the home screen where apps are listed as shown in Figure 6.

AFG31000 home screen

Figure 6: AFG31000 Home Screen

When the user launches ArbBuilder, they may select the Open button to load an existing arbitrary waveform from a USB flash drive or from the AFG’s internal memory. Alternatively, the user may also select New Waveform or New Equation to create a brand-new waveform. New Waveform allows users to start with a blank wave or select a base from a set of standard waves. Standard waveforms include Sine, Square, Triangle, Pulse, Noise, Sin(x)/x, DC, Sweep, Lorentz, Exponential Rise (Exp. Rise), and Exponential Decay (Exp. Decay) waveforms as shown in Figure 7. Parameters for each type of wave can be edited before clicking OK to go to the full editor.

standard waveform in ArbBuilder

Figure 7: New Standard Waveform in ArbBuilder

The New Equation button enables the user to create waveforms using the equation editor. The user can build the math equation by using the touch screen keyboard which has predefined math functions, or by loading an existing equation. Once entered, the equation must be compiled to create a discrete set of points from the continuous equation. After compiling, the equation can be previewed graphically before loading it into ArbBuilder’s editor. Figure 8 shows a damped sine waveform created using the equation editor.

creating a damped sine wave

Figure 8: Creating a Damped Sine Wave in the ArbBuilder Equation Editor

Once the user has the waveform base configured as desired, pressing OK will create the waveform file and open it in the ArbBuilder editor as shown in Figure 9. The waveform file is populated as a tab, so there can be multiple waveforms open for editing at once.

damped sine wave in ArbBuilder editor

Figure 9: Damped Sine Wave in ArbBuilder Editor

At the bottom of the editor, users can access functions to edit the displayed waveform. The Draw button opens the menu of drawing tools giving users the option to change waveforms using just their finger and the touchscreen. Drawing can be done completely freehand or using only vertical or horizontal edits. Individual points can be edited or added using the Point function. This opens the Point Draw Table, and the user can select the interpolation method used to connect the points. In our example, the Freehand drawing tool can be used to extend the beginning of the damped sine wave to 0V, replicating the transient response of an underdamped RLC circuit as shown in Figure 10.

transient response of RLC circuit

Figure 10: Freehand Drawing to Create Transient Response of RLC Circuit in ArbBuilder

The Edit button allows the user to Cut, Copy, Paste, Invert, Mirror or Shift parts of the edited waveform. Dragging the red and green cursors allows the user to select the section of waveform that will be affected by the action.

When the waveform is complete there are two ways to output it. Waveforms less than 131,072 points can be transferred to the desired channel by pressing the Send button with the target channel selected as shown in Figure 11. The arbitrary waveform will be set up to run the next time Basic Mode is opened. For waveforms larger than 131,072 points, save the waveform as a waveform file (which uses the extension,*.tfwx) and open in it in Advanced mode. Advanced mode can output a waveform up to 16Mpts or 128Mpts with an optional memory expansion.

sending waveform via output channel in ArbBuilder

Figure 11: Sending the Waveform to the Output Channel from ArbBuilder

Using Captured Signals from an Oscilloscope:

Often, users want to use the AFG to exactly replicate signals that are normally produced by an external source. The signals may come from a source that is difficult to operate or access, or costly to use for testing. The signals may also represent a very specific situation such as a rare heart condition that must be accurately replicated for testing. With the expansion of medical technology and wearable medical devices, reproducing biological signals is necessary for accurate verification of functionality. A solution to this is to use an oscilloscope to capture the desired waveform and then transfer it to the AFG31000.

For example, a heartbeat waveform can be captured using a photodetector (photoplethysmography) or by electrodes connected to an amplifier. Once the desired signal has been captured on the oscilloscope as shown in Figure 12, the waveform can be saved as either a *.csv or a *.wfm file to a USB flash drive.

simulated heartbeat waveform on oscilloscope

Figure 12: Simulated Heartbeat Waveform Captured on the Tektronix MSO5 Oscilloscope

For waveforms less than one million points, the waveform file can be transferred directly to the AFG using a USB flash drive. Figure 13 shows a single heartbeat waveform captured from the scope displayed in ArbBuilder. For waveforms larger than one million points, see the section on ArbExpress.

simulated cardiac waveform in ArbBuilder

Figure 13: Simulated Heartbeat Waveform in ArbBuilder

The user can now edit the imported waveform in ArbBuilder to customize it. For example, to create an irregular heartbeat, or arrythmia, such as a premature ventricular contraction in the heartbeat, use the cursors to select the main spike in the heartbeat. This is the QRS complex, where the heart is depolarizing and contracting. Press Edit then Copy to make a copy of the portion of the waveform between the cursors. Move the cursors to directly after the full heartbeat and paste the copied waveform. Select the newly copied section of the waveform and press Invert to flip the section. Now press Draw to extend the copied waveform to create a premature ventricular contraction waveform.

simulated premature ventricular contraction

Figure 14: Simulated Premature Ventricular Contraction in ArbBuilder

Once the waveform is complete as shown in Figure 14, send it to the desired channel in Basic mode or save and open it in Advanced mode to output it to the medical device, such as a pacemaker or cardiac defibrillator as shown in Figure 15. The circuit is isolated to protect the device under test. The AFG31000 has 2 synchronized channels for testing devices that require multiple inputs.

circuit to send waveform to pacemaker

Figure 15: Circuit to Send Waveform to Medical Device like a Pacemaker

Conclusion

Nearly all consumer products today have circuits or devices that require the input of specific electronic signals for the product to perform correctly. It is important to have test equipment that can accurately replicate these signals when testing devices like sensors, microcontrollers and medical equipment such as pacemakers which are vital for certain people’s lives.

The Tektronix AFG31000 series arbitrary function generator is a compact and cost-effective solution for those needs. The built in ArbBuilder software puts the power to generate custom waveforms at the user’s fingertips. The ArbExpress software provides the capability to work with complex and large waveforms and transfer them directly to the AFG from the PC. The waveform creation tools supplemented with the ability to import waveforms from an oscilloscope or Excel CSV files, allows users to choose the method that works best for them, reducing  setup time and test errors.

 

Further Reading:

Briggs, H. (2019, December 03). Artificial neurons developed to fight disease. Retrieved October 02, 2020, from: https://www.bbc.com/news/science-environment-50644545

Emmenegger, V., Obien, M. E., Franke, F., & Hierlemann, A. (2019). Technologies to Study Action Potential Propagation With a Focus on HD-MEAs. Frontiers in Cellular Neuroscience, 13. doi:10.3389/fncel.2019.00159 https://www.frontiersin.org/articles/10.3389/fncel.2019.00159/full

Pereira, T., Tran, N., Gadhoumi, K., Pelter, M. M., Do, D. H., Lee, R. J., . . . Hu, X. (2020). Photoplethysmography based atrial fibrillation detection: A review. Npj Digital Medicine, 3(1). doi:10.1038/s41746-019-0207-9 https://www.nature.com/articles/s41746-019-0207-9

Tektronix. (n.d.2020). 25 Common Things You Can Do with an Arbitrary Function Generator Beaverton, OR. Retrieved October 16, 2020, from https://www.tek.com/document/fact-sheet/25-common-things-you-can-do-arbitrary-function-generator

What is an action potential? (n.d.). Retrieved October 23, 2020, from https://www.moleculardevices.com/applications/patch-clamp-electrophysiology/what-action-potential