Git Product home page Git Product logo

spice-audio-tools's Introduction

SPICE audio tools

This repository has two programs for importing wav file to SPICE and
exporting the output as a wav file.

1. wavtospice.py
- This tool converts a wav file with a list of values, which can be read
  using ngspices file source. If wav file has multiple channels only the values
  of the first channel are returned.

- Usage: python wavtospice.py <input file> <output file>

- Ngspice must have been compiled with xspice support. File source can be used
  like follows:

    a1 %v([in]) filesrc
    .model filesrc filesource (file="values" amploffset=[0] amplscale=[1]
    +                          timeoffset=0 timescale=1
    +                          timerelative=false amplstep=false)

 See ngspice manual for possible options.

2. spicetowav.py
- This tool converts ngspice output to wav file. Compatibility with other
  simulators is untested.

- Use "wrdata" command in the spice netlist to save data to file.
  Run the ngspice in batch mode using the command line flag -b.

- Usage: python spicetowav.py <SPICE output file> <Output wav> [clipping voltage].
  Clipping voltage is optional and if it's unspecified wav is written
  with maximum amplitude such that clipping doesn't occur.

# Installing

To install the package and have "wavtospice" and "spicetowav" binaries on your path the package can be installed with:

    $ pip install .

# Example

Following commands can be used to get output from lowpass filter example file
when run on Linux:

    $ wavtospice file.wav inputvalues
    $ ngspice -b examples/lowpass.cir
    $ spicetowav output.data output.wav


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.