Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Tech Refresh (Webpack, TypeScript, Jest, TsLint, Travis, Coveralls) #4

Merged
merged 57 commits into from
May 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
36b458c
Moving project to Webpack, TypeScript, Jest, TsLint, Travis, Coverall…
robertrypula Feb 8, 2018
973faed
Badge update
robertrypula Feb 8, 2018
84ab6e3
Trigger travis build
robertrypula Feb 8, 2018
034db7a
Adds my Dependency Injection library ;)
robertrypula Feb 8, 2018
98d4ac6
Moves all ES5 files to temporary directory
robertrypula Feb 9, 2018
eb1b51b
First tests with ES5 to TypeScript rewrite. Remove DI related code fr…
robertrypula Feb 9, 2018
918ff6e
Complex class refactor
robertrypula Feb 9, 2018
5aa0400
Complex class rename
robertrypula Feb 9, 2018
7717e49
Complex class updates
robertrypula Feb 9, 2018
8723603
fixes
robertrypula Feb 9, 2018
358b13b
Complex class refactor
robertrypula Feb 18, 2018
77a05a3
Complex class almost refactored and migrated to TypeScript
robertrypula Feb 18, 2018
9d4afa0
ComplexFactory class
robertrypula Feb 20, 2018
6e80d52
Adds Dependency Injection and modules configuration
robertrypula Apr 13, 2018
7229f6c
Moving FFT class to TypeScript - first phase
robertrypula Apr 13, 2018
c0b5be4
Moving FFT class to TypeScript - second phase
robertrypula Apr 13, 2018
d375c80
Moving FFT class to TypeScript - third phase
robertrypula Apr 13, 2018
849fb81
Adds staticImplements check, FFT class update
robertrypula Apr 15, 2018
9606777
MathUtil removed, buffer renamed to list and prepared to migrate to t…
robertrypula Apr 16, 2018
a63ea87
List migration to typescript - continuuation
robertrypula Apr 16, 2018
a29ac7b
List migration to typescript - continuuation
robertrypula Apr 16, 2018
4eb8c93
List migration to typescript - continuuation
robertrypula Apr 17, 2018
5f8404a
List migration to typescript - continuuation
robertrypula Apr 17, 2018
ec5bdd3
List migration to typescript - finished
robertrypula Apr 18, 2018
83bc93e
Fourier Transform integration with Complex and List class
robertrypula Apr 18, 2018
d4c85b6
Complex List Util class experiments
robertrypula Apr 18, 2018
bea5556
FFT class first test
robertrypula Apr 19, 2018
c937f0d
FFT finished
robertrypula Apr 21, 2018
3eed306
Cleanups
robertrypula Apr 24, 2018
2416cd8
Broken file history fix - 1/2
robertrypula Apr 25, 2018
53d9609
Broken file history fix - 2/2
robertrypula Apr 25, 2018
36ce11a
Adds interfaces, general cleanups
robertrypula Apr 25, 2018
92f1ffc
Updates in imports, experiments with the lib API from client's points…
robertrypula Apr 25, 2018
5cd9406
Imports cleanups
robertrypula Apr 25, 2018
47192b8
NPM versions upgrade
robertrypula Apr 27, 2018
bbff38e
Index unit tests, package-lock.json fix
robertrypula Apr 27, 2018
b8493ed
Coverage increase, move ES5 files into different dir
robertrypula Apr 30, 2018
8ceacf9
Hurray, 100% of code coverage!! :)
robertrypula May 1, 2018
6536f99
Remove default export from all classes
robertrypula May 1, 2018
b5f380d
New methods related to ComplexList
robertrypula May 1, 2018
86dde5e
Refactor - ComplexDependencyBag service for Complex class
robertrypula May 1, 2018
05b578b
isEqualTo at Complex class
robertrypula May 1, 2018
7e47909
ComplexListUtil isEqual
robertrypula May 1, 2018
49609cd
Alias for IList<IComplex> - IComplexList
robertrypula May 1, 2018
d961fac
Refactor - Moving ComplexListUtil into SignalFactory, part 1
robertrypula May 2, 2018
9104ca3
Refactor - Moving ComplexListUtil into SignalFactory, part 2
robertrypula May 2, 2018
e193aea
Refactor - Moving ComplexListUtil into SignalFactory, part 3
robertrypula May 2, 2018
b2f6422
Refactor - Moving ComplexListUtil into SignalFactory, part 4
robertrypula May 2, 2018
cec323d
Few cosmetic updates
robertrypula May 2, 2018
ea6fb41
MarkDown to html converter
robertrypula May 3, 2018
c6cfe0f
Script that converts Markdown into HTML
robertrypula May 9, 2018
ddab4fd
Merge branch 'master' into typescript-webpack-jest
robertrypula May 9, 2018
eaca080
Remove redundant html files
robertrypula May 9, 2018
4182f81
Configuration updates
robertrypula May 9, 2018
47a709b
Npm packages version update
robertrypula May 9, 2018
ae29fd3
Merge branch 'master' into typescript-webpack-jest
robertrypula May 10, 2018
641ecce
Changes in the readme and changelog. Adds list to article PDFs - fina…
robertrypula May 10, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
indent_size = 2

