Uploaded December 2024 | Updated December 2026, 1 day ago
the SINC FILTER design produces beautiful raised cosine edges...
this python code is very adjustable for bandpass width and center frequency etc...the python code also includes a GTK GUI volume slider to adjust filter's audio output strength...
this code is written by chatGPT... this design is in early stages of development, so... plenty of room for improvements to be made, optimizations etc...
please leave a comment if you test and try out this python code and come up with some of your own upgrades... you will have to modify the audio engine to suit your OS, the OS used in this demo was UBUNTU, using JACK AUDIO CONNECTION KIT at 192Khz sample rate, 1024 buffer frames
NOTE: one of the benefits of using a SINC filter, is to get the standard, typical raised cosine edges (verses R/C exponential) NOTE: at QRQ CW speeds, this becomes more evident where you can hear and notice the better sound from raised cosine edges (less edge noise etc...)
here is the link to download the python code:
https://u.pcloud.link/publink/show?code=XZnHP05ZiwX13jUeLDh6a7vTLS9cqQsJtHMX
12-5-24, UPDATE
here is an upgraded PYTHON CODE for the same filter, but this version includes dynamic on the fly adjusting for all of the filter parameters and has a volume slider to set the volume to your desired output after changing any of the filter settings, f_low, f_high, and filter length(taps) https://u.pcloud.link/publink/show?code=XZmkK05ZaqPr8mrvpMm2lSp8koAUKmJzhQeV
here is a picture of the python GTK GUI filter settings controller:
imgur.com/a/gn8mt4Y
UPDATE 12-13-24
this version provides a slightly different choice in the GUI:
CENTER FREQUENCY
BANDWIDTH PERCENTAGE (above and below center freq)
TAPs(filter length)
and the volume slider
https://u.pcloud.link/publink/show?code=XZNMi05ZKinp8v1HJnJdO78TDsFQ9VYsgQH7
NOTE this version has a bug if you choose an ODD number of taps... you can correct this easily
by changing a few lines of code and re-SAVE it... take look at this picture of the corrections
starting and highlighted on line 60... RT CLICK and choose "open image on new tab" for full view
https://i.imgur.com/tqM6nvj.png OR you can just download the 2nd upgraded version here: https://u.pcloud.link/publink/show?code=XZsNL55ZnMW9l1B8wy8ic0wK8GTWVL3HSoPk
the SINC FILTER design produces beautiful raised cosine edges...
this python code is very adjustable for bandpass width and center frequency etc...the python code also includes a GTK GUI volume slider to adjust filter's audio output strength...
this code is written by chatGPT... this design is in early stages of development, so... plenty of room for improvements to be made, optimizations etc...
please leave a comment if you test and try out this python code and come up with some of your own upgrades... you will have to modify the audio engine to suit your OS, the OS used in this demo was UBUNTU, using JACK AUDIO CONNECTION KIT at 192Khz sample rate, 1024 buffer frames
NOTE: one of the benefits of using a SINC filter, is to get the standard, typical raised cosine edges (verses R/C exponential) NOTE: at QRQ CW speeds, this becomes more evident where you can hear and notice the better sound from raised cosine edges (less edge noise etc...)
here is the link to download the python code:
https://u.pcloud.link/publink/show?code=XZnHP05ZiwX13jUeLDh6a7vTLS9cqQsJtHMX
12-5-24, UPDATE
here is an upgraded PYTHON CODE for the same filter, but this version includes dynamic on the fly adjusting for all of the filter parameters and has a volume slider to set the volume to your desired output after changing any of the filter settings, f_low, f_high, and filter length(taps) https://u.pcloud.link/publink/show?code=XZmkK05ZaqPr8mrvpMm2lSp8koAUKmJzhQeV
here is a picture of the python GTK GUI filter settings controller:
imgur.com/a/gn8mt4Y
UPDATE 12-13-24
this version provides a slightly different choice in the GUI:
CENTER FREQUENCY
BANDWIDTH PERCENTAGE (above and below center freq)
TAPs(filter length)
and the volume slider
https://u.pcloud.link/publink/show?code=XZNMi05ZKinp8v1HJnJdO78TDsFQ9VYsgQH7
NOTE this version has a bug if you choose an ODD number of taps... you can correct this easily
by changing a few lines of code and re-SAVE it... take look at this picture of the corrections
starting and highlighted on line 60... RT CLICK and choose "open image on new tab" for full view
https://i.imgur.com/tqM6nvj.png OR you can just download the 2nd upgraded version here: https://u.pcloud.link/publink/show?code=XZsNL55ZnMW9l1B8wy8ic0wK8GTWVL3HSoPk




