The Lazarus Syndrome

A project log for Rubidium 2.0

This is an all in one spectrum and logic analyzer, robotics control platform, and modular synthesizer with audio in and sheet music out!

glgormanglgorman 10/07/2021 at 23:130 Comments

For lack of a better title, it is what it is.  If you don't already know it, Pascal is a language that refuses to die, and thus there is also Lazarus, which is a free and open-source Pascal compiler.  Now of course it would be nice to have Lazarus to run on the Parallax Propeller P2, as well as many other microcontrollers, but most people would never even begin to guess why.  So let's warm things up a bit, with a screen shot from "Stalking the Big One", 2019 edition.

 What you are looking at is some of the capabilities of the full "Rubidium" project; which features an oscilloscope mode,  multiple spectrum analyzer modes, including linear as well as log and log-log plots, and also multi-channel logic analyzer modes that allow for examination in the time domain of up to as many channels as your screen resolution will allow.  In this case we are taking an audio signal, and passing it through an initial 8192 point FFT; which is then split up into 128 blocks of frequencies, which in turn are then each being converted back into individual time domain signals.  I should probably redo this image with just four or eight channels, for clarity.  Nonetheless, each of the individual sub-bands can then be converted back into the frequency domain, again, and what this lets us do - if you think about it is take a signal that might be initially sampled at 44100 Hz, and turn it into 128 "sub-band" signals which are each sampled at 44100/128 = 344.53 Hz, and where each, therefore, has a 172.27 Hz, bandwidth, with far superior anti-aliasing that what you would otherwise achieve with just an ordinary 256 point FFT alone.  In turn, this greatly simplifies such tasks as "event" detection, "beat" detection, or for those who want to try their hand at speech recognition,  this might be one way to do formant recognition, at least as far as greatly simplifying the process of vowel recognition.

Furthermore, if you check the Parallax forums, there is an assembly language FFT that was published by Chip Gracey, which takes advantage of the P2 chips built in pipelined CORDIC solver, so as to reduce the "regular" FFT algorithm to just 78 longs!, You read that right - 78 longs * four bytes/long = 312 bytes, as has been demoed on the Parallax forums.  Seriously!  Now eat that Raspberry Pi!  Where's your 3.14159265358979 now?

The showstoppers of course that are preventing anyone from doing some REALLY cool modular synth stuff, is the lack of software tools that work effectively with high-level languages.  C++ would be oh so nice right now!  But how about object Pascal? Or Lazarus?  The Lazarus project of course is about 200 Megabytes - but it IS arguably Pascal on the one hand, and it is open source/free - and yet it has fun stuff like this excerpt from some file entitled "frmconfigfilebrowser.lfm", which appears to be some kind of dialog template for some kind of file browser GUI.

object FileBrowserConfigForm: TFileBrowserConfigForm
  Left = 302
  Height = 200
  Top = 184
  Width = 400
  Caption = 'Configure file browser'
  ClientHeight = 200
  ClientWidth = 400
  OnShow = FormShow
  LCLVersion = '0.9.25'
  object ButtonPanel1: TButtonPanel
    Left = 6
    Height = 46
    Top = 154
    Width = 388
    Align = alBottom
    AutoSize = True
    TabOrder = 0
    ShowButtons = [pbOK, pbCancel]

 And there is about 200 Megabytes of this stuff.  Now whether "lfm" stands for "Lazarus Frame" or whether it stands for "Frame Lisp compatible" might depend on whether you think that GNU stands for GNU is NOT Unix or not.

 Of course, I know that people want to see it run on the Propeller, but it appears that the only way that there is any hope for that is if I write my own compiler.  Ideally C++, but any appropriate dialect of Object Pascal would also do.  Yes, that would also do - very nicely.