[*.md]
trim_trailing_whitespace = false
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.idea/
.vscode/
coverage/
dist/
node_modules/
an.wav
an100ms.wav
index.html
changelog.html
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: node_js
node_js: '8'
cache: yarn
script:
- npm run build
after_success:
- npm run report-coverage
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
- 1.1.0 Last update for old PSK code
- 1.2.x Completely rewritten Physical Layer with FSK support. Old PSK code marked as deprecated
- 1.3.x Data link layer with frames and checksums
- 1.4.x Transport layer that supports simplified TCP protocol
- 1.5.x Application layer with simple text exchange protocol
- 1.x.x move to webpack
- 2.0.0 Move to WebPack, TypeScript, Jest, Travis, Coveralls
- 2.0.0 Old PSK code removed from the project.
- 2.x.x Transport layer that supports simplified TCP protocol
- 2.x.x Application layer with simple text exchange protocol
- 2.x.x ?? OFDM
- 2.x.x ?? Move to TypeScript

## v1.3.1 (2018-05-10)
- BugFix: "The AudioContext was not allowed to start. It must be resume (or created) after a user gesture on the page. https://goo.gl/7K7WLu"
Expand Down
2 changes: 1 addition & 1 deletion INTERNET-SOURCES.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Freq domain time resolution:
http://electronics.stackexchange.com/questions/12407/what-is-the-relation-between-fft-length-and-frequency-resolution

IQ sampling explanation (complex signal):
http://whiteboard.ping.se/SDR/IQ GREAT GREAT GREAT !!!
http://whiteboard.ping.se/SDR/IQ GREAT GREAT GREAT !!!!
https://www.youtube.com/watch?v=h_7d-m1ehoY

Very nice project about DSP and Software Defined Radio
Expand Down
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
Audio Network
=============
# Audio Network

