Hands-on Chirplet Transform parameter estimation using Python

This is how to estimate the parameters of your Chirplet, using Python

Piero Paialunga
Towards Data Science

--

Photo by Adi Goldstein on Unsplash

One of the most common operations of Signal Processing is to transform the signal. The reason why we do that is that it is not always true that the easiest way to perform operations on your signal is by looking at it and analyzing it in its natural domain*.

* I will refer to the natural domain as the original space of the signal. For example, if the signal is a time series, the natural domain is the 2D one where the x is the time and the y is the signal value

In my latest medium article, I explained the difference between the Fourier Transform and the Chirplet one.

The key difference between these two signals is that the Fourier Transform is used for signals that have non-dependency between time and frequency (Frequency is not time-dependent). Here’s an example of a signal that can be analyzed and transformed using a Fourier Transform:

Image by author

On the other hand, some signals have a non-fixed frequency (frequency is indeed time-dependent). Here’s an example of this kind of signal:

Image by author

And we can analyze this signal using the chirplet transform.
In my latest article, I explain how a chirplet transform is defined, how to implement it in Python, and how to plot it.

One of the questions that I received is particularly interesting and it is the following:

Image by author

And this is exactly what we are going to be talking about in this article 🙃

1. The challenge

So we know that a Chirplet is a signal with a well-known analytical equation:

Image by author

And we have seen that by changing the set of parameters (beta, alpha1, alpha2, fc, tau and phi) we can describe different kinds of chirplets.

Now, let’s say we have a new chirplet. This chirplet is completely defined* by a set of these 6 values.

* By completely defined I mean that the signal is represented by one and only one set of parameters and vice-versa.

So let’s say that this signal we want to characterize in terms of a chirplet has the following set of parameters:

Image by author

How do we get to estimate these 6 parameters?

2. Brute Force: a non-feasible method

Let’s say I’m completely lost and I have no idea how to do this task. A very simple method to do that and find this \hat{\theta} set of parameters is the so called brute force. It means:

“Try all the possible combinations of these 6 parameters and see which one works better”

This method is surely theoretically doable. Of course, if we discretize this 6-dimensional space enough, in the end, we will have a good estimate of the real set of parameters. What is the problem though?

Well, the real problem with this method is, as always when we consider brute force methods, the computational complexity.
Let’s say we generate a random chirplet. We do this with the following code:

So you only need about (10^-3) seconds to generate a random chirplet. But how many chirplets do we need to enumerate all the possible combinations of chirplets?

Let’s say that k_{variable} is the number of values of your discrete space. For example, if all the alpha_1 values that you are considering are [0,2,5] you will have that:

Image by author

Now, let’s take the following assumptions:

Image by author

This means that the number of chirplets we have to consider is the following:

Image by author

And the computational time is:

Image by author

Now, let’s change this K and see the value of this computational time.
If we plot this we get quite an interesting result 😅:

Image by author

I feel that while we wait 9 years to do our computation for K=80 we might as well find a smarter solution in the meantime 🙃

3. Formal Method

Let’s formalize our goal. Again, we want to find the theta vector:

Image by author

This theta vector uniquely defines the following chirplet:

Image by author

Now, of course, we don’t have the analytical expression of this function, but we only have its time series (or numerical representation).

Now let’s define a so called chirplet kernel. This chirplet kernel has the following expression.

Image by author

Where:

Image by author

I think I’m boring you enough so I won’t explain all the details of these parameters (but please read here if you want to know them!). The important thing is that, as you can see, the chirplet kernel has the same expression as the chirplet that we defined. Now, this chirplet is of course parametric, and it depends on this hat gamma vector. The idea is then the following:

We project our signal on the N-dimensional vector identified by this chirplet kernel. This projection is parametric and it depends on the parameters of the chirplet kernel. Then we change this vector by changing this gamma vector and finding the optimum value and getting the correspondent theta (again, read here for more information about it!)

Image by author

If we want to find the largest value of this projection we compute its gradient. The 0 value of this gradient will of course give us our optimal value of hat theta.

Given this formal definition of our problem, we can now start finding our optimum value. In particular:

  • We iterate over alpha1 finding the largest coefficient argument
  • We iterate over alpha2 finding the largest coefficient argument
  • We find tau and beta using the Hilbert Transform
  • We find the frequency (fc) and the phase (phi) using the Fourier Transform

Let’s implement this!

4. Hands-on Implementation

This estimation can be done with the following code:

Let’s test it!
Using the following function we estimate the parameters and create our estimated chirplet.

Of course, we want the input signal to be identical to the reconstruction. Let’s see if that is the case.

Well, as we can see the reconstruction is not always perfect.

Nonetheless, we saw that we are looking for a solution in a huge dimensional space (by huge I mean that the space grows exponentially with the number of parameters) and the problem is an NP-hard problem with a non-unique solution (read more here).

For these reasons, I find these results pretty great. 🤩

5. Conclusions

If you liked the article and you want to know more about Machine Learning, or you just want to ask me something you can:

A. Follow me on Linkedin, where I publish all my stories
B. Subscribe to my newsletter. It will keep you updated about new stories and give you the chance to text me to receive all the corrections or doubts you may have.
C. Become a referred member, so you won’t have any “maximum number of stories for the month” and you can read whatever I (and thousands of other Machine Learning and Data Science top writers) write about the newest technology available.

The paper that has been used as a reference for this article is the following: A Successive Parameter Estimation Algorithm for Chirplet Signal Decomposition. This GitHub folder has also been used as a starting point

--

--

PhD in Aerospace Engineering at the University of Cincinnati. Machine Learning Engineer @ Gen Nine, Martial Artist, Coffee Drinker, from Italy.