Entries by Kevin Godden

Simulation of LC Oscillator in Rust

Over Christmas I started thinking about LC Tank Oscillators, especially as used on early Spark-gap radio transmitters.  For no particular reason (except for fun) I decided to try to simulate simple LC and LCR  oscillators from first principles in Rust.  The simulations worked out quite well but need a bit more work as they are […]

Testing Jetson Orin Hardware JPEG Encoder Block

The Jetson Orin AGX has two Hardware JPEG Encoder blocks which in theory will allow you to encode images to JPEG much faster than using the CPU alone – as usual the reality is a little more complicated than the data-sheet might suggest! The aim was to test and time the encoding of 24Bit RGB […]

NTP with GPS and PPS working without network clock

Is it possible to have a PPS disciplined NTP server without a network reference clock or network connection? While doing some camera synchronisation and timestamp testing, I setup a Raspberry Pi NTP server with PPS using an Adafruit GPS hat so that I could sync my cameras’ time to NTP, trigger them using the PPS […]

Simple Wrapper of boost::asio for receiving UDP datagrams

More easily receive UDP Data via boost::asio providing just IP address and port umber. The boost::asio classes provide a cross platform way to communicate via UDP without having to use the raw socket libraries, however they can be confusing and hard to use do to their designed-in flexibility. Sometimes I just want to provide an […]

mktime() always uses local time zone and converts from UTC

If you’re working with UTC times, you may be upset to find that mktime() always converts using your local time zone thus wrecking your UTC times.  Instead of mktime() use: Linux/Posix: timegm() Windows: _mkgmtime() For example, let’s use timegm() to make a UTC time which we will pass to SolarAzEl() to calculate the Solar Elevation […]

Creating time_t value from a UTC date and time in C

Programming with time is difficult and error prone, for this reason I usually try to keep things in UTC so that I don’t have to worry about time zones and daylight saving offsets etc. When in C++ I mostly use the boost::ptime library but I was surprised recently about tricky it seemed to be to […]