HAM RADIO Python projects: SQUARE WAVE to SINE WAVE converter for a Morse Code Practice Oscillator

using a modified PYTHON SCRIPT from: https://brettviren.github.io/pygst-tutorial-org/pygst-tutorial.htm

GSTREAMER python code used in this PYTHON SCRIPT example:

# Set up the gstreamer pipeline self.player = Gst.parse_launch (" interleave name=i ! audioconvert ! queue ! ladspa-zamgate-ladspa-so-zamgate attack=5 release=5 threshold=-31 sidechain=true ! audioconvert ! audio/x-raw, rate=48000, layout=interleaved, format=F32LE, channels=1 ! audiomixer ! audiowsincband mode=band-pass lower-frequency=600 upper-frequency=800 length=424 window=3 low-latency=true ! audioconvert ! queue ! jackaudiosink buffer-time=3000 sync=false async=false audiotestsrc volume=0.6 freq=740 ! audioconvert ! multiqueue use-interleave=true ! i. jackaudiosrc ! audio/x-raw, channels=1 ! audioconvert ! multiqueue use-interleave=true ! i. ")

this Gstreamer CODE performs many functions...

1. it creates a SINE WAVE at 740hz that connects to the upper port of the ladspa ZAMGATE SIDECHAIN PLUGin(ladspa-zamgate-ladspa-so-zamgate)

2. it creates an input port for receiving a CPO's//CW keyer's harsh square wave audio output, that it will use to trigger the SINE WAVE at 740hz to pass through the ZAMGATE upper port in exact timing precision with the original SQUARE WAVE cw note

3. it will set the RISE/fall time and weight by zamgate's controls (attack=5 release=5 threshold=-31 sidechain=true)

4. it will filter the ZAMGATE pure sine wave trapezoidal wave shape output into a raised cosine edged output(audiowsincband mode=band-pass lower-frequency=600 upper-frequency=800 length=424 window=3 low-latency=true)

Views: 62

Comment by Chuck aa0hw on October 7, 2022 at 2:21pm

HAM RADIO Python projects: iCW Mumble Morse Code Audio output AGC, CW RE-GENERATOR & BandPass filter

using a modified PYTHON SCRIPT from: https://brettviren.github.io/pygst-tutorial-org/pygst-tutorial.htm GSTREAMER python code used in this PYTHON SCRIPT example:

# Set up the gstreamer pipeline

self.player = Gst.parse_launch (" interleave name=i ! audioconvert ! queue ! ladspa-zamgate-ladspa-so-zamgate attack=5 release=5 threshold=-40 sidechain=true ! audioconvert ! audio/x-raw, rate=48000, layout=interleaved, format=F32LE, channels=1 ! audiomixer ! audiowsincband mode=band-pass lower-frequency=600 upper-frequency=800 length=384 window=3 low-latency=true ! audioconvert ! queue ! jackaudiosink buffer-time=3000 sync=false async=false audiotestsrc volume=0.63 freq=740 ! audioconvert ! multiqueue use-interleave=true ! i. alsasrc device=hw:0,0 ! audioresample ! audioconvert ! audio/x-raw, channels=1 ! ladspa-la-loudmax64-so-ldmx-mono threshold=-30 output=-30 ! audioconvert ! multiqueue use-interleave=true ! i. ")

this Gstreamer CODE performs many functions...

1. it creates a SINE WAVE at 740hz that connects to the upper port of the ladspa ZAMGATE SIDECHAIN PLUGin(ladspa-zamgate-ladspa-so-zamgate)

2. it creates an input port for receiving a CPO's//CW keyer's harsh square wave audio output, that it will use to trigger the SINE WAVE at 740hz to pass through the ZAMGATE upper port in exact timing precision with the original SQUARE WAVE cw note

3. it will set the RISE/fall time and weight by zamgate's controls (attack=5 release=5 threshold=-31 sidechain=true) 4. it will filter the ZAMGATE pure sine wave trapezoidal wave shape output into a raised cosine edged output(audiowsincband mode=band-pass lower-frequency=600 upper-frequency=800 length=424 window=3 low-latency=true)

5. it applies AGC to the incoming mumble output audio, up to 30 db range of operation to keep the volume the same, preparing it for the RE-GENERATOR pathways

Comment by Chuck aa0hw on October 8, 2022 at 9:51am

HAM RADIO Python projects: 2-way, FULL DUPLEX, FULL QSK, CW QSO over iP *using the OPUS audio CODEC

using a modified PYTHON SCRIPT from: https://brettviren.github.io/pygst-tutorial-org/pygst-tutorial.htm

GSTREAMER python code used in this PYTHON SCRIPT example:

# Set up the gstreamer pipeline self.player = Gst.parse_launch (" jackaudiosrc ! audio/x-raw, channels=1 ! audioconvert ! opusenc bitrate=256000 ! rtpopuspay ! udpsink host=(ip address of other OP) port=7557 interleave name=i ! audioconvert ! queue ! ladspa-zamgate-ladspa-so-zamgate attack=5 release=5 threshold=-5.0 sidechain=true ! audioconvert ! audio/x-raw, rate=48000, layout=interleaved, format=F32LE, channels=1 ! audiomixer ! audiowsincband mode=band-pass lower-frequency=529 upper-frequency=749 length=384 window=3 low-latency=true ! audioconvert ! audio/x-raw, rate=48000, layout=interleaved, format=F32LE, channels=1 ! queue ! jackaudiosink buffer-time=35000 sync=false async=false audiotestsrc volume=0.63 freq=639 ! audioconvert ! multiqueue use-interleave=true ! i. udpsrc port=5775 ! application/x-rtp, media=audio, clock-rate=48000, encoding-name=OPUS, sprop-maxcapturerate=48000, sprop-stereo=0, payload=96 ! rtpjitterbuffer latency=35 ! rtpopusdepay ! opusdec ! queue ! audioconvert ! audio/x-raw, channels=1 ! ladspa-vlevel-ladspa-so-vlevel-mono look-ahead=.05 limit-multiplier=true multiplier-limit=20 strength=1 ! audioconvert ! multiqueue use-interleave=true ! i. ")

