Metadata-Version: 2.4
Name: ngene-fastica
Version: 0.1.1
Summary: A lightweight FastICA implementation for educational and local waveform separation demos.
Author-email: Hyunsuk Frank Roh <frank@ngene.org>
Project-URL: Homepage, https://ngene.org/waveform.html
Project-URL: Demo, https://ngene.org/waveform.html
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Classifier: Intended Audience :: Education
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.22
Dynamic: license-file

# nGene FastICA

A lightweight FastICA implementation for educational signal separation and local waveform separation demos.

This package keeps the FastICA engine simple and local. The browser-based PyScript waveform separation interface can be documented separately and linked from the project homepage.

## Install locally during development

```bash
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -e .
```

## Basic usage

```python
import numpy as np
from ngene_fastica import FastICA

# Shape convention: rows are observed mixtures, columns are samples.
X = np.random.randn(3, 10000)
S = FastICA(n_components=3, random_state=42).fit_transform(X)
print(S.shape)
```

## Local waveform separation demo

After local installation:

```bash
python examples/local_waveform_separation.py
```

Or, after package installation:

```bash
ngene-fastica-demo
```

The demo writes WAV files for generated sources, mixed signals, and separated signals. ICA recovers sources up to permutation and sign, so the separated files may not match the original source order exactly.

## PyScript demo

PyScript waveform separation requires browser-specific audio handling, HTML, JavaScript, and UI wiring. The package provides the local ICA engine and a reproducible local waveform example; the complete browser demo can be linked here:

https://ngene.org

## Notes

- Input shape is `(n_signals, n_samples)`.
- The implementation uses NumPy only; SciPy is not required.
- This is intended as a lightweight educational/demo package, not a replacement for mature scientific packages.
