lasprs 0.6.7

Library for Acoustic Signal Processing (Rust edition, with optional Python bindings via pyo3)
Documentation
{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "6763c6d0-878f-4492-840e-40d11a52f91e",
   "metadata": {},
   "source": [
    "# Test Welch method implementation Python wrappers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6c06a0c3-dcf7-4d21-b1f3-eced84e31218",
   "metadata": {},
   "outputs": [],
   "source": [
    "!cd .. && maturin develop -F python-bindings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3e651371-e7a5-4013-a265-ab80f8b1eb41",
   "metadata": {},
   "outputs": [],
   "source": [
    "from lasprs import WindowType, ApsSettings, AvPowerSpectra, ApsMode, Overlap, FreqWeighting"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9d6bdf3b-40f8-4c3b-85ac-4ff8b8c7dcae",
   "metadata": {},
   "outputs": [],
   "source": [
    "w = WindowType.all()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3a31899d-37de-4653-9b6e-61dcf7c683f4",
   "metadata": {},
   "outputs": [],
   "source": [
    "settings = ApsSettings(ApsMode.AllAveraging(), Overlap.NoOverlap(), WindowType.Hann, FreqWeighting.A, 2048, 48000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b4771bde-f3f3-4639-bbe6-96f49e004b3d",
   "metadata": {},
   "outputs": [],
   "source": [
    "aps = AvPowerSpectra(settings)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "86cac094-5969-4a75-83c3-49b486687bb1",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "signal = np.zeros(48000)\n",
    "signal[200] = 1\n",
    "import matplotlib.pyplot as plt\n",
    "plt.plot(aps.compute(signal[:,None])[:,0,0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8d72aa7b-0cff-463c-be57-666cf74f6793",
   "metadata": {},
   "outputs": [],
   "source": [
    "#!pip install matplotlib"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}