Function & Arbitrary Waveform Generator Guidebook - B&K Precision Function & Arbitrary Waveform Generator Guidebook Download Guide Introduction Function and arbitrary waveform generators are among the most important and versatile pieces of electronic test equipment. In electronic design and troubleshooting, the circuit under scrutiny often requires a controllable signal to simulate its normal operation. The testing of physical systems and transducers often needs stable and reliable signals. The signal levels needed range from microvolts to tens of volts or more. Modern DDS (direct digital synthesis) function generators are able to provide a wide variety of signals. Today's basic units are capable of sine, square, and triangle outputs from less than 1 Hz to at least 1 MHz, with variable amplitude and adjustable DC offset. Many generators include extra features, such as higher frequency capability, variable symmetry, frequency sweep, AM and FM operation, and gated burst mode. More advanced models offer a variety of additional waveforms and Arbitrary Waveform Generators can supply user-defined periodic waveforms. Function generators are used where stable and repeatable stimulus signals are needed.

Here are some common uses and users: Research and development Electronic and electrical equipment repair businesses Stimulus/response testing, frequency response characterization, and in-circuit signal injection Electronic hobbyists To use a function or arbitrary waveform generator to its best advantage, the user should have a basic understanding of the instrument's controls, features, and operating modes. This guidebook is useful to those with little knowledge of function generators, as well as the experienced technician or engineer who wishes to refresh his/her memory or explore new uses for function generators and more sophisticated arbitrary waveform generators. First, we will explain the controls of a typical function generator. Next, we will look at the theory of how a DDS function generator works. The next section is on applications and contains the majority of the material in this guidebook. A final section discusses common questions. An appendix provides a glossary of terms related to function generators. There are a variety of function generators on the market spanning the cost range from a few tens of dollars to tens of thousands of dollars.

Some are dedicated instruments (the ones we will look at in more detail), some are black boxes with USB interfaces and an output terminal, some are plugged into computer or instrumentation buses, and some are software programs that run on a PC to generate waveforms on the parallel port or via a sound card. There are also inexpensive kits for hobbyists. The software-only function generators tend to be the least expensive and can be attractive for students and hobbyists on a budget. They are also the most limited in frequency capabilities, often just spanning the audio range. The black boxes are next in cost and have the advantage of portability and low power. They are often intended to operate with laptop computers. Generators that plug into different buses (e.g., PC, VXI) are appropriate where space is at a premium and a custom measurement system needs to be put together for e.g. a dedicated purpose. Dedicated benchtop generators are self-contained with the needed controls and display. The more expensive dedicated instruments add features and usually include one or more types of interface connections that allow computer control. Function Generator Controls The B&K Precision model 4040DDS function generator shown on the following page is a representative of modern DDS function generators.

We will describe the numbered controls and their functions. Thefront panel of this instrument is 225 mm wide by 100 mm tall (8.85 inches by 3.94 inches). The instrument is about 245 mm (9.64 inches) deep and weighs about 2.5 kg (5.5 pounds). Control Shows the function generator's settings, such as frequency, amplitude, waveform selected, etc. Typical waveforms Two of the common waveforms generated by function generators are the sine and square waves. A graph of a sine wave is shown: The mathematical representation of the sine wave is where A is the amplitude in volts, t is time in seconds (the horizontal axis), V is the vertical axis in volts, and f is the frequency of the sine wave in Hz. is the phase of the sine wave (in the graph, the sine wave is shown with a phase of 0). Two other measures of a sine wave's amplitude are often used: RMS and peak-to-peak voltage. The RMS (root mean square) value is used to measure the heating ability of a waveform.

The RMS voltage value of a periodic waveform is the value of a DC voltage which would deliver the same effective power (or heating ability) to a load as does the periodic waveform. For a sine wave, the RMS amplitude is shown as VRMS in the figure. The relationship of the RMS amplitude to the amplitude of a sine wave is It is important to note that RMS value is not the same for other types of waveforms. This relationship to the amplitude only applies to sine waves. Another measure used for the amplitude is the peak-to-peak voltage DDS function generators may have the ability to let the user set the amplitude using the peak-to-peak voltage or the RMS voltage. Some generators let the user set the amplitude in dBm, which represents a power of 1 mW. The voltage that this represents depends on the associated load resistance. You can calculate the RMS voltage VRMS for a given dBm value and resistance R in from the following equation: For example, a 0 dBm signal into 50 represents an RMS voltage of 0.2236 volts, but represents 0.7746 volts into a 600 load.

Modern equipment is usually referenced to 50 loads, but older equipment often used 600 loads. A sine wave can also have a DC offset voltage: The DC offset voltage Vdc moves the whole sinusoidal waveform up and down with respect to the horizontal axis. A square wave is shown in the following figure: The equation for this wave is The frequency shown is 1 Hz with an amplitude of 1 V. The RMS voltage for the square wave is the same (an easy way to see this is to take the negative-going portion and flip it about the horizontal axis; this is allowed as far as its heating ability is concerned). The peak-to-peak voltage is, again, twice the amplitude voltage and in this case equivalent to twice the RMS voltage. If a square wave has a DC offset equal to its amplitude, it becomes a pulse waveform (and can be positive or negative). DDS Theory of Operation Most modern function generators use Direct Digital Synthesis (DDS) for generating their output waveforms. Older generators used analog methods, which greatly increased the part count (component count) and made them sensitive to component aging and thermal drift. This section describes how DDS technology works. We ignore the implementation details and just look at the principles.

There are two fundamental ideas of DDS technology: Generating an arbitrary periodic waveform from a periodic ramp signal. Generating a digital ramp. Let's first look at generating an arbitrary periodic waveform from a periodic ramp signal. In the following, to keep things simple, we will only use times t ≥ 0. We will call the repetitive ramp function R(t): This ramp R(t) varies linearly between 0 and 1 with period T. Now, suppose we have any arbitrary function f(ξ) that is defined on the interval 0 ≤ ξ < 1. In mathematical terminology, the domain of the function is the half-closed interval [0, 1). Here's a graph of what f(ξ) might look like: Suppose we want to generate a periodic waveform of period T with the shape of the function f(ξ). Here's the key idea: To construct a periodic waveform of period T with shape f(ξ), r eplace the ramp's value R(t) at time t with the value of f(t/T - int(t/T)), where int means 'take the integer value'.

