¿ªÔÆÌåÓý

Some questions on digital filter design


 

On Tue, 9 Jul 2024 at 14:55, Chuck Harris via <cfharris=[email protected]> wrote:
Recently, I was playing with open source Sagemath, and
it is quite interesting.? It is a python based scripted
language that is much like mathematica.? It is a symbolic
math package that does integration and differentiation.
It understands parallelism, though it needs you to give
it some help.

I used to work on the development of that. I got it ported to 32-bit SPARC, but it wasn¡¯t happy if compiled 64-bit. Unfortunately the timing of the port coincided with Oracle buying Sun, and basically making the use of a Solaris version less attractive.?

I would disagree that Sagemath is like Mathematicia.


Basically, you can think of it as giving the entire GNU
mathematics related packages a common user interface...

Sagemath adds a Python interface onto everything it includes, but many of the things it uses have no library interface, so the interface lacks the consistency of Mathematica. Sagemath simply uses Expect or similar to pass data between programs.?

Sagemath can call Mathematica, but unless things have changed, it doesn¡¯t do this via the API to Mathematica, but just uses Expect.?

Most calculus in Sagemath is done with Maxima. Again, Maxima has no library interface, so something like Expect is used.?

I don¡¯t know what it is like now, but I used to get fed up with the speed of new releases, each time adding new features. I was regularly nagging to have a bug-fix release, where no new functionality is added, but bugs fixed. Professor Stein once said that I could be the release manager for such a bug-fix release, but not to take too long about it. I decided that unless done correctly it wasn¡¯t worth doing.?

I recall one developer saying that he didn¡¯t care about bugs in his code, as he would fix them if reported. He was an extreme example though.?

I tried to get Professor Stein to buy 15 or so books on software engineering, and give them to the developers doing the most development, but I couldn¡¯t convince him to do that.?I don¡¯t know if things have changed, but I certainly didn¡¯t feel that there was as much emphasis on quality control as I would have wanted to see.?

Some mathematicians can write good code, but there was, and perhaps still is, really crap code in Sagemath. My favourite bit of code started

#!/bin/sh

The script then went to check some common commands like ls and cp existed. The biggest laugh was that it also checked if sh existed.?

It took some of the really ugly montecarlo integrals that
my son, the particle physicist, was working on, and found
that SageMath gave better answers than Mathematica, though
its speed was about an order of magnitude slower.

There are certainly going to be cases where one package beats another, but overall I think Mathematicia is hard to beat, and it¡¯s free on a Raspberry Pi.?

In my opinion at least, it¡¯s never going to meet its mission of creating a viable alternative to Magma, Maple, Mathematicia and Matlab.?


-Chuck Harris

Dave.?


 

Well, looks like you have an axe to grind, so I won't
get into it much with you. Open source software has to
cater to the characters that create it.

I have only used sagemath compiled to 64 bit on linux, so
your complaint about that is dated.

The configure package, written by Larry Wall, makes tests
like for the name used on the sh script. Sometimes sh is
sh, other times it is borne shell, or korn shell, or something
totally different aliased as sh... Likely, nothing to do with
Sagemath.

There are things that need work, but at least they don't
charge you to beta test their software.

Nothing is stopping anyone from forking the project, and
doing it themselves. I'd love to see your fork of the project.
Try that with mathematica.

In anycase, as flawed as you think the project is, I would bet
that it can easily run a version of Reg's filter code.

-Chuck Harris


On Wed, 10 Jul 2024 00:29:08 +0100 "David Kirkby"
<drkirkby@...> wrote:
On Tue, 9 Jul 2024 at 14:55, Chuck Harris via groups.io <cfharris=
[email protected]> wrote:

Recently, I was playing with open source Sagemath, and
it is quite interesting. It is a python based scripted
language that is much like mathematica. It is a symbolic
math package that does integration and differentiation.
It understands parallelism, though it needs you to give
it some help.

