lasp/examples/Test SeriesBiquad.ipynb

115 lines
2.3 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from lasp import SeriesBiquad\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2022-09-03 17:21:46+0200 DebugTrace-cpp 2.0.0a2 (g++ 12.2.0)\n",
"2022-09-03 17:21:46+0200 \n",
"2022-09-03 17:21:46+0200 Enter SeriesBiquad (lasp_biquadbank.cpp: 12)\n",
"2022-09-03 17:21:46+0200 Leave SeriesBiquad (lasp_biquadbank.cpp)\n"
]
}
],
"source": [
"coefs = np.array([1.,0,0,1.,-.9,0])\n",
"bq = SeriesBiquad(coefs)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2022-09-03 17:21:47+0200 \n",
"2022-09-03 17:21:47+0200 Enter filter (lasp_biquadbank.cpp: 44)\n",
"2022-09-03 17:21:47+0200 Leave filter (lasp_biquadbank.cpp)\n"
]
}
],
"source": [
"x = np.zeros(10, dtype=float)\n",
"x[0] = 1\n",
"\n",
"x2 = bq.filter(x)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[1. ],\n",
" [0.9 ],\n",
" [0.81 ],\n",
" [0.729 ],\n",
" [0.6561 ],\n",
" [0.59049 ],\n",
" [0.531441 ],\n",
" [0.4782969 ],\n",
" [0.43046721],\n",
" [0.38742049]])"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x2"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.10.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}