Ring modulation is a special case of amplitude modulation that produces sum and difference frequencies of the components. Ring modulation is produced by multiplying waveforms, but the effect is also produced if one wave is used as the amplitude of the other. The first (amplitude) waveform is referred to as the modulator (fm) and the wave affected as the carrier (fc). If two sine waves are used, the resulting frequencies are simply fc + fm and fc - fm. If the carrier is a complex spectrum containing many harmonic partials, then fm is added to and subtracted from each of the components. The original frequencies, fc and fm, and not present in the output. In most classic examples of ring modulation, the modulator is a sine wave, but it can be any spectrum. Also, since the process produces the sums and differences of all the components, it doesn't really matter which one is referred to as the carrier and modulator (unlike frequency modulation).
Care must be taken to ensure that the resulting frequencies do not exceed the Nyquist frequency (½ of the sampling rate) or produce subsonic frequencies below 20 Hz. The latter won't be heard, but the former will fold over to produce unrelated frequencies. Negative frequencies are also reflected into positive frequencies 180 degrees out of phase, but negative frequencies are only a factor if large values of fm are used. While it may not be desirable to produce subsonic frequencies in the output, subsonic frequencies may be useful as a modulator, such as, for example to produce a thick band of harmonics 10 Hz above and below the partials of a wave. To avoid amplitude scaling that quickly exceeds the quantization limit, it is best to use amplitudes of 1 for each of the signals and multiply by the normal amplitude value after processing, or simply to use the normal amplitude value for one of the signals and feed that into the other.
Ring modulation is normally used to "distort" a harmonic wave, shifting its partials both up and down into inharmonic spectra. If the frequency of the modulator varies, the pattern of sounds moving both up and down can be heard. If the carrier and modulator frequencies are harmonically related, they can reinforce each other to introduce a new pitch into the sound, which would be the fundamental common to both frequencies. In popular music, ring modulation is produced by the "fuzz box," which is simply a sine wave ring modulator which distorts a live input with a low audible sine-wave tone such as from 50 to 200 Hz
As an example, consider a harmonic spectrum of five harmonic partials, 100 to 500 Hz, ring modulated by a frequency of 39 Hz. The following table shows the results:
c m c+m c-m 100 39 139 61 200 239 161 300 339 261 400 439 361 500 539 461
Now imagine that the modulator is shifted to 50 Hz, which is harmonically related to 100 Hz:
c m c+m c-m 100 50 150 50 200 250 150 300 350 250 400 450 350 500 550 450
Now all the resulting frequencies are partials of a tone of 50 Hz, and several are duplicated (since they're all positive, they are just reinforced). If the modulator frequency varies from 0 to 50 Hz over the course of the tone, you hear one set of tones move up and another down. Also, like frequency modulation, ratios could be used for c and m and then multiplied by frequencies, as in the following example (the same as the one above, reduced to ratios):
c m c+m c-m 2 1 3 1 4 5 3 6 7 5 8 9 7 10 11 9
Ring modulation can also be used to produce dynamic spectra. This can be possible through the use of time-varying functions to control all aspects of the process, including the frequencies themselves and the fraction of the carrier that is actually modulated. Also, events that happen in a short time span produce rather different effects from the same events happening over long durations.
The Karplus-Strong Algorithm
In the early 1980's, two researchers at Stanford University, Kevin Karplus and Alex Strong, conducted some experiments using delay lines. One simple idea they used was to take a short noise burst and put it through a delay line, the output of which was fed into a low pass filter. In later designs, this model was tweaked by the addition of an all pass filter. The duration of the noise burst is only long enough to fill the cells of the delay line, after which it is disconnected. If the output of the delay line is continually recirculated and the low pass filter lets through all frequencies in the audio range, the result is a periodic waveform, and the unit has a clear pitch even though the initial burst was a noise. In practice, the low pass filter is set to at least the Nyquist frequency, and thus the waveform loses some of its energy on each iteration of the loop. This method, which has become known as the Karplus-Strong Algorithm, has proven particularly effective for synthesizing plucked-string sounds, and it has been incorporated into csound as the pluck unit generator.
An interesting aspect of the Karplus-Strong Algorithm is that a physical implementation of it was sold to and patented by the Atari Corporation, a manufacturer of video games, which they intended to use in their machines. The company later went out of business but still owns the patent, and no other company has ever been able to use the method in a commercial synthesizer. Thus, the only way that this method can now be accessed is through software synthesis like csound.
The pluck unit generator is described as follows:
ar pluck kamp, kcps, icps, ifn, imeth [, iparm1, iparm2]
icps is the intended pitch value in Hz, used to set up a buffer of 1 cycle of audio samples which will be smoothed over time by a chosen decay method. Icps normally anticipates the value of kcps, but may be set artificially high or low to influence the size of the sample buffer.
ifn is the table number of a stored function used to initialize the cyclic decay buffer. If ifn = 0, a random sequence will be used instead.
imeth specifies the method of natural decay. There are six, some of which use parameters values that follow.
1 - simple averaging. A simple smoothing process, uninfluenced by parameter values.
2 - stretched averaging. As above, with smoothing time stretched by a factor of iparm1 (>= 1).
3 - simple drum. The range from pitch to noise is controlled by a "roughness factor" in iparm1 (0 to 1). Zero gives the plucked string effect, while 1 reverses the polarity of every sample (octave down, odd harmonics). The setting .5 gives an optimum snare drum.
4 - stretched drum. Combines both roughness and stretch factors. iparm1 is roughness (0 to 1), and iparm2 the stretch factor ( >= 1 ).
5 - weighted averaging. As method 1, with iparm1 weighting the current sample (the status quo) and iparm2 weighting the previous adjacent one. iparm1 + iparm2 must be <= 1.
6 - 1st order recursive filter, with coefficients 0.5. Unaffected by parameter values.
iparm1, iparm2 (optional) - parameter values for use by the smoothing algorithms (above). The default values are both 0.
An internal audio buffer, filled at I-time according to ifn, is continually resampled with periodicity kcps and the resulting output is multiplied by kamp. Parallel with the sampling, the buffer is smoothed to simulate the effect of natural decay.
Plucked strings (1,2,5,6) are best realized by starting with a random noise source, which is rich in initial harmonics. Drum sounds (methods 3,4) work best with a flat source (wide pulse), which produces a deep noise attack and sharp decay.
The original Karplus-Strong algorithm used a fixed number of samples per cycle, which caused serious quantization of the pitches available and their intonation. This implementation resamples a buffer at the exact pitch given by kcps, which can be varied for vibrato and glissando effects. For low values of the orchestra sampling rate (e.g. sr = 10000), high frequencies will store only very few samples (sr / icps). Since this may cause noticeable noise in the resampling process, the internal buffer has a minimum size of 64 samples. This can be further enlarged by setting icps to some artificially lower pitch.
Problems
1. Produce ring-modulated tones consisting of two sine waves, and then change one of the tones to a complex spectrum, making note of all the frequencies involved. Can you hear each of the frequencies that you expect to be produced? If not, why not?
2. Compare the effect of a tone ring-modulated by another tone that is unrelated to the first frequency with a tone that creates a harmonic series. Also try the effect of varying the frequency of modulation from zero to the value used. Can you hear distinct bands of partials moving up and down?
3. Try the effect of ring modulating a tone with a changing timbre, such as an fm sound. What effect does the timbre change have on the ring modulation?
4. Use the Karplus-Strong algorithm to produce tones using each of the basic methods. Describe each of them and what you think they might be used for.