Note that t/T - int(t/T) winds up being a number in the interval [0, 1) -- i.e., within the domain of f(ξ). This is such a simple and useful idea. Let's look at an example. Suppose we want to generate a 1 kHz sine wave. Let f(ξ) be the sine wave sin(2ξ) where 0 ≤ ξ < 1. We generate a 1 kHz ramp; it has a period of 1 ms. Here's how we generate the sine wave: Pick any time t0 ≥ 0. Calculate ξ0 = t0/T. This will be a real number; chop off the integer part, leaving a decimal number between 0 and 1. Replace the ramp value R(t0) with the value sin(2ξ0). Repeat for all other times. To proceed to the DDS method, all we have to do now is replace R(t) with a digital ramp r(t). In the following picture, we show two digital ramps. The first one in red has a period of one half of the second one in blue. Both ramps are made with the same digital sampling rate.

Figure 1 The utility of DDS comes from the fact that it is easy to generate digital ramps of different slopes using digital counting techniques. Here's the second fundamental idea of DDS: To construct a digital ramp, increment a digital counter by on each clock signal. Now, this statement won't be clear until we explain it. Suppose we have an N bit counter -- this counter counts from 0 to 2N - 1, then rolls over to zero again. Instead of incrementing this counter by 1 on every clock pulse, we increment it by where 1 ≤ < 2N. When used with a periodic clock signal with uniform period, this counter generates a digital ramp. Here's a picture that shows what's happening: Each dot represents a counter value. The counter starts at 0, as indicated by the horizontal red vector. When a clock pulse is received, the counter is incremented by (you may read literature that calls the counter the "phase accumulator"). The counter's value is now shown by the second red vector at about 60°. If you imagine the second red vector is uniformly rotating counterclockwise in steps of , you can see that the rotating vector sweeps out the subsequent points of the ramp.

For example, if we imagine that the vector rotated 60° counterclockwise with every clock pulse, then the digital ramp values would be: 0, 60/360, 120/360, 180/360, 240/360, 300/360, 360/360 (i.e., 0), etc. The decimal values are: 0, 0.17, 0.33, 0.50, 0.67, 0.83, 0, 0.17, ... If you plotted these numbers, you'd see they formed a digital ramp. The digital ramps in Figure 1 iffer in slope because they were made with different values for . In real DDS implementations, N, the number of bits in the counter, might be 48 -- meaning 2N is a large number, about 2.8×1014. The clock signal is then run at 1 MHz, 50 MHz, 100 MHz or faster.

With a 48 bit counter clocked at 100 MHz, you can see the frequency resolution will be 100×106/248 = 3.5×10-7 Hz, or in the Hz range. DDS is popular because this counting can be implemented in digital hardware that has low parts count (i.e., is simple, which implies better reliability and lower cost) and is fast. The function f(ξ) is often a sine wave. Because of the symmetry of sinusoidal functions, only one-fourth of the waveform needs to be stored in memory (the portion from 0 to /2 radians). Because of Nyquist's sampling theorem, good sine waves approaching half the clock frequency can be made with a good low-pass filter following the function block. This leads to the rule of thumb that the clock frequency of the DDS generator will be about 2 to 2.5 times the maximum sine wave frequency. The ramp generator's frequency can be calculated from which shows that the ramp frequency is a fraction of the clock frequency, as /2N is a number between 0 and 1. Remember that is the counter increment value and N is the number of bits in the counter.

To summarize how a DDS function generator works: A digital ramp is generated and the desired waveform's shape is substituted for the ramp as discussed above. Let's look at the basic relationships between sample rate, period, and frequency for a DDS generator's waveform. Let Then we have the equations (1) Advantages and disadvantages of DDS Advantages: The frequency is tunable with sub-Hertz resolution. The phase is digitally adjustable. Conceptually simple design and low parts count (these help keep cost down). No drift due to temperature changes or aging of components (as long as the clock is stable). Addition of arbitrary waveform generation is not conceptually difficult. Disadvantages Output frequency is ≤ 1/2 the clock frequency. Amplitude is fixed; need external circuitry to change. Sine wave is sampled and not spectrally pure; distortion is present. With careful design, these disadvantages can be minimized. DDS generator capabilities A DDS generator's frequency is usually specified as the maximum sine wave output frequency. This is because the sine waves can be generated at nearly half the clock frequency.

Generating a square wave from a sine wave is conceptually easy: a comparator outputs a "1" when the sine wave's amplitude is greater than 0 and a "-1" when the sine wave's amplitude is less than 0. However, maintaining the fidelity of a square wave is harder because of the rich harmonic content -- the post-processing circuitry (e.g., amplitude adjustment) needs to be of a higher bandwidth than for a single sine wave. Thus, it is not uncommon to see the square wave maximum frequency to be half or less of the sine wave maximum frequency. A similar comment applies for pulse generation, where the spectral requirements can be even more demanding. Some function generators provide specialized waveforms as added features. These are additional functions f(ξ) that are stored in the generators read-only memory (ROM). They can be useful for specialized tasks. For example, a circuit designer working on a power supply filter can test with a full-wave rectified sine wave signal without needing a transformer and rectifier circuit. A geophysical researcher can input a low-level earthquake signal into a seismometer's circuit to test the system's response. A medical researcher can use the generator's cardiac signal as input to a circuit used for cardiac monitoring.

Since these specialized waveforms need to be generated accurately, their maximum output frequency will often be much less than the typical sine and square wave frequencies available from the generator. Arbitrary waveform generation With the counter and the function f(ξ) to turn the ramp into a desired waveform, it's not a large conceptual step to let the user define the function f(ξ). This results in an arbitrary waveform generator (AWG), although now the function f(ξ) needs to be stored in non-volatile writable memory rather than ROM. Figure 2 Using the above formulas, we can generate the following graph for the relationships between the number of samples in the waveform, the sampling rate, and the maximum waveform frequency an arbitrary waveform generator can output: You can use this graph to relate how much temporal "detail" you can put into an arbitrary waveform and the highest frequency the generator will be able to repetitively output the waveform. As an example, with a 100 MSa/s sampling rate, 100 kHz is the fastest you'll be able to play back a waveform with 1000 points in it. Some digital electronics users also use the term AWG to refer to a device that can output arbitrary streams of digital information.

Another name for these devices is pattern generator. However, a pattern generator is typically used in conjunction with a logic analyzer. A pattern generator may output digital information over 8, 16, or more parallel digital lines at once. They are often used in applying a known sequence of digital words to a digital system. The ability to define and generate custom waveforms is so useful that we will take a closer look at a typical arbitrary waveform generator (AWG) and some of its features in the next section. Arbitrary Waveform Generators Modern DDS function generators often come with the ability to generate arbitrary waveforms (the reason why is explained in the DDS Theory of Operations section on page 6). A function generator with the ability to generate arbitrary waveforms is the B&K 4078, as shown in the picture below. This is a generator with two independent output channels, which is a nice feature for stimulating two systems simultaneously. In this model, the two channels share a 4×105 byte memory for defining the arbitrary waveforms. Amplitude resolution is 14 bits.

This means the amplitude of the arbitrary waveforms vary between -(213-1) to +(213-1) or -8191 to 8191 (other AWGs require the programmed amplitude to be between -1.0 and 1.0). Amplitude resolution for the built-in waveforms is three digits (1000 counts). The generator is capable of 10 volts peak to peak output into 50 and ±5 volts of DC offset (the amount allowed depends on the amplitude setting). This generator can generate 1 Hz to 25 MHz sine and square waves, 1 Hz to 5 MHz triangle and ramp waveforms, and 1 mHz to 10 MHz pulses. AM, FM, and FSK modulation are available (AM modulation can also be done on the arbitrary waveforms). The instrument comes with a serial port and an optional IEEE-488 GPIB port. A handy feature on an AWG is a display screen that shows you an approximate picture of the arbitrary waveform. This can help protect against mistakes such as selecting the wrong waveform from memory.

The display only shows an approximation of the waveform, as it typically doesn't have enough resolution to show all of the points in the waveform. The only thing that gives you a clue that this instrument is different from a function generator (besides the title) is the ARB button (see red arrow in the above figure). This is used to access the AWG features through menus controlled by the F1-F4 keys. A user can typically get the instrument's memory loaded with an arbitrary waveform in one of three ways (we refer to the utility program for constructing waveforms included with the instrument as the "AWG application software"): Define it with the AWG application software and then use it to download the waveform to the generator. This is probably the most commonly-used method. The software gives you a variety of methods to construct the desired waveform, such as point-to-point drawing with the mouse, line drawing, etc. Create the waveform without using the AWG application software included with the instrument. This covers using custom-written programs and scripts to generate an appropriate data file. The waveform data can then be loaded with the AWG application software or can be directly downloaded to the instrument over the interface using the instrument's software commands.

Create and edit the waveform in the instrument's memory using the front panel controls of the instrument. Once the desired waveform is loaded into the instrument's memory, it can be used to generate an output waveform by selecting the arbitrary mode. The desired arbitrary waveform is designated (there are various methods depending on the generator), the frequency, amplitude, and DC offset are set, and the waveform is generated. The user may then have the usual tools of triggering, gating, bursts, modulation, etc. with which to control the output (the features can vary -- check the instruction manual). Applications Response testing with function generators Stimulus-response testing is widely used to characterize behavior. Because many physical phenomena can be converted to and from electrical signals, a function generator is a good general-purpose stimulus source. Frequency response measurement A function generator can be used to characterize the frequency response of a system. This can be done manually, but it is labor-intensive and prone to errors. The operator sets the frequency, then measures the system's response. The results can be plotted with frequency on the horizontal axis and the response on the vertical axis. If the phase response can also be measured, a Bode plot of the system's response can be made.

Modern function generators often have the ability to sweep the frequency of the output signal. This is a fast way to characterize frequency-dependent behavior because it's easy to set up and display on an oscilloscope. We will briefly discuss how this can be done with older analog equipment, and then look at how it's done with modern DDS generators and digital oscilloscopes. Using analog equipment Older function generators often have an output terminal for a DC voltage that is proportional to the frequency. This can be used to drive the oscilloscope's horizontal axis (the scope needs to be put into the x-y display mode). If such a terminal is not available, you'll need to acquire or fabricate a frequency to voltage converter. Example integrated circuits that can be used for this task are the Analog Devices AD650, the National LM2907, or the Microchip TC9400. If you wish the horizontal axis to be logarithmic, you'll also need a logarithmic amplifier. While these techniques can be used, in practice they can be time consuming. Depending on the sweep rate, you may need a storage scope or one with variable persistence. Very low sweep rates can benefit from an x-y recorder or chart recorder.

An alternate technique is to set the function generator's sweep time to a value that is the same as one of the calibrated timebase settings of the oscilloscope and use the normal timebase of the oscilloscope instead of making an x-y plot. This technique is discussed in the next section. Using DDS generators and digital oscilloscopes Since the sweep time of the generator can be set to a specific value, it is easiest to set it to a calibrated timebase setting of the oscilloscope. Then the scope is swept normally and the system's response is input to the scope's vertical channel. Here's a procedure to generate a frequency response plot on an oscilloscope: Set the function generator's amplitude to a minimum. Connect the function generator to the system to be tested. Set the function generator to the waveform you wish to sweep with (a sine wave is commonly used). Ensure the amplitude is appropriate for all the frequencies you will be sweeping over. Set the sweep start frequency, stop frequency, and sweep time. Choose a sweep time that is the same as one available on the oscilloscope. Connect the output of the system to a vertical channel of the oscilloscope.

You may be able to use the sync signal from the generator to trigger the scope, as it should occur at the beginning of the sweep. You will have to check this, as not all function generators operate this way. If not, the function generator can be manually triggered for one sweep and the oscilloscope set up to capture this single sweep. Increase the amplitude of the function generator's output signal until you get an adequate frequency response plot on the oscilloscope. You may have to slightly adjust the scope's timebase or horizontal position to get an acceptable display. With a little practice, this should be quick to set up and get a frequency response plot. The plot can be saved to document your work. The following scope trace shows the frequency response of an RC low-pass filter where R = 3 k and C = 95 nF (calculated 3 dB point is ). The start frequency was 100 Hz and the stop frequency was 2 kHz. System response testing with square wave A square wave contains only odd harmonics of the fundamental frequency. The harmonics' amplitudes fall off as 1/n, where n is the multiple of the fundamental frequency.

Thus, a fast rise time square wave is a wide bandwidth signal and can be quickly used to characterize a system's behavior, for instance that of an amplifier. The interpretations given here assume the system under test is linear, time-invariant, and not a narrow-band system. Testing a system that isn't linear and time-invariant with square waves can of course still be done, but the interpretation of the output waveforms may be different than given here. The connections for square wave testing are as follows: The following waveform shapes give you clues about the system behavior: Arbitrary waveform generator examples Exact stimulation A common use of an arbitrary waveform generator is to stimulate a system with a complex waveform. These complex waveforms can be calculated ("exact") or be digitized signals from e.g. an oscilloscope. In this section, we will look at generating an exact waveform; the next section shows the use of a digitized waveform. Fine adjustments can be made to the waveform's shape, and the system designer can see the effects of incremental changes. The example we will use here is a normal sine wave with a spike on each peak.

