Git Product home page Git Product logo

twingo's Introduction

Twingo

Twingo is a simple nidaqmx / pyAudio based, 2 channel speaker measurement application supporting continuous and finite test signals generation, acquisition and analysis.

Twingo_demo

Installation

The easiest way to install will be to use Anaconda python distribution and by creating a conda environment.

  1. Clone the project from GitHub

  2. In Anaconda prompt navigate to the cloned project folder and setup conda environment from the YAML file:

    conda env create -f environment.yml

  3. At this point you should be able to launch the application in the environment created:

    conda activate twingo_conda_env

    python twingo.py

NOTE: You will not be able to install pyAudio easily using pip because it can't handle the C binaries (whatever they are) that have to go with it. This is why you do not find the familiar requirements.txt file in this repo.


If you wish to set up the project in pyCharm additionally follow below steps:

  1. Create new project
  2. Select project folder location but do not click "Create" yet
  3. Instead, expand "Project Interpreter" selection
    • Select "Existing Interpreter"
    • Choose the newly created conda env (twingo_conda_env) from the drop-down
  4. click "Create" You can see that you were successful by noting that in terminal the start of each line reads (twingo_conda_env) i.e. environment is activated.

Usage and capabilities

There are two types of hardware that twingo should support right out of the box.

  1. Your NIDAQmx USB based National instruments data acquisition card

    I could only test my private NI6211 M series DAQ so far but the code may well work (or require little adjustments) with any other NIDAQmx driver-based National Instruments card as long as its equipped with both analog input and output ports.

    hw_setup_NIDAQmx

  2. Your current system default sound device input and output

    This is later added feature and still requires much improvement but it expands the usability of the tool to any input and output sound hardware currently set default in your system. This way its possible to use for instance:

    • your sound card I/O,
    • external audio interfaces
      • Focusrite Scarlett series, e.g. 2i2 or 4i4,
      • Steinberg UR series,
      • NOTE: only first two I/O's will be functional and you may have to adjust pyaudio_read_offset_msec under model/config in order to synchronize the input and output.
    • external Digital/Analog converters,
    • bluetooth speakers.

    It should work likewise on Linux and Mac, let me know!

    hw_setup_NIDAQmx

    NOTE: Your system sound drivers often have various DSP effects enabled by default that can cause strange results (most frequent offender are equalizers, echo cancellation which attempts to remove your test signal from the output since it correlates well with the input or noise cancellation that attempt to dampen white noise test) Usually though, its possible to find the sound driver config application in your system and disable these effects.

Example analysis:

  1. High resolution harmonic distortion analysis (see demo at the top of this readme)

  2. Frequency response analysis with swept or white noise signal

    example_spectrum

  3. Spectrogram for speaker / room ringing

    example_spectrogram

  4. Phase scope to test phase matching between speaker or microphone pairs, or setup stereo image width for instrument recordings.

    example_phasescope

Note

This project is my first real OOP application after several years spent just on scientific scripting once in a while, therefore i expect that a lot of my code can be improved with your support and feedback. Thanks!

The ESS measurement method is still experimental and you should not trust the results too much.

Acknowledgements

twingo's People

Contributors

mjablons1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

timmcarson

twingo's Issues

Not thread safe?

When running FFT at high sampling rate the graph of one channel is having a little glitch (pointing to discontinuity in the waveform) which may be due to the reading and writing threads simultaneously acessing same output_frame variable. This seems to happen despite the use of Threading lock during write and read operations. Any help welcome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.