G0WCZ / cwc

CW Commuter - a portable Morse appliance - local network and with reflectors
GNU General Public License v3.0
0 stars 3 forks source link

tone diversity with received carriers #33

Open grasuth opened 5 years ago

grasuth commented 5 years ago

When using PCM output, use the carrier key (16 bits) to determine an offset frequency for the reproduced tone. Human hearing can easily hear 5hz diff, so use 5hz offsets.

For example: -8 420Hz -1 495Hz sidetone freq: 500 0 505Hz +1 510Hz ... +8 545Hz

So algorithm like (python example): keys = [ 1, 101, 202, 456, 102, 103 , 104, 105 ]

for k in keys: ... print k, ((k & 0x000f)*7 ^ ((k & 0xf000) >> 12) ^ ((k & 0x0f00) >> 8) ^ ((k & 0x00f0) >> 4)) & 0x000f

produces: 1 7 101 5 202 10 456 5 102 12 103 7 104 14 105 9