The AWG used was the B&K 4078 and the oscilloscope used was the B&K 2534 60 MHz digital storage oscilloscope. It would be time consuming to develop an analog or digital circuit to generate this sine + spike waveform, but is almost trivial with an arbitrary waveform generator. While the software application that accompanies the AWG can be used to generate the waveform, the author prefers using a script or program because it gives exact control over all parts of the wave. Here's a python script (you can freely get python from ) that prints the desired waveform to standard out, which can then be downloaded to the AWG: from __future__ import division for i in range(num_points + 1): x = i/num_points # Fraction along X axis y = int(amplitude*sin(2*pi*x)) if not positive_done and abs(x - 1/4) < threshold: positive_done = True if not negative_done and abs(x - 3/4) < threshold: negative_done = True y = -peak_amplitude print str(y) This script was run in a console as python sine_spike.py >sine_spike.txt.

The file sine_spike.txt was opened in the AWG's software program and downloaded to the generator. The following figure shows what the waveform looks like when plotted on the computer. The following picture shows what the waveform looked like on the oscilloscope when the frequency on the 4078 generator was set to 60 Hz and the amplitude was set to 1 volt. Measurement cursors on the oscilloscope showed that the voltage between the top of the positive spike and bottom of the negative spike was 1.01 volts, which confirms the desired output (the AWG's output was terminated into 50 at the scope's input). The scope showed that the width of the pulse at the peak was 16.7 s. This was correct, as the AWG stated that the time per point was 16.66 s. Changing the frequency of the waveform to 1 kHz, the AWG stated the time per point was 1.00 s and it was measured on the scope at the same value. The AWG was able to display this waveform up to 99.6 kHz before stating there was a setting conflict, meaning the asked-for waveform was beyond the generator's sampling frequency.

This is equal to the 100 kHz predicted by Figure 2 because the number of points in the waveform was 1000. This sine + spike waveform only consumed 0.025% of the AWG's waveform memory, so much more detail could have been shown in a waveform. Alternately, fewer than 1000 points could have been used -- this would have allowed the sine + spike to be displayed at a higher frequency than 99.6 kHz, although the spike width would have been larger because the sampling rate of the generator is fixed at 100 MSa/s. An advantage of using a script to generate the waveform is that it is straightforward to modify the waveform and download it to the function generator. Combined with an amplifier that would increase this signal's amplitude to line voltage and power levels, one can see that this is a powerful tool for measuring the effects of power line noise. Other scripts could be used to generate other types of noise and build a library of distorted power line voltages. Many AWGs have screens that will allow you to examine the downloaded waveform. This is a valuable feature, as you can verify the waveform selected for output.

Be aware, however, that displaying the short transients shown on the waveform example we are using here may or may not be displayed on the AWG's screen because of limited display resolution. The marker output terminal on the back of the AWG was used to get a TTL trigger pulse occurring at a specific point on the sine + spike curve. The marker was set to trigger at point 250 of the waveform (this is one point before the spike) and the pulse width was set to 10 sample points wide; see the following figure. This made the rising edge of the marker pulse occur 1.0 s before the spike. This could be useful in triggering an oscilloscope to examine a system's behavior right when the spike occurs. (Note: in the following figure, the waveform was being displayed at 1 kHz.) Since the position of the marker is controlled from the AWG's control panel, immediate and fine control can be had over the marker's position and width. This makes the availability of the marker signal very useful. There are two important points to be made here about using AWGs. First, it is best if you define your waveform so that there are no discontinuities created when the waveform is repeated by the AWG.

A discontinuity is created if the last point of the waveform is not the same as the first. If such a discontinuity is created, the frequency content of the generated wave may be much larger than you intended. The second important point is that you should use, if possible, all of the generator's vertical resolution when defining a waveform. In the simulated bouncing switch in the next section, only half of the vertical range was used (the positive half). For a more realistic simulation, the full range would have been used. However, to duplicate the 0 to 1 volt signal seen on the real switch, a DC offset of half the peak-to-peak amplitude would have to be added to the waveform. Generating noise signals In real life applications, noise is inherent in nature and exists in electronic devices. For this reason, it is often important to have a noise signal inject into a device under test (DUT) to test its behavior in a more realistic simulated scenario. There are various types of noises, and two of the most common types are white noise and pink noise. With the capabilities of an AWG, these noise can be approximately simulated at the output of the generator.

White noise has a flat power spectrum and equal power per unit frequency, while pink noise has equal power per octave. If you choose to test an audio system using noise, use pink noise, as you might put too much energy into the tweeters if you use white noise. Pink noise in an audio system is useful because if you listen carefully and hear sounds that don't sound like noise, you may have found an imperfection in the audio system's response. One simple way to create a white noise signal is to use a B&K Precision model 4075. This AWG comes with a built-in function to generate random noise, in addition to giving user custom controls to scale as well as define the resolution or length of the signal. Generating long delayed signals Many function generators often have a time range that allows you to create a pulse or a signal with a time delay. Often the limits are confined to a certain amount of seconds. For some applications that require an extended delay, often the user must have a function generator that can be programmable with software to control the delay. A better alternative would be to use AWGs, as they become very useful for such applications.

For example, the 4076 have arbitrary waveform memory that allows waveform creation up to 4 million points. With the vast amount of memory, an extended delay can be created without the need for software control. The user can create their desired waveform and configure their delay time based on a set number of points, which can be quickly setup from the front panel of the instrument. With its large memory, the 4076 can create a signal with a delay of over a year or more! Captured waveform stimulation Transient events are all around us and can be hard to duplicate, yet we may need to reliably and repeatedly duplicate them for testing purposes. Capturing a transient on a scope, downloading it to an arbitrary waveform generator, then using the AWG to generate the transient makes this duplication almost a simple task. We will use the simple example of contact bounce of a mechanical switch. The following figure shows a trace captured of contact bounce (a microswitch connected to a DC power supply set to 1 volt) over a period of 3 ms: M.

Schwartz, Information Transmission, Modulation, and Noise, 2nd ed., McGraw-Hill, 1970, ISBN 07-055761-6. W. Beyer, CRC Standard Mathematical Tables, 26th ed., CRC Press, 1981. Wikipedia. Web. 22 Mar. 2010. < B&K Precision. Web. 22 Mar. 2010. < Appendix 1: Glossary Note: the following terms are defined in the context of function generators. Some may have additional meanings in other areas of electronics. AM Amplitude modulation. The process of varying the amplitude of one signal in accordance with the amplitude of another. Typically, the signal being varied is a continuous sine wave, modulated by a lower frequency signal. Amplitude Magnitude of a waveform. Common amplitude are measured in volts peak-to-peak (Vp-p) or volts RMS (Vrms) (root mean square). Amplitude resolution The minimal change or digits of precision in the amplitude of a waveform that can be made. Analog function generator Before digital function generators became popular and economical, analog electronics were used to generate signals.