The Gstreamer section of this PYTHON APP, provides multiple functions...

1. send CW to the other OP over ip using OPUS CODEC rtp encoder

2. RX cw from the other OP over ip using OPUS CODEC rtp decoder

3. apply AGC to the RX signal (via ladspa vlevel plugin)

4. RE-generate the RX signal, and make a new CW NOTE at the pitch and weight and rise/fall time that you want to copy CW at and no matter what the OP is sending as far as their CW PITCH, or CW VOLUME or CW RISE/FALL time etc... the newly created regenerated CW note will remain the same via the AGC and RE-KEYER apps, zamgate, vlevel, sine wave generator and final cw audio bandpass filter

Comment by Chuck aa0hw on October 9, 2022 at 7:26pm

HAM RADIO Python projects: virtual audio cables for Mumble on iCW - in/out gets AGC'd & Regenerated

using a modified PYTHON SCRIPT from: https://brettviren.github.io/pygst-tutorial-org/pygst-tutorial.htm

SETUP:

use 2 alsa virtual audio cables(snd-aloop) one for mumble input, & another for mumble output WHY? to apply several ladspa apps and two native gstreamer scripts for a sine wave generator & cw audio bandpass filte; to REGEN the cw before it gets to the mumble input VAC, and the speaker/headphones(for monitoring your keyed sidetone in real time) AND to do the same for the mumble output VAC... AGC/Limit it, regenerate it, and then bandpass filter it, before it gets to the op's own sound card's speaker/headphone

GSTREAMER python code used in this PYTHON SCRIPT example:

# Set up the gstreamer pipeline

self.player = Gst.parse_launch (" interleave name=i ! tee name=t t. ! queue ! audioconvert ! ladspa-zamgate-ladspa-so-zamgate attack=5 release=5 threshold=-5.5 sidechain=true ! audioconvert ! queue ! audiomixer ! audiowsincband mode=band-pass lower-frequency=529 upper-frequency=749 length=384 window=3 low-latency=true ! audioconvert ! audio/x-raw, rate=48000 ! queue ! audiomixer name=mix ! queue ! audioconvert ! ladspa-vlevel-ladspa-so-vlevel-mono look-ahead=.05 limit-multiplier=true multiplier-limit=3 strength=.7 ! audioconvert ! alsasink device=hw:7 buffer-time=35000 sync=false async=false t. ! queue ! audioconvert ! queue ! ladspa-zamgate-ladspa-so-zamgate attack=5 release=5 threshold=-5.5 sidechain=true ! audioconvert ! queue ! audiomixer ! audiowsincband mode=band-pass lower-frequency=529 upper-frequency=749 length=384 window=3 low-latency=true ! audioconvert ! audio/x-raw, rate=48000 ! queue ! alsasink device=plughw:0,1 buffer-time=70000 sync=false async=false audiotestsrc name=1 volume=0.63 freq=639 ! audioconvert ! multiqueue use-interleave=true ! i. alsasrc device=hw:7 ! queue ! audio/x-raw, rate=48000 ! audioconvert ! ladspa-vlevel-ladspa-so-vlevel-mono look-ahead=.05 limit-multiplier=true multiplier-limit=20 strength=1 ! audioconvert ! multiqueue use-interleave=true ! i. interleave name=j ! queue ! audioconvert ! ladspa-zamgate-ladspa-so-zamgate attack=5 release=5 threshold=-5.5 sidechain=true ! audioconvert ! queue ! audiomixer ! audiowsincband mode=band-pass lower-frequency=631 upper-frequency=851 length=384 window=3 low-latency=true ! audioconvert ! audio/x-raw, rate=(int)48000, layout=(string)interleaved, format=(string)S32LE, channels=(int)2, channel-mask=(bitmask)0x0000000000000003 ! queue ! mix. audiotestsrc name=2 volume=0.63 freq=741 ! audioconvert ! multiqueue use-interleave=true ! j. alsasrc device=hw:1,0 ! audioconvert ! audio/x-raw, layout=(string)interleaved, rate=(int)48000, format=(string)F32LE, channels=(int)1 ! ladspa-vlevel-ladspa-so-vlevel-mono look-ahead=.05 limit-multiplier=true multiplier-limit=20 strength=1 ! queue ! multiqueue use-interleave=true ! j. ")

NOTE: this is just a first test run with the Gstreamer CODE above

basic steps to the process...

interleave allows 2 consecutive streams to be sent to the ZAMGATE SIDECHAIN GATE.... 1st one is a sine wave generator - "audiotestsrc" the 2nd is either the OP's own sidetone OR the output of mumble ...which keys the 2nd port of ZAMGATE and allows the sine wave to go through to the bandpass filter

Comment

You need to be a member of QRQcw to add comments!

Join QRQcw

© 2024   Created by Chuck aa0hw.   Powered by

Badges  |  Report an Issue  |  Terms of Service