Theo Verelst Local Diary Page 50

I've ditched the usual header for the moment, I think it doesn't help much anyhow.
This page is copyrighted by me, and may be read and transfered by any means only as a whole and including the references to me. I guess thats normal, the writer can chose that of course, maybe I´ll make some creative commons stuff one day, of course I have made Free and Open Source software and even hardware designs available!

Home (alt)   Tripod Home   Local Diary list   Tripod Diary List   Previous Diary

This page is under contruction, so check back later, too.

  mon Jul 21 01:49, 2008

More challenges? Some, probably. On this page I plan some analysises (analisae ?, no) which hopefully will lead to the correct conclusions about problems and curses which in turn should lead to solutions. To begin with about my easily recognisable EE association, or in fact official education and work and hobby exerience.


That´s a currently free (not open source) windows (XP ?) based program for creating audio dataflow diagrams (a la BWise) for Analog Devices Digital Signal Processors, of which I have 2 I can use.

It can translate the visual blocks with parameter settings and connection to a DSP program, and generates automatically a whole VisualDSP (another AD software package, free with the DSP boards) project with source files and makefiles:

which can then by clicking ´make project´ be built and loaded into the DSP.

Some hefty examples were tried by me, but all suffer from the short attention span and horrible (for high Q audio) approximationitis as seems to rule dsp and much of power audio systems world.

It´s great to play somewhat with though, and of course quite powefull, even my own blocks (my synth and reverb run on blackfun DSP and are compiled with the above as well, except from programs written by YT).

FPGA synthesizer continued



My own DSP based (with CPLD but no FPGA) synth which has received some public exposure (but zero email responses, which is in a sense disgusting) has a initialize file which I didn´t publish on the web, just so I don´t forget it primarily here is is:


The VisualDSP environment can load the file, and can program the flash memory on the Blackfin 533 DSP board with it, so that the synth starts up in a very short time (under a second sound and display and midi work) because it copies a 100,000 long (actually 100k) list of added 24 bit (actually 32) sine values from flash to main memory   which is the generator waveform. The waveform or very stretched out and accurate single wave sample can also be generated by the DSP at startup, which will take if I recall correctly about 10 seconds. A 1.83 GHz Coreduo takes about 4 seconds, but that is in double size. Loading from flash is pretty fast. I didn´t check the speed with the latest compiler.

It has been created by this C program, and converted with this tool I adapted.

I is still in the synth after it having been put in the flash in 2005 or about without the need for reloading it when updating the program.

The main file of the synth had to be adapted to run under the latest VisualDSP a bit, here is an updated version which has a function for inspecting the sc variable which is changed by the 48kHz audio interupt routine so that the compiler doesn´t optimize the actual vairable lookup out, which it does even though all the files except the actual interupt audio processing should be compiled with optimize off. With the new file the whole compilation works, and I could even try 6 voices instead of 4, which seems to work! Quite nicer for 3 note chords with two oscilators per voice.

I tried the foxboard out as Ethernet connection for the Scott FPGA polysynth, which has then a midi connection and a serial link with the fox board, in this case using another FPGA board which happens to be screwed in the 19 inch rack next to it which feeds the 115200kbps signal from the fox serial connection through to its serial connector, which in turn connects to the Spartan 3E board.

The fox board runs a deamon-like tcl script which lets a tcl script from another machine on the ethernet connect like to a server, and then feeds the data bidirectionally through to the serial port. I´ve adapted the polygate Tcl/Tk editor (see here) to use ethernet to connect up to this construction, and it works.

To see how the foxboard can compute with math, I made this test program:


void main(void)
   float in, sum =0 ;
   int i;
   printf("give number:");
   printf("\nsquared =  %f\n",in*in);
   for (i=0; i<100000; i++)
      sum += sin(2*3.1415927*i/100000);
   printf("\nsum     =  %f\n",sum);
   printf("\nsin     =  %f\n",sin(in));

