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

Could we make the handshake process simpler? #3

Open
christianxiao opened this issue Aug 22, 2017 · 2 comments
Open

Could we make the handshake process simpler? #3

christianxiao opened this issue Aug 22, 2017 · 2 comments

Comments

@christianxiao
Copy link

Hi, this project is really awesome! And it may be the best DSP and sound wave library written in JS!
When I try to transmit data over sound just like what the doc says, I notice that the handshake process requires the receiver to listen to silence for a while. I guess we may make the handshake process simpler, just like the TCP or HTTP handshake:
Server side:

while(true){
1. Always listen for a special sync freq or sound wave, 
2. If it receives, do something, for example, sent the HTML file
}

Client side:

1. Send the special sync freq
2. Wait for the server data.

I notice that there is an audio chat example, will that help to implement handshake?
I'm really new to DSP and don't know whether this request is suitable. We will really appreciate that if you give us some suggestion.
Thank you.

@robertrypula
Copy link
Owner

robertrypula commented Aug 22, 2017

Hi,
I'm glad that you liked this project :) Your suggestion is very good and to be honest I already implemented similar solution. Receiver is listening for special sequence on two frequencies. It allows to pick some information about the signal strength and additionally perform synchronization. Synchronization is important because according to the Nyquist the sampling frequency needs to be at least twice of the signal frequency. It real world application it means that we could have valid and stable symbol in odd or even sampling windows. Synchronization and sequence detection is based on the correlation technique.

Everything what I wrote above is still not included in the npm package and even mentioned in the project website. In general existing PSK solution was not working fine with mobile devices and it was in general very slow. It will be deprecated soon and replaced with new approach that will work on any device. It will use FSK modulation. Later I plan to extend it into OFDM technique.

So far you can check those examples:
https://audio-network.rypula.pl/spectral-waterfall
https://audio-network.rypula.pl/fsk-synchronization-demo
https://audio-network.rypula.pl/physical-layer-simplest
https://audio-network.rypula.pl/physical-layer-simple
https://audio-network.rypula.pl/physical-layer-listeners-demo
https://audio-network.rypula.pl/physical-layer-ascii-demo

Currently it's not possible to use new solution as production ready npm package.

The reason that main npm package seems to be dead is because for the last few months I'm working on articles about data transmission in JavaScript for polish 'Programista' magazine. In fall 2017 the last, third part should be published. Then I'll have more time to focus on next Audio Network lib release and the page in general. In fact it's my hobby project so my time is very limited. In late 2017 I should publish English version of the whole series. It will cover many topics like simple and intuitive Discrete Fourier Transform algorithm, Web Audio API and simple network stack based on some kind of mixture of OSI and TCP/IP model.

Answering your last question - the 'Audio Chat' example is also related to third part of the article about data transmission. Now it's not yet implemented but it should be ready in about 3 weeks :)

Thanks,
Robert

@christianxiao
Copy link
Author

Thank you for your patient reply and they are really helpful~
I will check your examples above and dive deep into them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants