Analog mode operation

master
Robert Östling 2025-01-22 22:28:47 +01:00
rodzic d5bfe57510
commit 3ba5512530
3 zmienionych plików z 70 dodań i 0 usunięć

Wyświetl plik

@ -34,3 +34,17 @@ cycle.
You could of course also take either of the sine wave outputs (ZOUT1, ZOUT2)
and amplify or feed directly into a low-pass filter to the antenna.
## make_table.py and make_sound.py
Code to support completely analog operation. Run `make_table.py` and write
down the printed table on a piece of paper, making sure to include the
horizontal lines after every 9th symbol. I simply fill the indicated
squares with a pencil, and the whole message takes three columns on a piece of
A4 graph paper.
Then run `make_sound.py`, which creates the file `ticks.wav`. This file can be
played (by an analog tape player, perhaps?) starting at an even minute. You
should have no problem following the beat when keying the message, but if you
lose track at some point, the higher tone at the symbol *before* each 9-symbol
block boundary can be used for synchronization.

31
make_sound.py 100644
Wyświetl plik

@ -0,0 +1,31 @@
import numpy as np
import math
import scipy
symbol_time = 8192/12000
sr = 22050
tick_hz = 450
tack_hz = 700
start_pad = 1.0
end_pad = 1.0
total_time = 162*symbol_time + start_pad + end_pad
n_samples = int(total_time*sr)
samples = np.zeros(n_samples, dtype=np.uint8)
def add_sound_at(start_time, frequency, length=0.1):
start_sample = int(start_time*sr)
for i in range(int(length*sr)):
samples[start_sample+i] = 128 + int(64*math.sin(2*math.pi*i*frequency/sr))
def main():
for i in range(162):
frequency = tack_hz if (i+1) % 9 == 0 else tick_hz
add_sound_at(start_pad + i*symbol_time, frequency)
add_sound_at(0.0, 1000.0, length=start_pad)
#print(list(samples))
scipy.io.wavfile.write("ticks.wav", sr, samples)
main()

25
make_table.py 100644
Wyświetl plik

@ -0,0 +1,25 @@
"""Display for manual WSPR transmission."""
from encode import wspr_encode
import datetime
import time
def display(symbols):
for i, symbol in enumerate(symbols):
if i % 9 == 0:
print(f'-- {i:3d} ' + '-'*72)
left = ' ' if symbol & 1 else '#'
right = ' ' if symbol & 2 else '#'
print(f'[{left}] [{right}]')
if __name__ == '__main__':
import sys
if len(sys.argv) != 4:
print('Usage: %s callsign locator dbm' % sys.argv[0])
sys.exit(1)
callsign = sys.argv[1]
locator = sys.argv[2]
dbm = int(sys.argv[3])
symbols = wspr_encode(callsign, locator, dbm)
display(symbols)