lasp/examples/Test SeriesBiquad.ipynb

114 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": 6,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2022-08-16 15:02:57+0200 \n",
"2022-08-16 15:02:57+0200 Enter SeriesBiquad (lasp_biquadbank.cpp: 12)\n",
"2022-08-16 15:02:57+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": 7,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2022-08-16 15:02:57+0200 \n",
"2022-08-16 15:02:57+0200 Enter filter (lasp_biquadbank.cpp: 41)\n",
"2022-08-16 15:02:57+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": 8,
"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": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x2"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 4
}