which it runs in exactly 1 minute. I had to change the boards´ build environment from Fedora Core 4 to Fedora 8 (64) but with a symbolic link to the /usr/lib and a initialisation script pointing to the old disk files it seems to compile good, and fast (on the Athlon 3.3 GHz/64 server I use), and one can write regular C, which is cool for such a small board, which can access gigabytes of data from its USB disks.

It is fun that the whole of the Linux board machine and the Spartan 3E board can start up and be played with a midi keyboard or something else without the need for a PC or interference. The tcl script on the Linux board can easily be instructed to load system exclusive messages into the FPGA board at startup and in fact it could even talk back and forth for instance with knobs sending messages to the tcl script to provoke paramter or whole-sound changes. Not bad to design a UI with interactive Tcl without the need for a PC.

On the applied theory side of things, I tested a exponentional decay generator in very basic form: by repeated multiplication, done with a serial interface (in this case bidirectional 115kbps) and a Spartan 3E 18x18==>36 bit multiplier block used from theo schematic editor, and a one time initialized exponential decay register:

The necessary files should be here, the tcl testscript to connect with the PC serial port (under XP or what you would want, Tcl runs under most everything, excpet the serial port is called different) is here. The output from the script is:

(Tcl) 1 % for { set i 0 } { $i < 22 } {incr i} { w 0000000000f00000 }
 00 00 ef 02
 00 00 e0 03
 00 00 d2 04
 00 00 c4 05
 00 00 b7 06
 00 00 ab 07
 00 00 a0 08
 00 00 96 09
 00 00 8c 0a
 00 00 83 0b
 00 00 7a 0c
 00 00 72 0d
 00 00 6a 0e
 00 00 63 0f
 00 00 5c 10
 00 00 56 11
 00 00 50 12
 00 00 4b 13
 00 00 46 14
 00 00 41 15
 00 00 3c 16
 00 00 38
(Tcl) 2 % 
Of course it takes more iterations for the decay to reach 0 or close to zero, and 8 bits is not much, while the accuracy of the decay will already be not good when the same number of bits is used for the output as for the accumulation. There are various rounditn possibilities, for which Xilinx in it's muladd block documentation gives various options, and of course there are bit number issues, and the possibilities of using radius greater than 1 and smaller than 0 and how to use the available signs in the multipliers. Also, the minimum decay is a function of the numer of bits. This is a subject from my DSP synthesizer which uses this method with zero offset to create an ADSR with.

HD Video editing and processing

Well, I was practicing with some material I shot at IJazz in Amsterdam.

I promise solemnly on my mothers room that these are actual screen copies from the mplayer while playing this HD video, no tricks, no post-processing of the grabbed image. So that's pretty good by now, even though improved prosumer HD cameras (mainly the latest sonys) are already available. Before the above mpeg2 stream (which had some problems on the purevideo player, but I know I can make that work) came into existence, more than a bit of processing has been done to the original 25 mb/s mpeg2 stream from camera, transcoding to h264 (highest q) and deinterlaced mp4, which got imported in Cinelera, mixed with title and sound, adaptively filtered, histogram corrected, gamma corrected and sharpened, then rendered to high Q mp4 (q error <= 2), and then ffmpeg transcoded to fairly high bandwidth mpeg2.

For the moment, I´ve made a tryout edit, which for this page and the current server bandwidth I´ve limited to 720p format (1280x720 pixels progressive, 16:9, 25 frames/s) with a little under 3 (filesize 11.3 MB, but only half the test film) or a little above 4 mega bits per second (1:18 full test film, 43.2MB, this server can at best upload this file in a few minutes, not in realtime) in mpeg2 transport stream, which should be widely usable.

I´ve put it on vimeo, too, so even with not so many bits per second, relatively, on can watch an impression, and even leave comments, or download a high quality 720p version I made of 200 Mega Bytes, which is probably faster to download than from this server.

How to apply for a job in a country at war ?

I don't know. I of course would want to (seriously and with as actual result a job there and to live there) do such a thing, but hey, that's similar to over 15 years ago, when I got to work at my graduation university instead.

Which was not what I prefered, believe me. Anyhow, I guess I didn't prefer to have or loose faith or religion either, certain things are not fully under one's control.