The number of components tended to be much higher than digital generators and the analog electronics suffered from thermal drift and component aging much more so than digital generators do. It also lacks the ability to control the waveform's parameters with higher precision. Arbitrary function generator A function generator that allows the user to create or upload custom waveforms to the generator and provide them at user-defined frequencies. These generators will often include capabilities to provide common function generator waveforms such as sine, square, and triangle waves. Attenuation A reduction in signal amplitude, usually expressed in decibels (dB). If given in dB, you will have to know whether it's referring to power, voltage, current, etc. AWG Symbol for volts RMS. Waveform The output of a function generator; the term usually applies to a graphical representation of that output on an oscilloscope screen. Appendix 2: DDS Simulation We can simulate a DDS system as described in the theory section in software. Here's a python ( ) script that simulates a small DDS system generating a sine wave. The counter has 10 bits (2n = 1024) and , the counter increment value, is 32.

(Note: changing n won't change the output, as delta changes accordingly.) from math import sin, pi n = 10 # Number of bits in counter delta = 2**(n-4) # Count increment def f(x): Digital Audio DIGITAL AUDIO Cycling '74 and IRCAM, December 1997 Sound Simple harmonic motion The sounds we hear are fluctuations in air pressure--tiny variations from normal atmospheric pressure--caused by vibrating objects. (Well, technically it could be water pressure if you're listening underwater, but please keep your computer out of the swimming pool.) As an object moves, it displaces air molecules next to it, which in turn displace air molecules next to them, and so on, resulting in a momentary "high pressure front" that travels away from the moving object (toward your ears). So, if we cause an object to vibrate--we strike a tuning fork, for example--and then measure the air pressure at some nearby point with a microphone, the microphone will detect a slight rise in air pressure as the "high pressure front" moves by.

Since the tine of the tuning fork is fairly rigid and is fixed at one end, there is a restoring force pulling it back to its normal position, and because this restoring force gives it momentum it overshoots its normal position, moves to the opposite extreme position, and continues vibrating back and forth in this manner until it eventually loses momentum and comes to rest in its normal position. As a result, our microphone detects a rise in pressure, followed by a drop in pressure, followed by a rise in pressure, and so on, corresponding to the back and forth vibrations of the tine of the tuning fork. If we were to draw a graph of the change in air pressure detected by the microphone over time, we would see a sinusoidal shape (a sine wave) rising and falling, corresponding to the back and forth vibrations of the tuning fork. Sinusoidal change in air pressure caused by a simple vibration back and forth This continuous rise and fall in pressure creates a wave of sound. The amount of change in air pressure, with respect to normal atmospheric pressure, is called the wave's amplitude (literally, its "bigness").

We most commonly use the term "amplitude" to refer to the peak amplitude, the greatest change in pressure achieved by the wave. This type of simple back and forth motion (seen also in the swing of a pendulum) is called simple harmonic motion. It's considered the simplest form of vibration because the object completes one full back-and-forth cycle at a constant rate. Even though its velocity changes when it slows down to change direction and then gains speed in the other direction--as shown by the curve of the sine wave--its average velocity from one cycle to the next is the same. Each complete vibratory cycle therefore occurs in an equal interval of time (in a given period ,of time), so the wave is said to be periodic. The number of cycles that occur in one second is referred to as the frequency of the vibration. For example, if the tine of the tuning fork goes back and forth 440 times per second, its frequency is 440 cycles per second, and its period is 1/440 second per cycle.

In order for us to hear such fluctuations of pressure: a) The fluctuations must be substantial enough to affect our timpanic membrane (eardrum), yet not so substantial as to hurt us. In practice, the intensity of the changes in air pressure must be greater than about one billionth of the atmospheric pressure, but not greater than about one thousandth of atmospheric pressure. You'll never actually need that information, but there it is. It means that the softest sound we can hear has about one millionth the intensity of the loudest sound we can bear. That's quite a wide range of possibilities. b) The fluctuations must repeat at a regular rate fast enough for us to perceive them as a sound (rather than as individual events), yet not so fast that it exceeds our ability to hear it. Textbooks usually present this range of audible frequencies as 20 to 20,000 cycles per second (cps, also known as hertz, abbreviated Hz). Your own mileage may vary. If you are approaching middle age or have listened to too much loud music, you may top out at about 17,000 Hz or even lower.

Complex tones An object that vibrates in simple harmonic motion is said to have a resonant mode of vibration--a frequency at which it will naturally tend to vibrate when set in motion. However, most real-world objects have several resonant modes of vibration, and thus vibrate at many frequencies at once. Any sound that contains more than a single frequency (that is, any sound that is not a simple sine wave) is called a complex tone. Let's take a stretched guitar string as an example. A guitar string has a uniform mass across its entire length, has a known length since it is fixed at both ends (at the "nut" and at the "bridge"), and has a given tension depending on how tightly it is tuned with the tuning peg. Because the string is fixed at both ends, it must always be stationary at those points, so it naturally vibrates most widely at its center. A plucked string vibrating in its fundamental resonant mode The frequency at which it vibrates depends on its mass, its tension, and its length. These traits stay fairly constant over the course of a note, so it has one fundamental frequency at which it vibrates. However, other modes of vibration are still possible.

Some other resonant modes of a stretched string The possible modes of vibration are constrained by the fact that the string must remain stationary at each end. This limits its modes of resonance to integer divisions of its length. This mode of resonance would be impossible because the string is fixed at each end Because the tension and mass are set, integer divisions of the string's length result in integer multiples of the fundamental frequency. Each resonant mode results in a different frequency In fact, a plucked string will vibrate in all of these possible resonant modes simultaneously, creating energy at all of the corresponding frequencies. Of course, each mode of vibration (and thus each frequency) will have a different amplitude. (In the example of the guitar string, the longer segments of string have more freedom to vibrate.) The resulting tone will be the sum of all of these frequencies, each with its own amplitude. As the string's vibrations die away due to the damping force of the fixture at each end, each frequency may die away at a different rate. In fact, in many sounds the amplitudes of the different component frequencies may vary quite separately and differently from each other.

