Giter VIP home page Giter VIP logo

cwt-tensorflow's Introduction

if you are interested in becoming a collaborator let me know by creating an issue or gmail me nickgeoca

Tensorflow CWT

This implements a 1-D Continuous Wavelet Transform (CWT) in tensorflow. The benefit is that it runs parallel on GPUs.

The following wavelets are available:

  • Ricker wavelet - cwtRicker
  • Mortlet wavelet - cwtMortlet

Benchmarks

Regarding CWT performance of Tensorflow vs Pywavelet, Pywavelet is about 13 times faster. However, this is a CPU only benchmark without using performance extensions, like AVX, on Tensorflow.

Col1 Col2 Result Notes
Tensorflow CWT (GPU) Tensorflow CWT (CPU) GPU ~8x faster old i5 vs GTX 750 TI ~1,400 GFLOPS
Tensorflow CWT (CPU) Pywavelet CWT (CPU) Pywavelet CWT ~13x faster Tensorflow w/o AVX extensions, etc
Tensorflow CWT (CPU) Pywavelet DWT (CPU) Pywavelet DWT ~200,000x faster Haar wavelet; Tensorflow w/o AVX extensions, etc

Benchmark times

This can be aquired by running python benchmark.py

  • DWT - sampleSize = 10000000
    • pywavelet dwt haar: 0.06824707984924316
    • pywavelet dwt db2: 0.08141493797302246
    • pywavelet dwt db8: 0.14669179916381836
  • CWT - sampleSize = 10000; cwtWidth = 256
    • pywavelet cwt mortlet: 1.1284675598144531
    • tensorflow cwt mortlet: 14.783239364624023

Examples

  • wavExample.py. The audio sample rate is scaled down to 8000 samples per second (instead of typical 44100).

  • sinExample.py. It produces the plot below. The wavelet used is shown below (scale=32).

Notes

  • The wavelet can be undersampled if the scale is too small. An example of this is seen below- the scale was set to 1.

Dev Notes

  • This cwt and scipy's cwt both limit the Ricker wavelet samples to 10x the scale size to improve accuracy.

TODO

  • Add this line of code similar to scipy's cwt: samples = min(10*width, len(wav))
  • consier scipy's ability to specify the wavelet scale
# Scipy's cwt can specify the wavelet scales in detail. This api can't do that.
cwt(wav, signal.ricker, [1,1.5,2,2.5,3])
# This api is equivilent to calling scipy's cwt as below.
cwt(wav, signal.ricker, range(1,n))
  • Maybe add 2d verison

cwt-tensorflow's People

Contributors

nickgeoca avatar xen0n avatar

Watchers

James Cloos avatar

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.