I used to work on the development of that. I got it ported to 32-bit
SPARC, but it wasn¡¯t happy if compiled 64-bit. Unfortunately the
timing of the port coincided with Oracle buying Sun, and basically
making the use of a Solaris version less attractive.

I would disagree that Sagemath is like Mathematicia.



Basically, you can think of it as giving the entire GNU
mathematics related packages a common user interface...

Sagemath adds a Python interface onto everything it includes, but
many of the things it uses have no library interface, so the
interface lacks the consistency of Mathematica. Sagemath simply uses
Expect or similar to pass data between programs.

Sagemath can call Mathematica, but unless things have changed, it
doesn¡¯t do this via the API to Mathematica, but just uses Expect.

Most calculus in Sagemath is done with Maxima. Again, Maxima has no
library interface, so something like Expect is used.

I don¡¯t know what it is like now, but I used to get fed up with the
speed of new releases, each time adding new features. I was regularly
nagging to have a bug-fix release, where no new functionality is
added, but bugs fixed. Professor Stein once said that I could be the
release manager for such a bug-fix release, but not to take too long
about it. I decided that unless done correctly it wasn¡¯t worth doing.

I recall one developer saying that he didn¡¯t care about bugs in his
code, as he would fix them if reported. He was an extreme example
though.

I tried to get Professor Stein to buy 15 or so books on software
engineering, and give them to the developers doing the most
development, but I couldn¡¯t convince him to do that. I don¡¯t know if
things have changed, but I certainly didn¡¯t feel that there was as
much emphasis on quality control as I would have wanted to see.

Some mathematicians can write good code, but there was, and perhaps
still is, really crap code in Sagemath. My favourite bit of code
started

#!/bin/sh

The script then went to check some common commands like ls and cp
existed. The biggest laugh was that it also checked if sh existed.?


It took some of the really ugly montecarlo integrals that
my son, the particle physicist, was working on, and found
that SageMath gave better answers than Mathematica, though
its speed was about an order of magnitude slower.

There are certainly going to be cases where one package beats
another, but overall I think Mathematicia is hard to beat, and it¡¯s
free on a Raspberry Pi.

In my opinion at least, it¡¯s never going to meet its mission of
creating a viable alternative to Magma, Maple, Mathematicia and
Matlab.



-Chuck Harris

Dave.






 

Thanks to Jeff Anderson's kindness I have now created my first non-minimum phase causal filter. The emphasis on minimum phase is such a dominant part of DSP in the geophysics community that I was *very* confused to find almost no mention of it at all in the EE DSP literature. John H. Karl is a professor of Physics and Astronomy. His graphic showing the division of causal filters into minimum and non-minimum phase branches combined with Jeff's patient persistence resolved my confusion.

The filter example is centered on 12 kHz with 1 Hz frequency bins and 24 kHz Nyquist. Time domain is 48 kSa/s. The prototype skirts are the same width as the pass band and have a sine taper. I then truncated the central part of the time domain response which produced the sinc side lobes in the frequency domain. Log scale is amplitude so 20*log(abs) rather than the 10*log(abs) for power.

I used Octave on Debian 10 for the examples simply because I didn't want to go hunting for an FFT of which I have so many from which to choose on my Solaris 10_u8 research system. It is much too old to connect to the Internet. I've also not done any serious software development in nearly 10 years and am a Sun Forte diehard. Best debugger ever. The only one that will let you evaluate a long FORTRAN expression on the debugger command line. I use mixed C89 and FORTRAN 77 and switch languages whenever it is more convenient to use the other language. This provides absolute control of variable scope and memory allocation as well as access to a vast library of very thoroughly tested dusty deck numerical codes, e.g. SLATEC, etc. So I always know exactly what the computer is doing. None of the infinitely many layers of obfuscation inherent in C++ and modern FORTRAN. Also much more economical use of core. That really matters when your data arrays run into many GB and the input data is many TB. I no longer do that, but having had to work my way down through layer upon layer of C++ classes I prefer simplicity and economical use of resources.

Have Fun!
Reg