Skip to content

SW_DevED1000

Rolf Obrecht edited this page Jun 21, 2023 · 10 revisions

Device Module "DevED1000"

TODO...

Module Information

System

System Comments
RPi ok
PC Linux ok
PC Windows BETA working
Mac unknown

Dependencies

Python
Module
Install Anaconda
pyaudio pip install pyaudio conda install pyaudio
numpy pip install numpy -included-
scipy pip install scipy -included-

Command Line Arguments

-E
--ED1000

Config File Parameter

Param Default Range / Type Description
recv_squelch 100 positive integer Defines the power threshold below which the filter output for A/Z level is ignored; if needed, can be determined experimentally using helper script ED1000/squelch_check.py (see docstring inside).
recv_debug false false / true If true, output recv_debug.log file inside which the repective filter power output levels for every sample are recorded. Use only for debugging (file will grow quickly).
send_WB_pulse false false / true If true, send pulse to signal ready-to-dial condition like with the current interface.
unres_threshold 100 positive integer Duration in ms that piTelex waits for the teleprinter, after it started sending Z level, until the teleprinter returns the Z level to signal readiness state. Raise if the teleprinter needs more time to start up for special setups, e.g. when switching mains using ESC-TP0/TP1 commands.
recv_f0 2250 number RX frequency 0 in Hz (A level)
recv_f1 3150 number RX frequency 1 in Hz (Z level)
devindex null null or positive integer (0 included) pyaudio‘s device index for the intended audio device; use ED1000/audiotest.py to list currently available devices (0=auto, 1=1st device, 2=2nd ...).
baudrate 50 50, 75, 100 Baud rate
send_f0 500 number TX frequency 0 in Hz (A level)
send_f1 700 number TX frequency 1 in Hz (Z level)
zcarrier false false / true If true, piTelex will send continous A level in idle state. Most teleprinters don‘t need this.

Example config file section

       # Module type "ED1000"
        # requirements: numpy scipy
    
        # ED1000 teletype over USB-sound-card
        "ED1000": {
          "type": "ED1000",
          "enable": false,
          "devindex": null,            # null=auto, 1=1st audio device, 2=2nd... (use alsamixer to check devices)
          "zcarrier": false,           # true=send frequency in idle mode
          "baudrate": 50,
          "send_f0": 500,
          "send_f1": 700,
          "recv_f0": 2250,
          "recv_f1": 3150,
          "recv_squelch": 100,
          "recv_debug": false,
          "unres_threshold": 100
        },

Description

This module is needed to connect to more modern teletypes which use the ED1000 protocol. It makes use of a sound card (either built in PC soundcard or some cheap usb cards available for about 10$ to set up the freqency driven connection to the ED100 printer.

It is essential to identify the correct device index of your sound card. To find it out, there is a small helper script in the ED1000 subdirectory of piTelex. The output of

    sudo python3 ~/piTelex/ED1000/audiotest.py

should yield the ID of the soundcard. In the configuration file, enable the module ED1000 and set devindex to the ID of your sound card.

Furthermore, it is essential that the volume of the sound card is set to an appropriate level (can be done under linux via alsamixer) as well as sufficient input sensitivity of the recording channel (also check wether the correct channel has been selected).

For fine tuning, there is another helper script recv_squelch which allows for alignment of noise suppression.

Implementation

For sending a character the transmitter switches between the corresponding frequency with the giver baud rate.

In development:

TODO

Using IIR-Filter

  • Slice samples in 5ms pieces

  • Filter each slice for 2250HZ and 3150Hz:

    filter_bp = signal.iirfilter(4, [f/1.05, f*1.05], rs=40, btype='band',
                 analog=False, ftype='butter', fs=sample_f, output='sos')
    
  • Get average of abs() per slice per frequency

  • Compare values of both frequencies to get bit value (0/1)

Using FFT...

See also Frequency Shift Keying (FSK)

...

Clone this wiki locally