For research and experimental purposes only. Not intended for trading decisions.
This document, registered in 2016, establishes the conceptual foundation for the harmonic analysis later applied in projects like Time-Series-Sound.
The harmonic approach used in this project originates from a registered literary work in 2016, 'LA FRECUENCIA ARMÓNICA EN EL ANÁLISIS DE VALORES DE LOS MERCADOS BURSÁTILES', which laid the theoretical foundation for sonifying financial time series.
Sonification of financial time series through spectral analysis and musical note mapping.
This project transforms percentage changes in financial time series into audible frequencies using harmonic proportions and fundamental frequency detection. It generates both a CSV file with the mapped notes and a WAV audio file for auditory analysis.
Series Sound is a Python-based tool that converts financial time series data into an audible representation. By analyzing percentage changes and extracting the fundamental frequency via FFT, it assigns harmonic frequencies to each data point and generates a sequence of musical notes. The result is a WAV audio file that allows traders and analysts to "hear" the market movements.
-
Spectral analysis: The script applies a Hann window and FFT to the time series to detect the fundamental frequency (or uses a default of 440 Hz).
-
Normalization: Percentage changes are smoothed and scaled to control the dynamic range.
-
Harmonic mapping: Frequencies are multiplied by just intonation proportions (unison, major third, fifth, etc.) to create harmonic richness.
-
MIDI conversion: Each frequency is converted to the nearest MIDI note for labeling.
-
Audio synthesis: Pure tones are generated for each data point and concatenated into a WAV file.
The objective is to provide an alternative sensory channel for analyzing financial time series, potentially revealing patterns or anomalies that are not easily spotted in visual charts. By sonifying the data, the user can listen to changes in volatility, trends, and price dynamics.
You can hear the sonification of financial time series in action.
This audio example was generated with this project:
Click the image or watch on YouTube
As an interesting parallel, modern Large Language Models (LLMs) can also process and generate information through audio representations.
When LLM-based systems interact with speech models, communication may involve acoustic signal processing, waveform encoding, spectral decomposition, and frequency-domain transformations — conceptually similar to how this project converts financial time series into sound.
While LLMs do not "think in audio" by default, multimodal AI systems frequently rely on spectral analysis and waveform modeling when handling speech-to-text and text-to-speech tasks.
This project explores a similar idea from a quantitative finance perspective:
transforming abstract numerical structures into audible signals to reveal hidden patterns through an alternative sensory channel.
- Updating
pippython.exe -m pip install --upgrade pip py -m pip --version
- Installing
virtualenvpy -m pip install --user virtualenv
- Creating a virtualenv:
py -m venv env .\env\Scripts\activate
- Install all dependencies:
pip install -r requirements.txt
Show help:
python Spectral_Analysis.py --helpRun the script:
python Spectral_Analysis.pyAvailable dates:
- 2022-05-12
- 2022-05-13
- 2022-05-14
Enter the number of the date you want to analyze (or 'q' to quit): 1
- Audio generated: MUSIC/audio_2022-05-12.wav
- CSV saved: MUSIC/output_2022-05-12.csv
All required packages are listed in requirements.txt:
numpy
pandas
librosa
soundfile
scipy
tqdmThis project is licensed under the MIT License. See the LICENSE file for details.
MIT License
Copyright (c) 2025 Nestor Mendez / FiboQuant_MX
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Nestor Mendez / FiboQuant_MX / GitHub: @newnes
Contributions, issues, and feature requests are welcome. Feel free to open an issue or submit a pull request.
If you find this project interesting, please give it a star on GitHub.
