We have looked at truncation and rounding errors in class concerning the calculation of the first derivative. Such errors can be the nascent of major miscalculations when dealing with multi-step algorithms. Sinusoidal oscillators are one application where truncation and rounding errors can sway the result from the desired output. However, techniques such as interpolation come to the rescue!
Sinusoids are used in a variety of signal processing applications, for instance, as carrier signals in audio applications such as Amplitude Modulation (AM) [5]. However, in reality, generating a sinusoidal wave is not as easy as typing sin([0:0.001:2*pi]) in MATLAB. In most applications the precision of the sinusoid and its frequency are very important. For instance, in the case of an AM signal, it is important that the sinusoid has one sharp frequency such that it can be isolated and locked onto [5]. In case that the sinusoid is quantized and limited by precision, harmonic distortion [6] will be introduced into the system and the sinusoid appears to have multiple frequencies although one frequency will be distinguishable [1]. So how does one produce a sinusoid?
In the analog world, sinusoidal generation is a matter of creating a circuit that resonates [4] at a certain frequency such that it blocks all other frequencies. To create such a network, one needs to choose resistors and capacitors such that the desired frequency is obtained [1]. However, in reality, resistors and capacitors have different tolerances, and are non-ideal. Precision is not limited to computers! As such, it is not possible to create a stable oscillator. In the case that the oscillator signal grows exponentially, the sinusoid clips because of power-supply limits. In the case that the oscillator decays, the sinusoid output dies exponentially to zero. In fact, actual analog sinewave oscillators are not employed in function generators and electronic music equipment. Instead, the basic oscillation is not a sinewave, but rather a ramp-based “triangle” or “sawtooth” [2]. The slope of this ramp, and ultimately its frequency, is precisely controlled by a current source driving a capacitor, and the amplitude is controlled by reset or turn-around voltages. This results in a stabilized non-sinusoidal oscillation which is then shaped into a sinewave approximation using methods such as interpolation. The typical harmonic distortions are as low as 0.05% or as high as 2%.
In the digital world, there are no problems introduced by non-ideal resistors or capacitors. However, quantization of the sinusoidal signal results in harmonic distortion [1]. This means in addition to the desired frequency f, we expect smaller components of the frequencies of 2f, 3f, …. This distortion may be large at low amplitudes (comparable to the quantization itself), but may be minor in large enough amplitudes (>100 times quantization). It is very important to look at the relative error as opposed to the actual error.
A class of digital oscillator consists of simple digital networks that produce the sinusoidal samples iteratively [1]. Such oscillators are difficult to implement as the effects of rounding and truncation can be severe after a long period of running. For instance, one such network is initialized by constants such as cos(theta) and sin(theta) [1]. However, given finite word length [3] and the fact that cos(theta) and sin(theta) are irrationals in general, after a few days of running (quite a few iterations), the system is not running at the desired frequency anymore.
The effects of quantization and precision introduce small errors that are not easily detected at reset time. However, such effects can add up to produce erroneous results. A decaying sinusoid could reduce AM transmission to non-existence. A growing sinusoid could make locking onto a particular AM station impossible.
References
[1] http://www.synthtech.com/tutor/sine1.pdf
[2] http://en.wikipedia.org/wiki/Function_generator
[4] http://en.wikipedia.org/wiki/Resonance






Leave a Comment
You must be logged in to post a comment.
* You can follow any responses to this entry through the RSS 2.0 feed.