{ "info": { "author": "Samuele Favazza", "author_email": "sfavazza.github@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering" ], "description": "# pyPhix, the Python Fixed Point module\n\n**pyPhix** is a python package for fixed point number representation.\nIt is intended to support the implementation of digital signal processing systems.\nAs such only fix-point addition, subtraction and multiplication operations are implemented.\n\nYou can find more information about the module objects and functionalities at\n[readthedocs](https://pyphix.readthedocs.io/en/latest/) project page.\n\n## Features\n\n* virtually unlimited number length (depending on your RAM size)\n* based on NumPy\n* customizable rounding method (```SymInf```, ```SymZero```, ```NonSymPos```,\n```NonSymNeg```, ```ConvEven```, ```ConvOdd```, ```Floor```, ```Ceil```)\n* customizable wrapping method (```Sat```, ```Wrap```)\n* support various representation formats (```bin```, ```hex```, ```int```, ```float```)\n* perform single or array based operations with customizable output format (```+```, ```-```, ```*```)\n\n## License\n\n### pyPhix\npyPhix is an open source python module released under the terms of\n[Mozilla Public License Version 2.0](LICENSE.txt).\n\n### NumPy\n**NumPy** is the fundamental package needed for scientific computing with Python and it is released under these\n[terms](https://github.com/numpy/numpy/blob/master/LICENSE.txt \"Numpy license\").\n\n## Install\n\nThe **pyPhix** package is available on [pypi.org](https://pypi.org/project/pyPhix).\nYou can install it by running:\n\n```$ pip install pyphix```.\n\nAlternatively you can clone the **pyPhix** repository and from the folder containing the *setup.py* file run:\n\n```$ python setup install```\n\nThis package requires Python 3.6 to work.\n\nYou can also directly download the tar.gz archive from [pypi.org](https://pypi.org/project/pyPhix#files).\nThe archive can be easily verified by adding the gpg public key\n[1E948096166391C0](https://pgp.mit.edu/pks/lookup?op=vindex&search=0x1E948096166391C0)\nto your keyring.\n\n## Usage Examples\n\n### Fix Format\n\nThis object is used to indicate the number of bits the user wants to use for value reprensetation.\n\nCreate fix-point format objets:\n```\n>>> from pyphix import fix\n>>> fmt_a=fix.FixFmt(True, 2, 10)\n>>> fmt_b=fix.FixFmt(False, 0, 7)\n```\n\nPrint the maximum representable ranges and test if a value is included in the range:\n```\n>>> fmt_a.fixrange\n(-4.0, 3.9990234375)\n\n>>> fmt_b.fixrange\n(0.0, 0.9921875)\n\n>>> -10 in fmt_a\nFalse\n\n>>> 0 in fmt_b\nTrue\n```\n\nDifferent representations are available:\n```\n>>> fmt_a.tuplefmt\n(True, 2, 10)\n\n>>> fmt_b.listfmt\n[False, 0, 7]\n\n>>> print(fmt_b)\n(False, 0, 7)\n```\n\n### Fix Number\n\nThis object contain fix-point number represenation.\n\nRound methods comparison, assuming format *(True, 4, 5)*:\n\n| Round method | Pos odd fraction | Pos even fraction | Neg odd fraction | Neg even fraction |\n|---------------|:----------------:|:-----------------:|:----------------:|:-----------------:|\n|**Real value** |7.296875 |2.325 |-1.078125 |-1.08125 |\n|**Mult by 2^5**|233.5 |74.4 |-34.5 |-34.6 |\n|```SymInf``` |7.3125 |2.3125 |-1.09375 |-1.09375 |\n|```SymZero``` |7.28125 |2.3125 |-1.0625 |-1.09375 |\n|```NonSymPos```|7.3125 |2.3125 |-1.0625 |-1.09375 |\n|```NonSymNeg```|7.28125 |2.3125 |-1.09375 |-1.09375 |\n|```ConvEven``` |7.3125 |2.3125 |-1.0625 |-1.09375 |\n|```ConvOdd``` |7.28125 |2.3125 |-1.09375 |-1.09375 |\n|```Floor``` |7.28125 |2.3125 |-1.09375 |-1.09375 |\n|```Ceil``` |7.3125 |2.34375 |-1.0625 |-1.0625 |\n\nA small usage example:\n```\n>>> from pyphix import fix\n>>> from pyphix.fix import ERoundMethod, EOverMethod\n>>> fmt = fix.FixFmt(True, 4, 5)\n>>> fix_vec = fix.FixNum(\n [7.296875, 2.325 , -1.078125, -1.08125], fmt,\n rnd=ERoundMethod.CONV_ODD, over=EOverMethod.WRAP)\n>>> fix_val = fix.FixNum(\n 1.16, fmt,\n rnd=ERoundMethod.CONV_ODD, over=EOverMethod.WRAP)\n```\n\nPerform a full resolution addition:\n```\n>>> fix_vec + fix_val\n[8.4375 3.46875 0.0625 0.0625 ]\n\n fmt: (True, 5, 5)\n rnd: ERoundMethod.CONV_ODD\n over: EOverMethod.WRAP\n```\n\nPerform a multiplication and cast result to a small format:\n```\n>>> fix_val.mult(\n fix_vec, out_fmt=fix.FixFmt(False, 3, 2),\n rnd=ERoundMethod.SYM_INF, over=EOverMethod.SAT)\n[7.75 2.75 0. 0. ]\n\n fmt: (False, 3, 2)\n rnd: ERoundMethod.SYM_INF\n over: EOverMethod.SAT\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sfavazza/pyphix", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyPhix", "package_url": "https://pypi.org/project/pyPhix/", "platform": "", "project_url": "https://pypi.org/project/pyPhix/", "project_urls": { "Homepage": "https://github.com/sfavazza/pyphix" }, "release_url": "https://pypi.org/project/pyPhix/0.1/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "The Python Fixed Point module", "version": "0.1" }, "last_serial": 4112301, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "b4b5da9203296efbe404c8576e61225b", "sha256": "f421cae379f0603178c4ffb01b069dbe1c9c2a6891498b728d9a7842b0bc5680" }, "downloads": -1, "filename": "pyPhix-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b4b5da9203296efbe404c8576e61225b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11951, "upload_time": "2018-07-28T20:38:59", "url": "https://files.pythonhosted.org/packages/79/cb/5b89e63acddfeb8b33b75d70dcfe4c9f568ae4f11de6f8630093cbcd7655/pyPhix-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61e7078d05adc8c2836d4c0fb58111b6", "sha256": "8cb87ee23c280fb8a506904b9d7f8d80cd97cf89eea6fe4efe90857e3eb841cf" }, "downloads": -1, "filename": "pyPhix-0.1.tar.gz", "has_sig": true, "md5_digest": "61e7078d05adc8c2836d4c0fb58111b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11403, "upload_time": "2018-07-28T20:39:00", "url": "https://files.pythonhosted.org/packages/e9/32/08bebf0e22dc65f5a7c72f4769ded3760a01eaeadd5b1a309592307ae65e/pyPhix-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b4b5da9203296efbe404c8576e61225b", "sha256": "f421cae379f0603178c4ffb01b069dbe1c9c2a6891498b728d9a7842b0bc5680" }, "downloads": -1, "filename": "pyPhix-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b4b5da9203296efbe404c8576e61225b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11951, "upload_time": "2018-07-28T20:38:59", "url": "https://files.pythonhosted.org/packages/79/cb/5b89e63acddfeb8b33b75d70dcfe4c9f568ae4f11de6f8630093cbcd7655/pyPhix-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61e7078d05adc8c2836d4c0fb58111b6", "sha256": "8cb87ee23c280fb8a506904b9d7f8d80cd97cf89eea6fe4efe90857e3eb841cf" }, "downloads": -1, "filename": "pyPhix-0.1.tar.gz", "has_sig": true, "md5_digest": "61e7078d05adc8c2836d4c0fb58111b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11403, "upload_time": "2018-07-28T20:39:00", "url": "https://files.pythonhosted.org/packages/e9/32/08bebf0e22dc65f5a7c72f4769ded3760a01eaeadd5b1a309592307ae65e/pyPhix-0.1.tar.gz" } ] }