[![npm version](https://badge.fury.io/js/audio-network.svg)](https://badge.fury.io/js/audio-network)
[![Build Status](https://travis-ci.org/robertrypula/AudioNetwork.svg?branch=typescript-webpack-jest)](https://travis-ci.org/robertrypula/AudioNetwork)
[![Coverage Status](https://coveralls.io/repos/github/robertrypula/AudioNetwork/badge.svg?branch=typescript-webpack-jest)](https://coveralls.io/github/robertrypula/AudioNetwork?branch=typescript-webpack-jest)

Data transmission over sound waves written in JavaScript without any dependencies. All you need is just
microphone, speakers and the browser!

- [Physical Layer](https://audio-network.rypula.pl/physical-layer)
- [Data Link Layer](https://audio-network.rypula.pl/data-link-layer)
- [Transport Layer (comming soon, almost ready!)](https://audio-network.rypula.pl/transport-layer)
- [Transport Layer (comming soon)](https://audio-network.rypula.pl/transport-layer)
- [Audio Chat (comming soon)](https://audio-network.rypula.pl/audio-chat)
- [Full example List](/~https://github.com/robertrypula/AudioNetwork/tree/master/example)

## News

- [2018 May 10] Thanks to [Programista](https://programistamag.pl) magazine, all 3 parts of my articles about data transmission over sound in JavaScript are now available as PDFs.

- [2018 Feb 06] Project looks like dead but it's not. Now I'm focusing on configuration that allows me to move
entire AudioNetwork project to TypeScript, WebPack, Jest unit test with coverge, Travis etc.

## Self-made network stack based on Frequency-Shift Keying (>= v1.2.0)

Audio Network library is a hobby project in which the goal was to create simple network stack that uses sound
waves to transmit data. Initialy it was using PSK modulation technique which was later changed into FSK. If you are
interested in details you can read more in polish Programista magazine:

- [Data transmission over sound from scratch. Part 1: Discrete Fourier Transform](https://programistamag.pl/programista-08-2016-51/) (08/2016)
- [Data transmission over sound from scratch. Part 2: Web Audio API](https://programistamag.pl/programista-2-2017-57/) (02/2017)
- [Data transmission over sound from scratch. Part 3: Self-made network stack](https://programistamag.pl/programista-10-2017-65/) (10/2017)
- [Data transmission over sound from scratch. Part 1: Discrete Fourier Transform](https://programistamag.pl/programista-08-2016-51/) (08/2016) [**Download PDF**](https://cdn.rypula.pl/audio-network/pdf/TransmisjaDanychDzwiekiemJs_czesc1z3_DyskretnaTransformataFouriera.pdf)
- [Data transmission over sound from scratch. Part 2: Web Audio API](https://programistamag.pl/programista-2-2017-57/) (02/2017) [**Download PDF**](https://cdn.rypula.pl/audio-network/pdf/TransmisjaDanychDzwiekiemJs_czesc2z3_WebAudioAPI.pdf)
- [Data transmission over sound from scratch. Part 3: Self-made network stack](https://programistamag.pl/programista-10-2017-65/) (10/2017) [**Download PDF**](https://cdn.rypula.pl/audio-network/pdf/TransmisjaDanychDzwiekiemJs_czesc3z3_WlasnyStosSieciowy.pdf)

Part 3 of the article was the last one. It means that more focus will go to this website and Audio Network releases. If you can't wait please go trought some of the examples:

Expand All @@ -32,7 +42,7 @@ Part 3 of the article was the last one. It means that more focus will go to this
[(source)](https://audio-network.rypula.pl/physical-layer-src)
- [Data Link Layer simple (comming soon)](https://audio-network.rypula.pl/data-link-layer-simple)
[(source)](https://audio-network.rypula.pl/data-link-layer-simple-src)
- [Data Link Layer listenters demo](https://audio-network.rypula.pl/data-link-layer-listeners-demo)
- [Data Link Layer listeners demo](https://audio-network.rypula.pl/data-link-layer-listeners-demo)
[(source)](https://audio-network.rypula.pl/data-link-layer-listeners-demo-src)
- [Data Link Layer](https://audio-network.rypula.pl/data-link-layer)
[(source)](https://audio-network.rypula.pl/data-link-layer-src)
Expand All @@ -50,27 +60,23 @@ Note: some of the modules are not yet in main NPM package. Please verify [roadma

>This library is supported by [PGS Software](https://www.pgs-soft.com/) - the place where I work as Frontend Developer

UPDATE 2018.02.06 - Project looks like dead but it's not. Now I'm focusing on configuration that allows me to move
entire AudioNetwork project to TypeScript, WebPack, Jest unit test with coverge, Travis etc.

## Deprecated Phase-Shift Keying approach (last update at v1.1.0, will be removed at v2.0.0)

Initial versions of this lib were based on Phase-Shift Keying modulation technique. Unfortunatelly after some tests
in turned out that this implementation was not working reliable on mobile devices. Starting from v1.2.0 this part of the
lib will be marked as deprecated.

>**!!! IMPORTANT NOTE !!!** - Everything described **below (up to Licence)** might be outdated or not working properly. Project is now in a phase of big technical changes. Entire v1.x was created mostly to learn DSP and share this knowledge in the 'Programista' magazine articles. Version 2.x will have more stable and simpler API and will be better consumable as npm package.

- [Demo - simple](https://audio-network.rypula.pl/example/01-000-physical-layer-simple/physical-layer-simple.html)
- [Demo - full features](https://audio-network.rypula.pl/example/01-001-physical-layer-full/physical-layer-full.html)


If you want to try AudioNetwork by yourself I would recommend to first open `Demo - simple` because `Demo - full
features` might be little scary for the first time. You can also watch YouTube video that shows how to transmit
data over sound between two laptops:

[![Data transmission over sound waves (AudioNetwork)](https://audio-network.rypula.pl/asset/image/yt.png)](https://www.youtube.com/watch?v=TjjyLaXd1Ro)

>This project is still under development. Documentation is also planned but... little later :)

### How can I transmit something over sound?

First of all you need to have two devices. One for sending, one for receiving data. It should work with any
Expand Down
18 changes: 9 additions & 9 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
- [DONE] finish physical layer example
- finish data link layer simple example
- move all modules to main NPM package
- switch all examples to the one lib file instead of development mode that loads all scripts
- [DONE for all examples related to NPM package] switch all examples to the one lib file instead of development mode that loads all scripts
- finish transport layer example
- DataChunk listeners
- segment listeners
- example page itself
- finish Audio Chat example
- replace Gulp by WebPack
- configure unit tests from console
- finish Audio Chat example
- [DONE in PR] replace Gulp by WebPack
- [DONE in PR] configure unit tests from console
- [DONE] remove external google fonts
- improove website loading time in general
- [DONE] improove website loading time in general

## Physical Layer, Web Audio API and DSP stuff

Expand All @@ -30,18 +30,18 @@
- rename all variables like 'rxSymbol' / 'txSymbol' to 'rxFskSymbol' / 'txFskSymbol'
- implement common sample rate for all decives ~16 kHz
- SYNC setting 48/44.1 will no longer be needed in the Layers above Physical like Data Link Layer
- custom FFT implementation
- [DONE in PR] custom FFT implementation
- resampler
- FIR filter
- FIR filter

## Data Link Layer

- remove two way sync
- look for frames in two FSK streams
- SYNC will not be required
- SYNC will not be required

## Old todos (might be not valid anymore)

- DFT simple fix (code refactor)
- full example DFT fix
- add sampleRate input
Expand Down
4 changes: 4 additions & 0 deletions asset/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
height: 46px;
}

.download-area a.a-icon-github:hover, .download-area a.a-icon-npm:hover {
opacity: 0.5;
}

.download-area a.a-icon-fb {
width: 40px;
height: 40px;
Expand Down
Loading