DSP Python Tools

DSP Python Tools is a set of scripts written in Python to generate sinusoidal waveforms, the waveforms can be exported as CSV files or *.wav files.

Waveforms available are sine, square, sawtooth, noise and triangle, and the python methods can also be used to calculate the mean and a histogram.

The waveforms are generated using floating point and can be sampled and quantised, the sample can be set to the required number of bits per sample.

A set of example scripts are provided which output CSV files, which can be plotted easily using Gnuplot and *.wav files.

The code can be downloaded from BitBucket and used as follows:

git clone https://bitbucket.org/akeane_chx/dsp.git
cd dsp/examples/waveform
dsp/examples/waveform$ ./05_sawtooth.py > plot.out
dsp/examples/waveform$ gnuplot

    G N U P L O T
    Version 4.4 patchlevel 3
    last modified March 2011
    System: Linux 3.0.0-12-generic

    Copyright (C) 1986-1993, 1998, 2004, 2007-2010
    Thomas Williams, Colin Kelley and many others

    gnuplot home:     http://www.gnuplot.info
    faq, bugs, etc:   type "help seeking-assistance"
    immediate help:   type "help"
    plot window:      hit 'h'

Terminal type set to 'wxt'
gnuplot> plot 'plot.out' with lines

 

For the example above the Gnuplot output is presented:

 

dsp

Advertisements