Generate noise signal based on PSD measurement and analyze the output
Project description
Propoptics
propoptics is a small Python package aimed at providing tools to generate pulse train based on measured noise power spectral densities (PSDs), as done in [1]. This functionality is available both via the Python interface and via a command-line interface (CLI). Moreover, it provides a limited number of analysis tools (Python API only):
- Tooling for spectral filtering and integration, allowing users to quickly convert a series of optical spectra into a sequence of values (energy or timing delay).
- A wrapper around
scipy.signal.welchto make power spectral density estimations easier.
Supported diagnostics are:
| Time series data | Frequency data |
|---|---|
| energy | relative intensity noise |
| timing delay | timing jitter, directly related to phase noise |
Installation
With uv
The easiest way to use the CLI is to use uv. For people unfamiliar, Python can be confusing or finicky with its different version, virtual environments, etc. uv is a Python package manager that takes care of everything. Even if you have never installed python on your computer, you can start using propoptics with these simple steps.
- install
uv(instructions here) - install
propopticsby running
uv tool install propoptics
You may need to close and re-open your terminal after the first step so that the new uv program is detected.
You can also run propoptics directly without installing it first by running
uv tool run propoptics
uvx propoptics # short hand version, same functionality
From PyPI
The minimum supported Python version is 3.11.
If you manage your project with uv, simply add propoptics with
uv add propoptics
Of course, it is available from pip as well:
pip install propoptics
You can also install from source, in which case you must install the development dependencies and have a Rust compiler installed. rustc 1.86.0 is the only version tested.
CLI quick start
Check that the installation was successful by running
propoptics --version
At the moment, there are two commands. You can learn about them with
propoptics check --help
propoptics time-series --help
propoptics check
You can check that propoptics is loading your measurement file correctly with
propoptics check path/to/measurement.csv
This command will open the file and show a plot of the data. Please check that it matches what you expect.
propoptics time-series
Generate a time series with the time-series command:
Load a PSD file in dBc/Hz scale, create a noise signal with 512 points, plot the result and output the data to stdout
propoptics time-series path/to/measurement.csv --nt 512 --plot --scale dBc
Load a PSD file in linear scale (Hz^-1), create a noise signal with 1024 points and output the result to a CSV file
propoptics time-series path/to/measurement.csv --nt 1024 -o signal.csv
Load a PSD file in dBm scale, where the DC average (measured separately) is 3V and the input impedance of the digital signal analyzer is 50 Ohm (the default). By providing the average optical power and the wavelength, create a noise signal with 256 points where the shot-noise limit has been subtracted and output the result to a Matlab file.
propoptics time-series path/to/measurement.csv --nt 256 --scale dBm --ref 3 --power 1 --wavelength 800e-9 -o signal.mat
Get help with all parameters with propoptics --help. In particular, pay attention to the --scale parameter. At this stage, only Numpy binary files (.npy) and ASCII test files (.csv, .tsv, .dat, ...) are supported.
Python API quick start
Generate a pulse train:
import propoptics
import numpy as np
freq, rin_psd = np.load("path/to/measurement")
rin_obj = propoptics.NoiseMeasurement(freq, rin_psd)
t, signal = rin_obj.time_series(nt=32, rng=123456789)
Check the examples in the examples folder.
Welch method
Welch's method is at the heart of this module. It is used when running the propoptics.NoiseMeasurement.from_time_series to analyze the output of propoptics.energy_signal or propoptics.jitter_signal. Please look the full_workflow.py example for more info.
The total number of points must account for 50% overlap when using the Welch method
Each · corresponds to one pulse:
time -->
0 nt/2 nt
┃·······┃·······┃·······┃·······┃
┆ ┃·······┃·······┃·······┃
┆ ┆ ┆ ┆
┆ ┆ >┆ ┆< = nperseg
>┆ ┆< = nperseg // 2
Reference
[1] CAMENZIND, Sandro L., SIERRO, Benoît, WILLENBERG, Benjamin, et al. Ultra-low noise spectral broadening of two combs in a single ANDi fiber. APL Photonics, 2025, vol. 10, no 3.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file propoptics-0.1.3.tar.gz.
File metadata
- Download URL: propoptics-0.1.3.tar.gz
- Upload date:
- Size: 138.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
693b4e3d8eab8863a40611906fa57f5f5c8f6f971dd84dd01a39ebb5eac2c51a
|
|
| MD5 |
c3897f706f3edab71ccdb5a949d7a1bb
|
|
| BLAKE2b-256 |
996efda2ab9acc21fc55ffc4a2ea48d012acd8fd61f29599bfb48c6239f0ffcc
|
File details
Details for the file propoptics-0.1.3-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: propoptics-0.1.3-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 549.2 kB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f97cefa717a69ab0e347d64157a92f74ae3a69506db51772b737efda462e6097
|
|
| MD5 |
659f21f8c0fa28d657384662105c6858
|
|
| BLAKE2b-256 |
de6b757590dbf6c40ea4847163d7505a72c20c1612d660b4bd0db159201f7001
|
File details
Details for the file propoptics-0.1.3-cp311-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: propoptics-0.1.3-cp311-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 757.9 kB
- Tags: CPython 3.11+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d152a2717dbd242db478b0e98b62c86e2fdcf424d357b1937f32bb3b2a2509ea
|
|
| MD5 |
3a781f3b28ed46f17dd74f9921f8827f
|
|
| BLAKE2b-256 |
9d25167ef073827daf81e8ba291714e193d559918ae9ba2749faac4528d57237
|
File details
Details for the file propoptics-0.1.3-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: propoptics-0.1.3-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 601.4 kB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
376fc039754a9530f5009abb0d3ad8959c9411efe52c06b5cda4363f2d99c7d3
|
|
| MD5 |
e62117a6c5e6068ee54496354255fe2b
|
|
| BLAKE2b-256 |
5ddad33ef40a4106ffc54750842b2b5a5589cff7e2190078f14c02e64d117d16
|
File details
Details for the file propoptics-0.1.3-cp311-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: propoptics-0.1.3-cp311-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 709.7 kB
- Tags: CPython 3.11+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0f6b6f798d49f3b40bbf048e34311435e70429e83b9e6e1926cb90633bd0138
|
|
| MD5 |
06b67163e26e0d5e4f3918e892d135a3
|
|
| BLAKE2b-256 |
e74c83d9f341786f58c3db3ecbd492d7f17bfaa27c0c872132945588ceb1067c
|