This variety seems to be one of the fundamental factors in our perception of sounds as having different tone color (i.e., timbre), and the timbre of even a single note may change drastically over the course of the note. Harmonic tones The combination of frequencies--and their amplitudes--that are present in a sound is called its spectrum (just as different frequencies and intensities of light constitute a color spectrum). Each individual frequency that goes into the makeup of a complex tone is called a partial. (It's one part of the complete tone.) When the partials (component frequencies) in a complex tone are all integer multiples of the same fundamental frequency, as in our example of a guitar string, the sound is said to have a harmonic spectrum. Each component of a harmonic spectrum is called a harmonic partial, or simply a harmonic. The sum of all those harmonically related frequencies still results in a periodic wave having the fundamental frequency. The integer multiple frequencies thus fuse "harmoniously" into a single tone.

The sum of harmonically related frequencies still repeats at the fundamental frequency This fusion is supported by the famous mathematical theorem of Jean-Baptiste Joseph Fourier, which states that any periodic wave, no matter how complex, can be demonstrated to be the sum of different harmonically related frequencies (sinusoidal waves), each having its own amplitude and phase. (Phase is an offset in time by some fraction of a cycle.) Harmonically related frequencies outline a particular set of related pitches in our musical perception. Harmonic partials of a fundamental frequency f, where f = 65.4 Hz = the pitch low C Each time the fundamental frequency is multiplied by a power of 2--2, 4, 8, 16, etc.--the perceived musical pitch increases by one octave. All cultures seem to share the perception that there is a certain "sameness" of pitch class between such octave-related frequencies. The other integer multiples of the fundamental yield new musical pitches. Whenever you're hearing a harmonic complex tone, you're actually hearing a chord! As we've seen, though, the combined result repeats at the fundamental frequency, so we tend to fuse these frequencies together such that we perceive a single pitch.

Inharmonic tones and noise Some objects--such as a bell, for instance--vibrate in even more complex ways, with many different modes of vibrations which may not produce a harmonically related set of partials. If the frequencies present in a tone are not integer multiples of a single fundamental frequency, the wave does not repeat periodically. Therefore, an inharmonic set of partials does not fuse together so easily in our perception. We may be able to pick out the individual partials more readily, and--especially when the partials are many and are completely inharmonic--we may not perceive the tone as having a single discernible fundamental pitch. When a tone is so complex that it contains very many different frequencies with no apparent mathematical relationship, we perceive the sound as noise. A sound with many completely random frequencies and amplitudes--essentially all frequencies present in equal proportion--is the static-like sound known as white noise (analogous to white light which contains all frequencies of light). So, it may be useful to think of sounds as existing on a continuum from total purity and predictability (a sine wave) to total randomness (white noise). Most sounds are between these two extremes.

An harmonic tone--a trumpet or a guitar note, for example--is on the purer end of the continuum, while a cymbal crash is closer to the noisy end of the continuum. Timpani and bells may be just sufficiently suggestive of a harmonic spectrum that we can identify a fundamental pitch, yet they contain other inharmonic partials. Other drums produce more of a band-limited noise--randomly related frequencies, but restricted within a certain frequency range--giving a sense of pitch range, or non-specific pitch, rather than an identifiable fundamental. It is important to keep this continuum in mind when synthesizing sounds. Amplitude envelope Another important factor in the nearly infinite variety of sounds is the change in over-all amplitude of a sound over the course of its duration. The shape of this macroscopic over-all change in amplitude is termed the amplitude envelope. The initial portion of the sound, as the amplitude envelope increases from silence to audibility, rising to its peak amplitude, is known as the attack of the sound. The envelope, and especially the attack, of a sound are important factors in our ability to distinguish, recognize, and compare sounds.

We have very little knowledge of how to read a graphic representation of a sound wave and hear the sound in our head the way a good sightreader can do with musical notation. However, the amplitude envelope can at least tell us about the general evolution of the loudness of the sound over time. The amplitude envelope is the evolution of a sound's amplitude over time Amplitude and loudness The relationship between the objectively measured amplitude of a sound and our subjective impression of its loudness is very complicated and depends on many factors. Without trying to explain all of those factors, we can at least point out that our sense of the relative loudness of two sounds is related to the ratio of their intensities, rather than the mathematical difference in their intensities. For example, on an arbitrary scale of measurement, the relationship between a sound of amplitude 1 and a sound of amplitude 0.5 is the same to us as the relationship between a sound of amplitude 0.25 and a sound of amplitude 0.125.

The subtractive difference between amplitudes is 0.5 in the first case and 0.125 in the second case, but what concerns us perceptually is the ratio, which is 2:1 in both cases. Does a sound with twice as great an amplitude sound twice as loud to us? In general, the answer is "no". First of all, our subjective sense of "loudness" is not directly proportional to amplitude. Experiments find that for most listeners, the (extremely subjective) sensation of a sound being "twice as loud" requires a much greater than twofold increase in amplitude. Furthermore, our sense of loudness varies considerably depending on the frequency of the sounds being considered. We're much more sensitive to frequencies in the range from about 300 Hz to 7,000 Hz than we are to frequencies outside that range. (This might possibly be due evolutionarily to the importance of hearing speech and many other important sounds which lie mostly in that frequency range.) Nevertheless, there is a correlation--even if not perfectly linear--between amplitude and loudness, so it's certainly informative to know the relative amplitude of two sounds.

As mentioned earlier, the softest sound we can hear has about one millionth the amplitude of the loudest sound we can bear. Rather than discuss amplitude using such a wide range of numbers from 0 to 1,000,000, it is more common to compare amplitudes on a logarithmic scale. The ratio between two amplitudes is commonly discussed in terms of decibels (abbreviated dB). A level expressed in terms of decibels is a statement of a ratio relationship between two values--not an absolute measurement.

If we consider one amplitude as a reference which we call A0, then the relative amplitude of another sound in decibels can be calculated with the equation: level in decibels = 20 log10 (A/A0) If we consider the maximum possible amplitude as a reference with a numerical value of 1, then a sound with amplitude 0.5 has 1/2 the amplitude (equal to 10 to the -0.3 power) so its level is 20 log10 (0.5/1) = 20 (-0.3) = -6 dB Each halving of amplitude is a difference of about -6 dB; each doubling of amplitude is an increase of about 6 dB. So, if one amplitude is 48 dB greater than another, one can estimate that it's about 2 to the 8th power (256) times as great. Summary A theoretical understanding of sine waves, harmonic tones, inharmonic complex tones, and noise, as discussed here, is useful to understanding the nature of sound. However, most sounds are actually complicated combinations of these theoretical descriptions, changing from one instant to another.

For example, a bowed string might include noise from the bow scraping against the string, variations in amplitude due to variations in bow pressure and speed, changes in the prominence of different frequencies due to bow position, changes in amplitude and in the fundamental frequency (and all its harmonics) due to vibrato movements in the left hand, etc. A drum note may be noisy but might evolve so as to have emphases in certain regions of its spectrum that imply a harmonic tone, thus giving an impression of fundamental pitch. Examination of existing sounds, and experimentation in synthesizing new sounds, can give insight into how sounds are composed. The computer provides that opportunity. Digital representation of sound Sampling and quantizing a sound wave To understand how a computer represents sound, consider how a film represents motion. A movie is made by taking still photos in rapid sequence at a constant rate, usually twenty-four frames per second. When the photos are displayed in sequence at that same rate, it fools us into thinking we are seeing continuous motion, even though we are actually seeing twenty-four discrete images per second. Digital recording of sound works on the same principle.

We take many discrete samples of the sound wave's instantaneous amplitude, store that information, then later reproduce those amplitudes at the same rate to create the illusion of a continuous wave. The job of a microphone is to transduce (convert one form of energy into another) the change in air pressure into an analogous change in electrical voltage. This continuously changing voltage can then be sampled periodically by a process known as sample and hold. At regularly spaced moments in time, the voltage at that instant is sampled and held constant until the next sample is taken. This reduces the total amount of information to a certain number of discrete voltages. Time-varying voltage sampled periodically A device known as an analog-to-digital converter (ADC) receives the discrete voltages from the sample and hold device, and ascribes a numerical value to each amplitude. This process of converting voltages to numbers is known as quantization. Those numbers are expressed in the computer as a string of binary digits (1 or 0). The resulting binary numbers are stored in memory--usually on a digital audio tape, a hard disk, or a laser disc.

To play the sound back, we read the numbers from memory, and deliver those numbers to a digital-to-analog converter (DAC) at the same rate at which they were recorded. The DAC converts each number to a voltage, and communicates those voltages to an amplifier to increase the amplitude of the voltage. In order for a computer to represent sound accurately, many many samples must be taken per second--many more than are necessary for filming a visual image. In fact, we need to take more than twice as many samples as the highest frequency we wish to record. (For an explanation of why this is so, see Limitations of Digital Audio below.) If we want to record frequencies as high as 20,000 Hz, we need to sample the sound at least 40,000 times per second. The standard for compact disc recordings (and for "CD-quality" computer audio) is to take 44,100 samples per second for each channel of audio. The number of samples taken per second is known as the sampling rate. This means the computer can only accurately represent frequencies up to half the sampling rate. Any frequencies in the sound that exceed half the sampling rate must be filtered out before the sampling process takes place.

This is accomplished by sending the electrical signal through a low-pass filter which removes any frequencies above a certain threshold. Also, when the digital signal (the stream of binary digits representing the quantized samples) is sent to the DAC to be re-converted into a continuous electrical signal, the sound coming out of the DAC will contain spurious high frequencies that were created by the sample and hold process itself. (These are due to the "sharp edges" created by the discrete samples, as seen in the above example.) Therefore, we need to send the output signal through a low-pass filter, as well. The digital recording and playback process, then, is a chain of operations, as represented in the following diagram. Digital recording and playback process Limitations of digital audio Sampling rate and Nyquist frequency We've noted that it's necessary to take at least twice as many samples as the highest frequency we wish to record. This was proven by Harold Nyquist, and is known as the Nyquist theorem. Stated another way, the computer can only accurately represent frequencies up to half the sampling rate. One half the sampling rate is often referred to as the Nyquist frequency.

If we take, for example, 16,000 samples of an audio signal per second, we can only capture frequencies up to 8,000 Hz. Any frequencies higher than the Nyquist frequency are perceptually "folded" back down into the range below the Nyquist frequency. So, if the sound we were trying to sample contained energy at 9,000 Hz, the sampling process would misrepresent that frequency as 7,000 Hz--a frequency that might not have been present at all in the original sound. This effect is known as foldover or aliasing. The main problem with aliasing is that it can add frequencies to the digitized sound that were not present in the original sound, and unless we know the exact spectrum of the original sound there is no way to know which frequencies truly belong in the digitized sound and which are the result of aliasing. That's why it's essential to use the low-pass filter before the sample and hold process, to remove any frequencies above the Nyquist frequency. To understand why this aliasing phenomenon occurs, think back to the example of a film camera, which shoots 24 frames per second.

If we're shooting a movie of a car, and the car wheel spins at a rate greater than 12 revolutions per second, it's exceeding half the "sampling rate" of the camera. The wheel completes more than 1/2 revolution per frame. If, for example it actually completes 18/24 of a revolution per frame, it will appear to be going backward at a rate of 6 revolutions per second. In other words, if we don't witness what happens between samples, a 270-degree revolution of the wheel is indistinguishable from a -90-degree revolution. The samples we obtain in the two cases are precisely the same. For the camera, a revolution of 18/24 is no different from a revolution of -6/24 For audio sampling, the phenomenon is practically identical. Any frequency that exceeds the Nyquist frequency is indistinguishable from a negative frequency the same amount less than the Nyquist frequency. (And we do not distinguish perceptually between positive and negative frequencies.) To the extent that a frequency exceeds the Nyquist frequency, it is folded back down from the Nyquist frequency by the same amount. For a demonstration, consider the next two examples.

The following example shows a graph of a 4,000 Hz cosine wave (energy only at 4,000 Hz) being sampled at a rate of 22,050 Hz. 22,050 Hz is half the CD sampling rate, and is an acceptable sampling rate for sounds that do not have much energy in the top octave of our hearing range. In this case the sampling rate is quite adequate because the maximum frequency we are trying to record is well below the Nyquist frequency. A 4,000 Hz cosine wave sampled at 22,050 Hz Now consider the same 4,000 Hz cosine wave sampled at an inadequate rate, such as 6,000 Hz. The wave completes more than 1/2 cycle per sample, and the resulting samples are indistinguishable from those that would be obtained from a 2,000 Hz cosine wave. A 4,000 Hz cosine wave undersampled at 6,000 Hz The simple lesson to be learned from the Nyquist theorem is that digital audio cannot accurately represent any frequency greater than half the sampling rate.

Any such frequency will be misrepresented by being folded over into the range below half the sampling rate. Precision of quantization Each sample of an audio signal must be ascribed a numerical value to be stored in the computer. The numerical value expresses the instantaneous amplitude of the signal at the moment it was sampled. The range of the numbers must be sufficiently large to express adequately the entire amplitude range of the sound being sampled. The range of possible numbers used by a computer depends on the number of binary digits (bits) used to store each number. A bit can have one of two possible values: either 1 or 0. Two bits together can have one of four possible values: 00, 01, 10, or 11. As the number of bits increases, the range of possible numbers they can express increases by a power of two. Thus, a single byte (8 bits) of computer data can express one of 2 to the 8th power = 256 possible numbers. If we use two bytes to express each number, we get a much greater range of possible values because 2 to the 16th power = 65,536.

The number of bits used to represent the number in the computer is important because it determines the resolution with which we can measure the amplitude of the signal. If we use only one byte to represent each sample, then we must divide the entire range of possible amplitudes of the signal into 256 parts since we have only 256 ways of describing the amplitude. Using one byte per sample, each sample can have one of only 256 different possible values For example, if the amplitude of the electrical signal being sampled ranges from -10 volts to +10 volts and we use one byte for each sample, each number does not represent a precise voltage but rather a 0.078125 V portion of the total range. Any sample that falls within that portion will be ascribed the same number. This means each numerical description of a sample's value could be off from its actual value by as much as half that amount (0.0390625V), which is 1/512 of the total amplitude range (-10V to +10V), and is 1/256 of the maximum amplitude of 10V.

In practice, each sample will be off by some random amount from 0 to 1/256 of the maximum amplitude. This is called quantization error. It is unavoidable, but it can be reduced to an acceptable level by using more bits to represent each number. If we use two bytes (16 bits) per sample, the quantization error will be only 1/65,356 of the maximum signal amplitude. Since the quantization error for each sample is usually random (sometimes a little too high, sometimes a little too low), we generally hear the effect of quantization error as white noise. This noise is not present in the original signal. It is added into the digital signal by the imprecise nature of quantization. This is called quantization noise. The ratio of the maximum signal amplitude to the maximum quantization error is called the signal-to-quantization-noise-ratio (SQNR). The SQNR is equal to 2 to the n power, where n is the number of bits used to quantize each sample. It is usually expressed in decibels. As a rule of thumb, each bit of precision used in quantization adds 6 dB to the SQNR.

Therefore, sound quantized with 8-bit numerical precision will have a best case SQNR of about 48 dB. This is adequate for cases where fidelity is not important, but is certainly not desirable for music or other critical purposes. Sound sampled with 16-bit precision ("CD-quality") has a SQNR of 96 dB, which is quite good--much better than traditional tape recording. In short, the more bits used by the computer to store each sample, the better the potential ratio of signal to noise. Memory and storage We have seen that the standard sampling rate for high-fidelity audio is 44,100 samples per second. We've also seen that 16 bits (2 bytes) are needed per sample to achieve a good signal-to-noise ratio. With this information we can calculate the amount of data needed for digital audio: 44,100 samples per second, times 2 bytes per sample, times 2 channels for stereo, times 60 seconds per minute equals more than 10 megabytes of data per minute of CD-quality audio.

For this quality of audio, a high-density floppy disk holds less than 8 seconds of sound, and a 100 MB Zip cartridge holds less than 10 minutes. Clearly, the memory and storage requirements of digital audio are substantial. Fortunately, a compact disc holds over an hour of stereo sound, and a computer hard disk of at least 1 gigabyte is standard for audio recording and processing. Clipping If the amplitude of the incoming electrical signal exceeds the maximum amplitude that can be expressed numerically, the digital signal will be a clipped-off version of the actual sound. A signal that exceeds maximum amplitude will be clipped when it is quantized The clipped sample will often sound quite different from the original. Sometimes this type of clipping causes only a slight distortion of the sound that is heard as a change in timbre. More often though, it sounds like a very unpleasant noise added to the sound. For this reason, it's very important to take precautions to avoid clipping. The amplitude of the electrical signal should not exceed the maximum expected by the ADC. It's also possible to produce numbers in the computer that exceed the maximum expected by the DAC. This will cause the sound that comes out of the DAC to be a clipped version of the digital signal.

Clipping by the DAC is just as bad as clipping by the ADC, so care must be taken not to generate a digital signal that goes beyond the numerical range the DAC is capable of handling. Advantages of digital audio Synthesizing digital audio Since a digital representation of sound is just a list of numbers, any list of numbers can theoretically be considered a digital representation of a sound. In order for a list of numbers to be audible as sound, the numerical values must fluctuate up and down at an audio rate. We can listen to any such list by sending the numbers to a DAC where they are converted to voltages. This is the basis of computer sound synthesis. Any numbers we can generate with a computer program, we can listen to as sound. Many methods have been discovered for generating numbers that produce interesting sounds. One method of producing sound is to write a program that repeatedly solves a mathematical equation containing two variables. At each repetition, a steadily increasing value is entered for one of the variables, representing the passage of time. The value of the other variable when the equation is solved is used as the amplitude for each moment in time. The output of the program is an amplitude that varies up and down over time.

For example, a sine wave can be produced by repeatedly solving the following algebraic equation, using an increasing value for n: y = A sin(2(pi)fn/R+w) where A is the amplitude of the wave, f is the frequency of the wave, n is the sample number (0,1, 2,3, etc.), R is the sampling rate, and w is the phase. If we enter values for A, f,and w, and repeatedly solve for y while increasing the value of n, the value of y (the output sample) will vary sinusoidally. A complex tone can be produced by adding sinusoids--a method known as additive synthesis: y = A1 sin(2(pi)f1n/R+w1) + A2 sin(2(pi)f2n/R+w2) + ... This is an example of how a single algebraic expression can produce a sound. Naturally, many other more complicated programs are possible. Manipulating digital signals Any sound in digital form--whether it was synthesized by the computer or was quantized from a "real world" sound--is just a series of numbers. Any arithmetic operation performed with those numbers becomes a form of audio processing.

For example, multiplication is equivalent to audio amplification. Multiplying each number in a digital signal by 2 doubles the amplitude of the signal (increases it 6 dB). Multiplying each number in a signal by some value between 0 and 1 reduces its amplitude. Addition is equivalent to audio mixing. Given two or more digital signals, a new signal can be created by adding the first numbers from each signal, then the second numbers, then the third numbers, and so on. An echo can be created by recalling samples that occurred earlier and adding them to the current samples. For example, whatever signal was sent out 1000 samples earlier could be sent out again, combined with the current sample. y = xn + A yn-1000 As a matter of fact, the effects that such operations can have on the shape of a signal (audio or any other kind) are so many and varied that they comprise an entire branch of electrical engineering called digital signal processing (DSP). DSP is concerned with the effects of digital filters--formulae for modifying digital signals by combinations of delay, multiplication, addition, and other numerical operations.

Summary This chapter has described how the continuous phenomenon of sound can be captured and faithfully reproduced as a series of numbers, and ultimately stored in computer memory as a stream of binary digits. There are many benefits obtainable only by virtue of this digital representation of sound: higher fidelity recording than was previously possible, synthesis of new sounds by mathematical procedures, application of digital signal processing techniques to audio signals, etc.

Question: What describes a variable signal that is continuous in time and amplitude, that can be seen as the opposite of "digital"?
Answer: Analogue