qformatpy


Nameqformatpy JSON
Version 0.1.4 PyPI version JSON
download
home_page
SummaryA Python library for Q format representation and overflow handling.
upload_time2024-01-23 19:41:57
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords dsp fixed-point signal-processing qformat
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Welcome to QformatPy documentation!
========================================================

Introduction
------------
Welcome to the qformat Python library, a powerful tool for formatting floating-point
numbers into fixed-point representation with Q notation. 

This library supports ARM's Q format, where QI includes the sign bit. 

The main function, qformat, allows users to specify the number of integer bits (QI),
fractional bits (QF), whether the number is signed or unsigned, and provides flexibility 
in choosing rounding and overflow handling methods.

Whether you're working on embedded systems, signal processing, or any application requiring fixed-point 
representation, qformat is here to streamline the process.

The example below shows pi being converter to the sQ4.8 format, using Truncation as the
rounding method:

.. code-block:: python

   >>> from qformatpy import qformat

   >>> x = 3.141592653589793
   >>> result = qformat(x, qi=4, qf=8, rnd_method='Trunc')
   >>> result
   array([3.140625])


Installation
------------

The qformatpy library is available via PIP install:

.. code-block:: python

   python3 -m venv pyenv
   source pyenv/bin/activate

   pip install qformatpy

Import the package as shown below:

.. code-block:: python

   import qformatpy


Example usage
-------------

.. code-block:: python

   >>> import numpy as np
   >>> import qformatpy

   >>> test_array = np.array([1.4, 5.57, 3.14])
   >>> qformatpy.rounding(test_array, 'TowardsZero')
   array([1, 5, 3])

   >>> qformatpy.rounding(test_array, 'HalfDown')
   array([1, 6, 3])

Links
-----

- Documentation: https://qformatpy.readthedocs.io/en/latest/

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "qformatpy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "DSP,Fixed-point,Signal-Processing,Qformat",
    "author": "",
    "author_email": "Eric Macedo <ericsmacedo@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d9/4e/8dd66fd0e87fe372f8ae838ac9bd888991420f816c70c5745c15b69f0a03/qformatpy-0.1.4.tar.gz",
    "platform": null,
    "description": "Welcome to QformatPy documentation!\n========================================================\n\nIntroduction\n------------\nWelcome to the qformat Python library, a powerful tool for formatting floating-point\nnumbers into fixed-point representation with Q notation. \n\nThis library supports ARM's Q format, where QI includes the sign bit. \n\nThe main function, qformat, allows users to specify the number of integer bits (QI),\nfractional bits (QF), whether the number is signed or unsigned, and provides flexibility \nin choosing rounding and overflow handling methods.\n\nWhether you're working on embedded systems, signal processing, or any application requiring fixed-point \nrepresentation, qformat is here to streamline the process.\n\nThe example below shows pi being converter to the sQ4.8 format, using Truncation as the\nrounding method:\n\n.. code-block:: python\n\n   >>> from qformatpy import qformat\n\n   >>> x = 3.141592653589793\n   >>> result = qformat(x, qi=4, qf=8, rnd_method='Trunc')\n   >>> result\n   array([3.140625])\n\n\nInstallation\n------------\n\nThe qformatpy library is available via PIP install:\n\n.. code-block:: python\n\n   python3 -m venv pyenv\n   source pyenv/bin/activate\n\n   pip install qformatpy\n\nImport the package as shown below:\n\n.. code-block:: python\n\n   import qformatpy\n\n\nExample usage\n-------------\n\n.. code-block:: python\n\n   >>> import numpy as np\n   >>> import qformatpy\n\n   >>> test_array = np.array([1.4, 5.57, 3.14])\n   >>> qformatpy.rounding(test_array, 'TowardsZero')\n   array([1, 5, 3])\n\n   >>> qformatpy.rounding(test_array, 'HalfDown')\n   array([1, 6, 3])\n\nLinks\n-----\n\n- Documentation: https://qformatpy.readthedocs.io/en/latest/\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python library for Q format representation and overflow handling.",
    "version": "0.1.4",
    "project_urls": {
        "Documentation": "https://qformatpy.readthedocs.io/en/latest/",
        "Source Code": "https://github.com/ericsmacedo/qformatpy"
    },
    "split_keywords": [
        "dsp",
        "fixed-point",
        "signal-processing",
        "qformat"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1758fa4b75bffb88e8065018a9b51df4edee05faf9f483bbae7171fc22bb4664",
                "md5": "c5c190f9164dbea697b3c0db3fe5f8aa",
                "sha256": "260b1370f54c4cb678ea717adc031995f800959297b0c1ed3d4fecf9771356f1"
            },
            "downloads": -1,
            "filename": "qformatpy-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c5c190f9164dbea697b3c0db3fe5f8aa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4850,
            "upload_time": "2024-01-23T19:41:56",
            "upload_time_iso_8601": "2024-01-23T19:41:56.090955Z",
            "url": "https://files.pythonhosted.org/packages/17/58/fa4b75bffb88e8065018a9b51df4edee05faf9f483bbae7171fc22bb4664/qformatpy-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d94e8dd66fd0e87fe372f8ae838ac9bd888991420f816c70c5745c15b69f0a03",
                "md5": "2a2bffb6e9c2560072ada1915efdfd96",
                "sha256": "e84643749a868aab61f57205a503acab1d8e3aa07f8979d7935b8184d14bf849"
            },
            "downloads": -1,
            "filename": "qformatpy-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "2a2bffb6e9c2560072ada1915efdfd96",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11444,
            "upload_time": "2024-01-23T19:41:57",
            "upload_time_iso_8601": "2024-01-23T19:41:57.247483Z",
            "url": "https://files.pythonhosted.org/packages/d9/4e/8dd66fd0e87fe372f8ae838ac9bd888991420f816c70c5745c15b69f0a03/qformatpy-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-23 19:41:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ericsmacedo",
    "github_project": "qformatpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "qformatpy"
}
        
Elapsed time: 0.25936s