GithubHelp home page GithubHelp logo

zimolzak / wav-in-python Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 96 KB

Learning and messing with audio import/processing in Python

License: MIT License

Python 98.25% Makefile 1.75%
stanag frequency-shift-keying rtty

wav-in-python's Introduction

Python Frequency Shift Keying Analysis

Decodes a WAV file of frequency shift keying (FSK) noises to its bitstream.

Bare-bones but cross-platform alternative to Sorcerer decoding software. fldigi software does FSK but not enough raw bitstream inspection for me.

Can be used for STANAG-4481 "NATO" radio signals. Specifically, STANAG-4481F. The ones I received are at 50 baud, with a frequency shift keying (FSK) or "RTTY" shift of 850Hz. Detection of the mark and space tones (and the shift) is automatic. Allows reshaping bitstream into various size rectangles, to allow inspection for various serial asynchronous framings (like 5N1 or 8N1). Should work on any binary (2-tone) FSK signal (not MFSK), but you may have to change passband filter parameters if your mark/space tones don't match STANAG-4481. Baud must always be set manually.

Command line

python main.py sample-data.wav
# You will see stdout and a png will be created

python main.py signal.wav  # 10 second file
# png overwritten

Within Python

from wave_helpers import whole_pipeline

bitstream = whole_pipeline(infile='sample-data.wav', outfile=None)

# Now do something cool with bitstream. 

Outline of approach

  1. Read samples from the WAV file (22,050 values / sec).
  2. Apply a short-time Fourier transform to find the most intense tone at any time point (300 values / sec).
  3. Reduce the vector of tones to a vector of bits (50 values / sec).

Requirements

  • wave (Python Standard Library)
  • SciPy
  • Matplotlib
  • NumPy

wav-in-python's People

Contributors

zimolzak avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.