Skip to main content

Algorithm to emulate a lock-in amplifier

Project description

Universal Software Lock-In Amplifier (ULIA)

https://gitlab.com/UhlDaniel/ulia/-/jobs/artifacts/master/raw/license.svg?job=badges https://gitlab.com/UhlDaniel/ulia/-/jobs/artifacts/master/raw/pypi.svg?job=pypi https://img.shields.io/badge/DOI-10.1063%2F5.0059740-blue

An effective algorithm to emulate a Lock-In Amplifier.

Quickstart

Installation

To install ulia you can use pip.

ulia package can be installed directly from PyPI using pip (pip3).

$ pip install git+https://gitlab.com/UhlDaniel/ulia.git

or

$ pip install ulia

Dependencies

This package depends on:

  • Numpy

  • Scipy

  • Numba

Usage

A simple example on how to utilize the ULIA.

>>> import numpy as np
>>> import ulia


>>> modulation_frequency = 5000.0
>>> sampling_rate = 200000.0

>>> t = np.arange(0, 0.3*sampling_rate) / sampling_rate
>>> signal = np.cos(2*np.pi*t*modulation_frequency)
>>> reference = np.cos(2*np.pi*t*modulation_frequency)

>>> lia = ulia.ULIA(signal.size, sampling_rate, 0.03, 2, 0.2)
>>> lia.load_data(reference, signal)
>>> lia.execute()


Ignore the first 30% and last 10% of data due to filter artefacts.
>>> x = np.mean(lia.x[int(0.3*lia.x.size):int(0.9*lia.x.size)])
>>> y = np.mean(lia.y[int(0.3*lia.y.size):int(0.9*lia.y.size)])

>>> print(x + 1j * y)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ulia-2023.2.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file ulia-2023.2.1-py3-none-any.whl.

File metadata

  • Download URL: ulia-2023.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for ulia-2023.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4767bfe6f7ce5dfff96334b15532c391d55954db978a4b34f4f879ab29c2b905
MD5 23b5aa1e4023f8e9881bb382687131cf
BLAKE2b-256 294d3069e494e94d105cf8a454c8c78b106710e643b6c26f58df905c3821443f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page