gegel / pairphone

The effort for P2P private talk over GSM-FR compressed voice channel
GNU General Public License v3.0
39 stars 31 forks source link

I need some help to get rid of missunderteding of general implentation #2

Closed linuxenko closed 5 years ago

linuxenko commented 5 years ago

Hi Van ! :unicorn:

I've been trying to get started with modulation and further transfer data over voice sources. It seems like the pairphone was made for it, as far as I know it should work for a demonstration purpose. The pity thing for me - I don't have all the hardware required for the test run, so I thought it is a good idea to dive into the source code of the project to get how does it work and make kinda simulation of data modulation.

Here we go, it was obvious for me that "modem" has everything I want, and it really looks like, the Modulate and Demodulate functions speak for themselves. I made a simple program that take very simple frame (a single number repeated 3240 times) and "frame pointer" that points to very beginning of the array and invokes Modulate function then. Then it fills out the array with "magic" data I feed it into the Demodulate function.

The problem that It does not demodulate it to the original data (as I thought), then I tried to find out how does it work in the original program but there are no obvious data changes, I mean the packet changes after capturing it from a PCM, it seems like it simple encrypts it and inserts some "control bit" stuff, that should work on much higher level than modem does.

Can you please point me what data is really needed to get modem work ? It would be really nice if you could make an example for it, on a paper or a picture please :tractor:

Thanks

gegel commented 5 years ago

Hello! The first, by your name transcript, I can communicate by Russian (I'm from UA).

Modem is module for convert binary data frame (with a fixed bit length 81 bit) to a frame of 48KHzPCM audio samples (also with fixed size  3240) will be played over sound-card to communication line. Also modem add some small overhead for sync and simplest FEC.  So Modulate() accept byte array of data and output array of s16 PCM samples. After passing over media channel this samples can be distort. They received by PC audio capture hardware and presents as an stream.  Demodulate()  extract some number (216) of samples from stream and process it.  This procedure returns number to move pointer forward for next demodulation. This can be 216 or 215 or 217 samples depend small difference of playing/recording sample rates (for sync).  Note:  you must have at least 252 valid samples in buffer after pointer passed to Demodulate().  Also after each invoke of Demodulate we check flag of result is ready: data[11]|=0x80;  If flag set then output contain received data. Note: some period require for sync demodulator, so you will receive valid data only after 2-3 frames (after near 6480 processed samples, or after 30 times invoking Demodulate()). During sync you will receive data each 15th invoking of Demodulate(), check flag!

Now PairPhone is obsolete by my JackPair:  https://github.com/gegel/jackpair

You can find improved source code for Windows and for Cortex M4 embedded systems on my page: http://torfone.org/jackpair/index.html in menu of top of page.

BR, Van Gegel.

 

 

07 June 2019, 13:20:12, by "Svetlana Linuxenko" notifications@github.com:

Hi Van ! 🦄

I've been trying to get started with modulation and further transfer data over voice sources. It seems like the pairphone was made for it, as far as I know it should work for a demonstration purpose. The pity thing for me - I don't have all the hardware required for the test run, so I thought it is a good idea to dive into the source code of the project to get how does it work and make kinda simulation of data modulation.

Here we go, it was obvious for me that "modem" has everything I want, and it really looks like, the Modulate and Demodulate functions speak for themselves. I made a simple program that take very simple frame (a single number repeated 3240 times) and "frame pointer" that points to very beginning of the array and invokes Modulate function then. Then it fills out the array with "magic" data I feed it into the Demodulate function.

The problem that It does not demodulate it to the original data (as I thought), then I tried to find out how does it work in the original program but there are no obvious data changes, I mean the packet changes after capturing it from a PCM, it seems like it simple encrypts it and inserts some "control bit" stuff, that should work on much higher level than modem does.

Can you please point me what data is really needed to get modem work ? It would be really nice if you could make an example for it, on a paper or a picture please 🚜

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

linuxenko commented 5 years ago

I've tried to set two sound devices up. When I press F4 (make a call) it shows me:

Imgur

How do you think, Is it something going wrong with the "link of devices" I made ?

linuxenko commented 5 years ago

Ah, it was a problem with signal. Now I have connected it successfully. Thank you fro help !