Catalog PyPI
Back to packageRELEASE DETAILS

5.0.0

PyPI

aifourier

Python library for AI-based Fourier analysis of audio signals, powered by Sinusoidal Neural Networks (SNN).

Published18 Aug 2026
Direct dependencies6
Transitive dependenciesNot calculated

README

Version 5.0.0 documentation

AI-Based Fourier Analysis (aifourier)

aifourier_logo

"Machines can learn Fourier analysis."

aifourier is a Python library for AI-based Fourier analysis of audio signals, powered by Sinusoidal Neural Networks (SNN).

SinusoidalNN repo link (made by Jovan also): https://github.com/jovan-AIcoder/SinusoidalNN

Built on top of the SinusoidalNN python package framework, aifourier learns the frequency components of an audio signal through optimization instead of explicitly computing Fourier integrals.


✨ Features

  • 🔊 Analyze audio files (.wav, .mp3, .flac, .ogg)
  • 🌊 Built on top of SinusoidalNN
  • 🧠 Neural Fourier decomposition via optimization
  • 📊 Extract:
    • Frequencies (Hz)
    • Phase shifts
    • Amplitudes
  • ⚙️ Multiple optimizers
    • SGD
    • RMSprop
    • Adam
    • AdamW
    • Adagrad
    • Adadelta
    • Adamax
    • Nadam
    • Ftrl
  • 📈 Training MAE monitoring
  • ➕ Optional positive-frequency filtering
  • ➕ Optional absolute amplitudes
  • 💾 Save trained neural models
  • 📁 Pandas DataFrame output
  • ⚡ Simple one-line API

📦 Installation

pip install aifourier

🚀 Usage

import aifourier as aif

df = aif.analyze(
    "audio.mp3",
    optimizer="adam"
)

print(df.head())

📊 Output

The returned DataFrame contains:

ColumnDescription
FrequenciesLearned frequencies (Hz)
Phase shiftLearned phase shifts
AmplitudesLearned amplitudes

🧠 How It Works

Instead of evaluating Fourier coefficients analytically,

y(t) ≈ Σ Aᵢ sin(ωᵢ t + φᵢ)

Where:

  • Aᵢ = amplitude
  • ωᵢ = angular frequency
  • φᵢ = phase shift

these parameters are learned directly from data using a Sinusoidal Neural Network.


⚙️ Parameters

aif.analyze(
    audio_path,
    max_modes=10000,
    epochs=256,
    use_phase_shift=True,
    learning_rate=1e-5,
    save_model=None,
    verbose=2,
    positive_freqs_only=True,
    abs_amplitudes=True,
    optimizer="adam",
    show_spectrum=False,
    save_spectrum=None
)
ParameterDescription
audio_pathAudio file path
max_modesMaximum number of sinusoidal modes
epochsNumber of training epochs
use_phase_shiftLearn phase shifts
learning_rateOptimizer learning rate
save_modelSave trained model
verboseTraining verbosity (0, 1, 2)
positive_freqs_onlyKeep only positive frequencies
abs_amplitudesReturn absolute amplitudes
optimizerTraining optimizer
show_spectrumShow spectrum plot preview
save_spectrumSave spectrum plot figure to desired folder path

📁 Example

See the examples/ folder:

cd examples
python example.py

Example workflow:

  • Analyze bird.mp3
  • Learn sinusoidal spectrum
  • Export frequency table
  • Plot the learned spectrum

The learned spectrum is shown below.

Spectrum of bird.mp3



🌊 Relationship with SinusoidalNN

SinusoidalNN
        │
        ▼
   aifourier

SinusoidalNN provides the neural network engine.

aifourier provides an easy-to-use interface for AI-based Fourier analysis of audio signals.


💡 Future Ideas

  • Audio reconstruction
  • FFT comparison utilities
  • Real-time microphone analysis
  • Radio signal analysis
  • Oscilloscope support
  • Complex-valued SinusoidalNN

👤 Author

Jovan

2026


📜 License

MIT License


"What Fourier derives analytically, Sinusoidal Neural Networks can approximate through learning."

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
numpy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
numpyruntime
pandas
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pandasruntime
matplotlib
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
matplotlibruntime
tensorflow
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
tensorflowruntime
librosa
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
librosaruntime
sinusoidalnn
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
sinusoidalnnruntime

Distribution files

2 collected
aifourier-5.0.0-py3-none-any.whl

bdist_wheel · 5.98 KB · Python py3

Source file
aifourier-5.0.0.tar.gz

sdist · 5.21 KB · Python source

Source file

Repository

PENDING
jovan-aicoder/ai-based-fourier-analysis

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:44 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:98dbb68995e2cdaf77f599210d0a86f7af1b389c9dc4566e558beec09d4bedbb

Other collected versions

View all collected versions →