Version 0 of Tcl based signal processing fundamentals: Additive Wave Synthesis

Updated 2004-08-11 10:42:25 by TV

started by Theo Verelst

When wanting to examplify what frequency varied sine waves have as a spectrum, because that's important while analysing many types of measured or synthesized digital signal, for which tcl is also used, the page on that subject got a bit full. I though some of these very fundamental sujects deserve a place amoung the many pages about these important signal processing subjects, which can be successfully and interestingly programmed in tcl. In fact I prefer to use Tk, too, because it is one of the powers of tcl/tk to be a great interactive program development environment with great scientific value as such. Not many computer languages are really suitable for interactive scientific development , which is probably the main driving force for improvements in computer programming (apart from all kinds of (un-) human, political and 'imperialistic' considerations, and un-technical logics).

Waves can in tcl be natually represented in sampled form as lists. That means that when a wave like a sine is chopped in pieces, or neater put: approximated in x (or time) and y axis sense by rounding it to points on a rectangular grid (like on uses in mathematics school sheets), those point can be stored in order (from left to right) by putting the approximate values in a tcl list of values.

A sine wave is a special repetative wave pattern, because our ears perceive it has having only one frequency, so it is per definition the most 'dull' or harmonics-poor wave. It isn't hard to make a list with sine values for one sine wave in tcl. Lets say we want ten values for one full wave, we'd write:

   set pi 3.1415926535
   for {set i 0} {$i < 10} {incr i} {
      puts [expr sin(2.0*$pi*$i/10)]
   }