News for hackers. Stuff that matters.
Re:Cosine Implementation in C by vector_spaces on Friday March 31, 2023 @11:26AM (#35388549)
Does anyone know of a good reference on signals and systems for people with a pure math background rather than an engineering or physics background?

So, the implementation linked above uses the polynomial of best approximation to cosine on an interval. That polynomial was presumably obtained using the Remez algorithm, which, given a function f and a set of n+2 points in your desired interval, yields a polynomial of degree n best approximating f in the interval (in the uniform norm sense)[1] by performing a sequence of linear solves

I have a math and specifically approximation theory background, and the wiki article on the Remez algorithm makes a lot of sense to me. Like, this is the language I speak: https://en.wikipedia.org/wiki/Remez_algorithm

I'm less comfortable though when I try to understand the documentation for the remez implementation in SciPy because it is using the language of signals and systems, which is how engineers think about this stuff: https://docs.scipy.org/doc/scipy/reference/generated/scipy.s...

Signals seems to use a lot of analogies to sound waves, and it does map in some way or another to the mathematical language I'm comfortable with. I've spent a little bit of time reading papers and introductory texts on signals, but the definitions feel a little loosey goosey to me.

Anyway, just opportunistically using this thread to ask if anyone knows of some book or papers or blog posts that can help me translate this stuff into math language :)

Re:Cosine Implementation in C by asdf_snar on Friday March 31, 2023 @11:31AM (#35388619)
Just noting that your link to docs.scipy is broken. I'm also in a similar boat to you and would be interested in an answer to this question.
Re:Cosine Implementation in C by vector_spaces on Friday March 31, 2023 @11:49AM (#35388913)
Thanks, fixed it!
Re:Cosine Implementation in C by ur-whale on Friday March 31, 2023 @11:40AM (#35388777)
I feel your pain.

I've spent most of my career working at the intersection of multiple highly technical domains, both theoretical and applied, and a) the "jargon switch" b) the methodology differences and worst c) the switch of conceptual framework required to work on a problem that spans multiple domains is initially very irritating.

I'm pointing that out because if you are only looking for a rosetta stone to only tackle a), even if you find one, it'll leave you wanting because you'll still need maps to tackle b) and c)

Example: analog electronics. From a mathematician's POV, an analog circuit is just a system of differential equations.

But very few analog electronics specialist ever think about a circuit that way.

The words they use are the least important part of the "translation" problem. The way they approach and think about the system will be utterly alien to a pure or even applied math person.

Eventually, after learning the trade, you'll start to see familiar patterns emerge that can be mapped back to stuff you're familiar with, but a simple "this EE jargon means that in math language" won't be enough: you're going to have to get your hands dirty and learn how they think of the problem.

Re:Cosine Implementation in C by benj111 on Saturday April 01, 2023 @12:35PM (#35401617)
This mirrors my experience (failing) to learn a second language.

The words are the easy bit. It's the constructs, genders etc that's the hard bit.

Re:Cosine Implementation in C by lntue on Friday March 31, 2023 @11:58AM (#35389045)
I don't know much about numpy.signal package, but there are other python packages that have good implementation for generating polynomial approximation. Among them are pythonsollya (a Python wrapper for Sollya), and SageMath.

Other than that, some of the overview references about Remez algorithm (should be a bit closer to your taste) that I like are:

- J.M. Muller et. al., "Handbook of Floating-Point Arithmetic", section 10.3.2 (and follow references in that section).

- N. Brisebarre and S. Chevillard, "Efficient polynomial L-approximations," 18th IEEE Symposium on Computer Arithmetic (ARITH '07), which is implemented in Sollya tool: https://www.sollya.org/sollya-2.0/help.php?name=fpminimax

Re:Cosine Implementation in C by stagger87 on Friday March 31, 2023 @12:24PM (#35389428)
The scipy documentation you linked is specifically for generating a FIR filter using the Remez algorithm, which is why it is written in that style. It is a very specific use case of the algorithm and probably not the one I would recommend learning from. Another top level comment has a link to a decent overview of the Remez algorithm written without the "Signals and Systems" language.
Re:Cosine Implementation in C by vector_spaces on Friday March 31, 2023 @12:40PM (#35389639)
Thanks, I think my request was unclear, but I'm specifically trying to understand the documentation linked, not the Remex algorithm itself. I'm trying to reconcile my knowledge of it with the language used in the documentation.

I have a pretty comfortable understanding of the Remez algorithm and generalizations and have written my own implementations for a research project

Re:Cosine Implementation in C by stagger87 on Friday March 31, 2023 @01:38PM (#35390398)
Take a look at the 2 listed references by Parks and McClellan. They are considered seminal papers in the field of signal processing and are the basis of the function you linked. And they will probably appeal to your math background more.

The name of the algorithm is Parks McClellan filter design, or sometimes you will see it named firpm, as popularized by MATLAB.

https://en.wikipedia.org/wiki/Parks%E2%80%93McClellan_filter....