The most mind-bending phenomenon in the entirety of the cosmos is gravitational waves. When two massive celestial objects approach each other, they can begin to orbit. As the two objects accelerate each other, their orbits literally create ripples in the fabric of space-time. Analogously, if you threw a rock into a pond, ripples would propagate across the surface. In this situation, the surface of the pond represents the fabric of space.
The most common events that cause these waves are binary black hole mergers (BBH), binary neutron star mergers (BNS), and black hole–neutron star mergers (BHNS). In layman's terms, this happens when either two black holes, two neutron stars, or a black hole and a neutron star orbit each other and eventually collide or merge. Below is a video that shows what these mergers and waves look like (credit: NASA and GSFC):
This program (as the name suggests) analyzes an input gravitational wave signal and classifies the event as either a BBH, BNS, or BHNS. To run it, go into the console and execute python console_main.py. It will ask whether you want to generate synthetic data or use your own data file. If you choose to generate synthetic data, the program will create a mock gravitational wave file and analyze it. If you choose to use your own data, you will need to input the file location, and the program will analyze it accordingly.
Once it has finished inspecting the data, it will output a prediction on whether it was a BBH, BNS, or a BHNS merger with a percentage probability for each. It will also give you multiple plots: Gravitational Wave Signal, Classification Results, Frequency Spectrum, 3D Spectrogram Surface, and a 3D Phase Space Trajectory.
The Gravitational Wave Signal plot shows the raw gravitational wave signal over time. These graphs can display the classic gravitational wave signature of objects spiraling faster as they get closer. The Classification Results plot is a simple bar graph showing how confident the program is about each type of cosmic event. The Frequency Spectrum is a spectrogram that shows how the signal's frequency changes over time—different event types have different frequency patterns. The 3D Spectrogram Surface is a 3D view of the frequency spectrum, giving you a better picture of how the signal evolves in both time and frequency. Lastly, the 3D Phase Space Trajectory is the most complex graph of the five, but can also be the most useful. It shows how the signal evolves in three dimensions, which can help determine which types of cosmic objects are colliding.
When you run the Python file, the program loads all its tools for math, graphics, and signal analysis. It then prints a message in the console asking what type of data you want to analyze (your own or synthetic). Once you decide (let's say you added your own data, though the process is almost the same), it takes the messy, raw numbers and makes them neat and consistent. It removes the background noise and then extracts exactly 2,048 data points. It examines how loud the signal becomes, what pitch it has (high or low frequency), how the pitch changes over time, and how much the signal wiggles around.
It will then use machine learning to compare the results with data from hundreds of detected gravitational waves. It will also use known physical principles of how these waves behave to predict what type of event it was. By combining the physical principles of the wave with machine learning, it will give you the probability for each event type. After that, it creates the five graphs I explained earlier and saves them in the program folder. Below, you can see how the program runs:
This project took a really long time to finish. It was my most ambitious project aside from the radio telescope. I still plan to do software-related projects, but I'm going to channel most of my energy toward the radio telescope because I find it the most fun and interesting. Make sure to tune in to future blogs to keep track of my progress. In the meantime, stay curious.