Slow FFT in ksh93 and awk.


Login or Register to Reply

 
Thread Tools Search this Thread
# 15  
Old 10-03-2018
Hi Corona688...

Well the Awk DFT has just dropped out of its 14 days viewing on AMINET and has reached 135 downloads.
Did not quite reach the 150 mark, but hey 135 is not bad for such an ancient platform, running the _ADE_ UNIX emulation for the AMIGA A1200; the Awk version for this platform is about 20 years old.

Aminet - dev/gcc/DFT-FFT.awk.txt

From tiny Acorns big trees grow...
There will be someone out there who will improve considerably on this _seed_ that has now been sown.

Thanks a lot matey...
These 2 Users Gave Thanks to wisecracker For This Post:
Corona688 (10-03-2018) Neo (10-03-2018)
# 17  
Old 10-04-2018
Quote:
Originally Posted by Corona688
A "small" machine with 4MB RAM isn't so different from the earlier UNIX machines.
Perhaps, but we have come a long way since the inception of the AMIGA A1200.
It is surprising how difficult it is to create code to work on multiple platforms with large time spans between platform types and differences in languages as they evolve over these time spans.
It took me a long time to do an FFT for Python 1.4.0 for the A1200, to the current, (04-10-2018), 3.7.0 for current machines, but I got there in the end. Everything is easy when code is written around current language versions but backwards compatibility is hard.

My next esoteric code is going to be DWTs, (Discrete Wavelet Transforms), and I think it can be done in pure ksh93, and maybe zsh.
It does look fairly straightforward and this site will be the first to have a basic DWT for ksh93 when done.
Once done I will leave the Awk version for you... <wink>
# 18  
Old 10-04-2018
Quote:
Originally Posted by wisecracker
It is surprising how difficult it is to create code to work on multiple platforms with large time spans between platform types and differences in languages as they evolve over these time spans.
Depends what you're doing. Hardware I/O changes often, plain old data processing hasn't. awk in particular didn't burden itself with 100,000 obsolete expansion modules like Perl and Python did, or changed as much as shell has; it remains a special-purpose language just for data processing, quite portable. Mostly. You can find it on anything from wireless routers on up, but occasionally we must tell people 'use nawk on solaris' or else they'll get a crusty old version backwards-compatible with 1977.
Quote:
It took me a long time to do an FFT for Python 1.4.0 for the A1200, to the current, (04-10-2018), 3.7.0 for current machines, but I got there in the end. Everything is easy when code is written around current language versions but backwards compatibility is hard.
Python is one of the worst languages for backwards compatibility, its basic syntax changes with every sneeze.
Quote:
Once done I will leave the Awk version for you... <wink>
If you're curious, there's a lot more to learn about awk. It's actually a very fast, powerful, and low-footprint language for processing text. (It had to be, to operate on 1977 hardware.) It's not a do-everything language, it has a few really nice features and not a lot else. You wouldn't write a menu system or graphical UI with it. But for data processing it's almost as powerful as perl.

Last edited by Corona688; 10-04-2018 at 12:50 PM..
These 3 Users Gave Thanks to Corona688 For This Post:
Don Cragun (10-04-2018) jim mcnamara (10-04-2018) wisecracker (10-04-2018)
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
FFT for Python 2.0.x to 3.7.0. wisecracker OS X (Apple) 0 08-20-2018 09:54 AM
Ksh93/AIX compatibility majinfrede AIX 2 04-26-2018 09:07 AM
FFT for the AMIGA through ksh88 shell. wisecracker OS X (Apple) 0 11-10-2017 04:16 AM
Possible ksh93 Bug Expanding Variables? bakunin Shell Programming and Scripting 4 07-04-2017 01:54 AM
Ksh93 on Linux compatible with ksh93 on AIX Keith Turley UNIX for Advanced & Expert Users 6 10-22-2016 01:37 AM
Making a faster alternative to a slow awk command s052866 Shell Programming and Scripting 10 07-12-2012 05:54 AM
ksh93 different results using -x option lthorson Shell Programming and Scripting 8 10-30-2011 10:54 AM
cut, sed, awk too slow to retrieve line - other options? fzd Shell Programming and Scripting 7 12-30-2010 07:34 PM
ksh93 newline character problem neeto UNIX for Dummies Questions & Answers 4 06-08-2010 05:14 AM
The builtin split function in AWK is too slow kevintse Shell Programming and Scripting 14 05-23-2010 10:15 AM
Install ksh93 for cygwin devtakh UNIX for Advanced & Expert Users 1 07-10-2009 07:32 AM
Performance degradation with KSH93 i.f.schulz Shell Programming and Scripting 2 04-02-2009 10:27 AM
ksh88 or ksh93 Nestor Shell Programming and Scripting 3 03-13-2009 10:33 AM
ksh93 deprecation... curleb Shell Programming and Scripting 2 03-17-2008 08:36 PM
echo is too slow. HELP with Awk eja UNIX for Dummies Questions & Answers 4 05-14-2007 09:34 AM