Spec_An_128Hz_AMIGA.py

    Spectrum Analyser displaying an internally created 128Hz squarewave.
    --------------------------------------------------------------------
(Apologies for any typos, etc...)

Architectures: Classic AMIGAs, WinUAE, FS-UAE, Linux, APPLE, (Windows WSL?)
---------------------------------------------------------------------------

MINIMUM Requirements Are:-
--------------------------

Amiga environment:
------------------

        AMIGA A1200(HD), 68030, FPU, 8MB FastRAM.
        WinUAE 3.4.0, minimum.
        FS-UAE 2.8.1, minimum.
        Standard Classic AMIGA OS 3.0.x install or better.
        Full Python Version 2.0.x install:
             https://main.aminet.net/package/dev/lang/Python20

Other systems:
--------------

        Works on GNU/Linux Mint 22.1 terminal[s] and its Python version.
        Works on Apple OSX 10.15.7 terminal[s], and its Python version.

        I have no idea whether it works on WSL and Python as I am really not
        interested, therefore you try it out at your own risk!

        Also I have NO access to any APPLE 'M' series HW, so I have no idea
        whether this works or not inside their current terminal[s] and
        Python; there is no reason why not however.

-----------------------------------------------------------------------------

Preamble:-
----------

<CR> is the ENTER/RETURN key.

This creation is an ASCII text mode, horizontal axis log10(x), audio spectrum
display using a recursive Radix 2 Fast Fourier Transform on a 128Hz
internally software created squarewave.
Its frequency spectrum range is 100Hz to 10KHz inside 77 text mode columns.
The vertical axis is uncalibrated as it is a DEMO and uses natural log(y) as
its scaling. The total number of data points is 16384 encompassing 128
complete cycles.

As I do everything in fixed width ASCII text mode now, and not pixel width
graphics, then visual _ERRORS_ exist but are close enough within the limits
of a PAL, full width window, AmigaShell that can give 24 lines easily.
Therefore the AmigaShell window should be 24 lines by 77 columns MINIMUM.

For you _NTSC_ folks you will need the NTSC HiresLaced mode to view as Hires
will NOT allow a 24 line AmigaShell window; it should follow the same rules
for the width as PAL mode. HOWEVER; a borderless NTSC Hires, AmigaShell CLI
might work but not tested. A quick check on a borderless 640 by 200 pixel
window suggests it WORKS, when tried in PAL mode, (see "5)" below and the
image). The Shell ICON TOOLTYPE should have this line:
                   WINDOW=CON:0/0/640/200/Shell/CLOSE<CR>

It will work on other platforms with a terminal window, from Python 2.0.x to
the current 3.13.x without any modification, as most are already the default
size of 24 lines by 80 columns minimum. If not then they are easily
expandable, either by terminal escape codes or physically using then mouse
and/or touchpad.

Only the first four colours of the Workbench GUI are used, in my case, Black;
White; Light Grey; Dark Grey.
Python *NIX style Escape Codes are used throughout.

On running the code in a very highly expanded AMIGA A1200(HD), (68030, FPU,
8MB FastRAM minimum), it has the do a huge amount of complex calculations,
approximately 344,000, so it will be slow compared to current platforms,
anything from around 70 seconds to 8 minutes total depending on the CPU,
clock frequency, and memory, so be patient.

!!! Read the Python code for more information. !!!

-----------------------------------------------------------------------------

How to use it:-
---------------

There are no Python dependencies required at all and only uses the builtin
'cmath' and 'sys' imports.
It is assumed that you have Python20.lha installed and in the AMIGA's PATH.
Open up an AMIGA Shell and expand it fully.
From the command line enter:
            Python_030 [FULL:path/to/]Spec_An_128Hz_AMIGA.py<CR>
The graticule will come on first awaiting the final calculations.
Now wait for a while for it to do the number crunching, and......
......voila, the results will be plotted on screen.
The colours will be those of the first four colours of YOUR WorkBench, or
whatever the default colours of the terminal that is in use inside other
platforms.

=============================================================================

Optional requirements not in the readme:-
-----------------------------------------
(This section can be skipped over.)

1) A Monitor or TV capable of PAL format for ease of use, see above for NTSC.
2) An AMIGA to SCART cable for those of number 1) above that have them.
3) Productivity Mode for Monitors that are available to make life easier.
4) An AMIGA to VGA adaptor with accessories to connect to number 3).
5) Borderless window:   https://main.aminet.net/package/util/boot/MaxCli
   Call as:            MaxCli NOBORDER FULLSIZE<CR>
6) This works under ADE the *NIX emulation too:
        Full ADE UNIX environment install, (full install on AMINET):
        https://aminet.net/package/dev/gcc/ADE
                       AND...
        Library file ixnet.library version 48.0
        Library file ixemul.library version 48.0
        Both files are here if you have NOT got them:
        https://aminet.net/package/util/libs/ixemul-48.0

-----------------------------------------------------------------------------

Have fun...

Bazza, G0LCU.