![Raspberry Pi 4 Pulse Density Modulated CW Transmitter for THROUGH THE EARTH Cave Radio Comms at 8Khz
using this PDM-CW TRANSMITTER PYTHON PROGRAM:
https://u.pcloud.link/publink/show?code=XZsdt45ZB74hUtmVwMYakpGj6aapdSP0xgry
GROK3 wrote this PDM-CW TRANSMITTER user manual PDF
https://u.pcloud.link/publink/show?code=XZhb645Z2DL9sqlUnPFPoa3bOPhscVvBTIIX
a morse code keyboard is brought up to the raspberry pi 4 desktop that when text is entered, according to the speed of wpm set by the user, two well timed signals are sent to control a Capacitive Discharge Circuits POWER supply and SCR/HV Pulse Capacitor which creates a TRANSMIT Pulse Density Modulated CW signal... the setup is as follows, for each dit the program sends one 50 μS pulse width output to Trigger the PDM-CWs SCRs GATE, releasing the stored PULSE CAP energy into the TRANSMIT COIL ANTENNA, creating a self resonant DAMPED SINE WAVE VLF signal output at around 8Khz... to preserve portable battery power, PULSE DENSITY MODULATION is used so that only 1 pulse at zero point is used for a dit, and for a DAH, only 3 pulses, spaced 1 dit length apart, at ZERO, 1D, and 2D, at whatever speed is set by the user, however, each DAH and dit timing is still preserved by the python TRANSMIT CW KEYBOARDs internal timing math so that when just one dit length of time is added to every pulse at the receiver, and used to key a midi cw software keyer, the original CW ELEMENT LENGTHS are reproduced at the receive site the first thing that happens when text is entered into the cw keyboard, is that the python program turns on GPIO pin 19 for a certain amount of time according to the current WPM speed, this time charges the HV PULSE CAP of the PDM-CW transmitter(low DC TO high DC inverter) then 1 ms before the DIT or DAH pulse is keyed by the SCR signal on GPIO PIN 18, pin 19 turns off , turning off the power to the PDM-CW transmitter so that the SCR will STOP right after it fires and the damped sine wave 8khz output drops to zero(this pin 19 cycle helps to commutate the SCR in the case of using a too low of inductance EMF kick back from the coil antenna that does not contain enough ooomph to commutate the SCR itself etc) each pulse gets the same amount of charging time so that the joules collected in the pulse capacitor are the same for each pulse according to the WPM speed being used and the length of one dit minus 1 ms.... so at slower speeds, there is more charging time for each pulse and thus more VLF magnetic EMF signal at 8khz is released per pulse
NOTE: both GPIO pins activate LEDs inside SOLID STATE RELAYs one SSR can handle 6 amps and has a TURN OFF time of .1 to 1 ms, and a TURN ON time of 2 to 4 ms the other SSR is used by pin 18 with a much faster turn on time of around 30 to 50 μS so that the SCR GATE is only triggered by the least amount of pulse width possible from pin 18
NOTE: this python GPIO pdm-cw transmitter code was written by GROK3
you can attach the linked above python code in a file and feed it to GROK3 to ask more questions about this setup and how the code works on a pi4/s GPIO pins
RECEIVER SETUP
a pick up magnetic field VLF ANTENNA is connected to the LAPTOPs mic input jack... ( NOTE, you can strengthen the RX signal substantially at the receiver if you put a cap in parallel with the antenna to resonate at the TRANSMIT VLF FREQ [8Khz] ) for each pulse received, a sidechain gate adds 1 dits worth of time to each pulse and creates a CW MIDI note output restoring the original dit length that the TRANSMITTER is using... for a dah, then, since the dah sent by the transmitter is using 3 pulses sent at ZERO, 1D, AND 2D each pulse gets 1 dit worth of time added to it by the sidechain settings and at the end of 3 dits at 1d time each, = 1 dah etc..
goes to the MIDI sidechains midi output port and keys the midi input of RECRI KEYERs CW KEYER module https://github.com/recri/keyer Raspberry Pi 4 Pulse Density Modulated CW Transmitter for THROUGH THE EARTH Cave Radio Comms at 8Khz](https://i.ytimg.com/vi/hW8iGwB9C8g/mqdefault.jpg)





