lavajuno / afskmodem

A python library for transmitting and receiving digital data with audio frequency-shift keying
https://lavajuno.github.io/afskmodem
MIT License
10 stars 3 forks source link

add preamble sync tone for VOX #11

Open sisari opened 2 months ago

sisari commented 2 months ago

Hello,

Can you add for the TX function a preamble tone (duration in miliseconds user modifiable) 500 - 2000ms for opening VOX on radio transmit ?

lavajuno commented 2 months ago

The optional training_time (float) argument for Transmitter's constructor allows the user to specify how long the training sequence (alternating tones) is transmitted before a message. The default is 0.5s, you can override it to be longer to open up VOX.

It would be possible to transmit a tone, but there's no downside to just transmitting a longer training sequence. (It also gives the receiver more data to work with when picking up the signal)

Here's how you would create a Transmitter with a training time of 2000ms:

from afskmodem import Transmitter

tx = Transmitter(1200, training_time=2)
tx.transmit("Hello")