Holland isn't at war, Theo !? No, but maybe it should have been with a lot of people who I've tried to decribe long ago isn't it. And I wasn't talking about the netherlands, I was talking (well, solo writing) about California preferably.

Well, I didn't have the complete image of the functioning of that particular piece of the world, and maybe they really don't need a brain drain toward their piece of the world, but then again I knew at least 2 people who went there with completely comparable education, so it isn't a weird thought. And of course behind all the screens a lot more has gone on, and I don't suppose the iraq war was about oil.

What's with this Matlab/Octave thing

Matlab is the original, a sort of advanced and scientifically widely accepted BASIC for digital signal processing experiments in software.

An interpreter which has been imitated with Octave, which is Free and Open Source Software, in case of Octave combined with GNUplot to draw graphs with. There is a wide variety of commands, and a lot of .m libraries of additional functions written in matlab code, which can be loaded in the interpreter.

Gnuradio has a matlab interface, too, so I picked an example sample wave file and graphed an FFT of it's signal

The signal starts with 128 unregular samples maybe the combined latency of the AD converter in the hardware (which I don't have, the example is from the internet) with the decimation and other filtering, or just the startup time for the streams from the hardware since the beginning of the sample recording, I don't know. Also, I'm not necessarily understood with the complex notation of the samples, I imagine that could simply come from the result of a mixer with sine and cosine components where both are seperately AD-ed.

Looks a bit wild the signal, certainly not very close to a sine and cosine component, but the 16000 point fft does get good spectral components from the modulated signal and other signals it seems. It did take me about 65000 samples to visually get a nice clean fft with clearly mirrored modulation spectrum around the carier frequency of what I presumed the main signal, but it could be transients from the switching on of the various signal paths as it looks like in the above signal graph make this so.

Of course I'd be interested in the quality of a demodulated HiFi FM stereo signal, but I'm not sure I can find an example signal graph script for that, maybe I should try myself. I communicated a bit with Josh Blum about the gnu radio companion which is sort of a BWise for the gnu radio, about doing the same for the vhdl or verilog inside the gnu radio hardware FPGA, and he said he indeed has already software for that. Kind of cool to play with block designing for FPGA DSP.

In a similar subject area I found myself deluded funnily by a Agilent webpage about fast (I mean really fast like the order of Giga samples per second) Analog to Digital converter pci boards for building in a computer where there was mention of a basic configuration price of a few hundred dollars. Turned out that is the price for an upgrade of the warrantee or maintenance from one to three years...

There are some pretty fast converter chips around nowadays, TI and AD have 14 bits converters up to a few hundred mega samples per second, which is very good. Test boards for the not all fastests are a few hundred dollar, and Texas has even got one with an integrated Xilinx Spartan 3E FPGA on it foe balanced low voltage TTL signal conversion. I use that FPGA too, it's the same one as I showed with the FPGA synthesizer, or half the size of that one, that is not clear because the schematics of the AD converter board says something else then the specs. The full range signal to noise is just not up to direct audio use (up to about 80 dB) otherwise it would be an interesting double use to sample and correctly correct for reconstruction errors digitally generated audio signals. Now that would need some sort of scheme to trade bandwidth for snr.

There's something strange with gnuplot I found out using my Mathematical Sounds Page with for instance this formula:

Taking a little different frequency than a multiple of the inverse graph length's wavelength equivalent (so no whole number of waves fit exactly in the graph) the strange 'errors' disappear:
The sound was generated right in all cases, which was an accurate wave experiment set sounding sort of like this.

The lylies of the water


Need I say more ?


Next to the pond, bit processed picture.

My self made pond nature, the plants and the land aren´t mine...

A nature ´reserve´.

Near IJazz, zoomed and processed.

Almost starting to look american, which is good, back to nature, but with the right shapes.

Pure audio, straight from CD quality, unprocessed, probably (hopefully) sample for sample, 3 multi band amplified, in this case 2 because this time the sub wasn´t carried out, and a few tens of watts (with loads of reserve of course. great.