Updated 2011-05-09 01:57:32 by RLE

by Theo Verelst

Using the Tcl/Tk package Bwise, and some fundamental, tcl-coded, signal processing procedures, such as Fourier transformation, I'll exemplify the important signal processing concept of frequency modulation by making an Tk applet to play around with this modulation principle, known in radio engineering, wireless communication, modems, and sound synthesis, to mention a few fields.

The interest comes mainly from two signal processing considerations (are the signal processing page leaders on holiday ?! ;) ), first, it is an overlooked principle/theorem which is of great value in many signal processing/analysis applications, also when tcl is used (as appears regularly on these pages), and second, I think it is a fun and interesting and relevant use of tcl/tk to exemplify an important principle, which for me historically goes back to the advent of the Yamaha DX-7 synthesizer which is based on sine wave frequency modulation sound synthesis. When I was a second year electrical engineering student looking for a section to graduate in, I had just worked enough to buy a DX-7, and I had the schematic diagram of it, because I was very interested in what the chips (at the time comparatively big and complicated ones) in that synthesizer worked like, and also how FM synthesis worked, so at the time I programmed a sample reproducer and FM program on the Atari ST. At the time, such programs were preferably compiled, but nowadays we can use Tcl and do things more or less in interaction time, and even make an interactive user interface in Tk on top. IMNSHO a very important, and protection-worthy use of a modern programming language like tcl/tk.

(TV aug 10, 2004, 19:47 Ooops, (local) power outage in Amsterdam, I'll see what I can do right now, might be I have to get some car power as soon as the notebook is running out of current... For the moment, mind that my images on the wiki are served from a not completely up to date server, though most is there. 20:01, ok all data should be served in latest version again!)

I've decided to make a few pages more on more basic signal processing concepts, I don't think I found those issues clearly described yet, though they seem to underlie some other tcl code issues, too:

The tcl part is because it's handy to program with tcl and tk to make graphs, not because it is very efficient, it isn't much at all, in fact. But it is sure handy to have signal vectors as lists, so programming time is very reduced, often. Maybe a good binary (C or machine code based) FFT library would be good idea. Here, it is about the science and issues related to using standard tcl to deal with important signal processing issues, and code examples for that.

FM modulation is maybe not something a digital signal processing person (like in this case applying that art in tcl) would think about, but that is not justified. Lots of signal processing algorithms in fact modulate a signal in frequency (like in ancient speech processing, too), and those bessel functions which will govern the frequency spectrum of the result are quite noteworthy, and too often even completely overlooked, which is close to signal processing insanity, as we will see.

The most decent way of dealing with the subject is probably like I found out when in an early university year I went to the EE library to figure out how Radio Engineers deal with the subject, which was easy to find, and which takes the most fundamental case first: a sine wave modulating a single harmonic signal as a carrier.

In tcl:
  proc freq_mod_signal {time, Fc, Fm, Beta} {
     set twopi 2.0*3.1415926535
     return [expr cos( $twopi * $Fc *$t + $Beta*sin( $twopi * $Fm * $t) ) ]

Where the frequency modulates signal has an amplitude at each particular moment in time which depends on the frequency of the carrier wave Fc, the frequency of the modulation signal Fm, and the modulation depth (Beta).

TV This page will be (become) finished...