QRQ CW harsh square wave notes from 555 CONVERTED to a pure sine wave notes with raised cosine edges

This Gstreamer Script has the internal BandPass Filter used by the PI to take the QRQ CW SQUARE WAVE notes(@84wpm) from a 555 timer chip CPO's audio output, that is being keyed by a CW KEYBOARD, with the 555 output going to the PI's usb mic jack input...this Gstreamer Script filters out all of the harmonics AND puts a raised cosine edge on it too... you can VARY the bandwidth of the filter by varying the LENGTH VALUE in the script as well as the LOW and HIGH limits of the Gstreamer audio bandpass filter script numbers and you have 5 'windows' to choose from for the 'RAISED COSINE' edges that this Gstreamer seems to create on its own... HANN, HAMMING, GAUSSIAN, BLACKMAN, COSINE (window=0,1,2,3,4) ("window=3", used in this demo = cosine)

here is the Gstreamer script used by the PI: pi@raspberrypi:~ $ gst-launch-1.0 -v pulsesrc ! "audio/x-raw, channels=1, rate=48000" ! tee name=t ! audioconvert ! audiowsincband mode=band-pass lower-frequency=615 upper-frequency=855 length=480 window=3 low-latency=true ! audioconvert ! queue ! pulsesink sync=false t. ! audioconvert ! audiowsincband mode=band-pass lower-frequency=615 upper-frequency=855 length=480 window=3 low-latency=true ! audioconvert ! opusenc ! rtpopuspay ! queue ! udpsink host=(ip address of the other OP) port=7777 NOTE the "tee" in this script allows the mic jack to send audio to the headphone jack for monitoring the sidetone in REAL TIME/low latency AND also to send the same filtered QRQ CW to another OP over ip... (udp sink)...the actual final audio that you hear on this video demo.... PULSE AUDIO VOLUME CONTROL on the PI enables you to select which sound card you want for the Gstreamer INPUT and OUTPUT... in this case, a USB MIC for the PI input and the PI's own HEADPHONE jack audio output jack for monitoring the filtered SIDETONE

NOTE: the pass-through latency of this Gstreamer bandpass filter, using the Gstreamer "LOW-LATENCY" setting on the Gstreamer FILTER ELEMENT... measured to be about 5 to 7 milliseconds...

Views: 75

Comment by Chuck aa0hw on June 18, 2022 at 12:45pm

Here is another example of a similar setup,  FLdigi is keying an optoisolator via its KEY THE RTS SERIAL PIN feature... the RTS SERIAL PIN keys the opto-isolator's DIODE SIDE, which allows a 555 square wave to pass through the H11F1's output terminals...then the same Gstreamer script cleans up the square wave and puts a nice raised cosine edge on the rise & fall time of the CW NOTE

 

this video shows FLdigi keying a USB SERIAL PORT PIN -- RTS pin

the RTS PIN activates an H11F1 FET OPTOisolator chip

a 555 square wave oscillator is connected to the H11F1's output terminals

when FLdigi keys the RTS/H11F1 DIODE SIDE it allows the 555's square wave to pass through the FET's output terminals

NOTE: the H11F1's output terminals allow some of the 555's SQUARE WAVE to 'get through'

about -60db measured

so to prevent leak through

a simple GATE is setup to block anything lower than -33db(ZAMGATE)

NOTE: because the square wave of the 555 is so harsh and unpleasant, a single GSTREAMER SCRIPT is used to filter out all of the harmonics and only preserve the primary tone(@798 hertz)

AND

it also places a RAISED COSINE EDGE onto the RISE and FALL time of the CW

NOTE the script pass-through time only takes less than 10 milliseconds

here is the script used in this video example:

CW PITCH = @798 HERTZ

gst-launch-1.0 jackaudiosrc ! audio/x-raw, channels=1 ! audioconvert ! audiowsincband mode=band-pass lower-frequency=678 upper-frequency=918 length=480 window=3 low-latency=true ! audioconvert ! jackaudiosink sync=false async=false buffer-time=5000

NOTE: the 'window' setting = 3, is the COSINE WINDOW... also, the filter's low/high freq setting will determine the filter's bandwidth

the filter 'length' setting, will also determine the bandwidth

ZAMGATE   https://www.zamaudio.com/

GSTREAMER    https://gstreamer.freedesktop.org/download/

Comment by Chuck aa0hw on June 22, 2022 at 9:54am

HOOK up an MJF451 CW keyboard to a PI 4 + iambic paddles & straight key all working at the same time

each CW KEYER, is 'keying' a FET H11F1 OPTO-ISOLATOR CHIP's diode side... on the H11F1's N-CHANNEL output side, is a continuous running 555 square wave oscillator, that is hooked up to the PI's usb sound card's LINE INPUT The 555 SQUARE WAVE is harsh with zero rise/fall time when keyed by the H11F1.... to remove all harmonics AND form a RAISED COSINE EDGE on the RISE/FALL TIME a single Gstreamer script is used , in low latency(@10ms) to convert the 555 SQUARE WAVE into a pure sine wave NOTE with raised cosine edges... this is the script that was used in this video demo:

************

pi@raspberrypi:~ $ gst-launch-1.0 -v jackaudiosrc do-timestamp=true ! "audio/x-raw, rate=48000" ! queue ! audioconvert ! ladspa-zamgate-ladspa-so-zamgate attack=.1 release=.1 threshold=-22 ! audiorate ! audioconvert ! audiowsincband mode=band-pass lower-frequency=698 upper-frequency=898 length=567 window=3 low-latency=true ! queue ! jackaudiosink buffer-time=10000

***********

the script has a GATE function, to stop the 555 OSC from bleeding through AND a bandpass filter

Comment by Chuck aa0hw on June 27, 2022 at 8:38am

Here is another example of using a SQUARE WAVE to SINE WAVE with Raised Cosine Edges Converter Script on a Raspberry pi 4 CW Keying setup:  

test to see how low the latency can be pushed through a RASPY HARSH SQUARE WAVE to PURE SINE WAVE with RAISED COSINE EDGES Gstreamer Script for the RAPSBERRY PI 4 PI is stopping some services to help minimize JACK AUDIO CONNECTION KIT X-RUNS using some guidelines from here: https://raspberrypi.stackexchange.com/questions/104499/which-servic... GSTREAMER SCRIPT USED for the SQUARE to SINE converter: NOTE: this script also has a GATE, to stop the LEAK THROUGH of the continuous operation of the 555 osc...from getting through to the pi heapdhones...(zamgate) pi@raspberrypi:~ $ gst-launch-1.0 -v jackaudiosrc do-timestamp=true ! "audio/x-raw, rate=48000" ! ladspa-zamgate-ladspa-so-zamgate attack=.1 release=.1 threshold=-22 ! audiorate ! audiowsincband mode=band-pass lower-frequency=700 upper-frequency=960 length=384 window=3 low-latency=true ! jackaudiosink buffer-time=3000 the 555 oscillator is held back by an H11F1 FET OPTO-ISOLATOR the CW KEYER's RIG KEYING JACK is used to key the diode side of the H11F1 sending the harsh raspy square wave into the LINE INPUT of the PI's LINE INPUT JACK of a Behringer UCA222 usb sound card operating at very low latency settings of JACK AUDIO CONNECTION KIT 48K sample rate, 3 periods of 72 buffer frames at 95 percent priority real time

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