Saturday, 27 June 2020

Digital Filter measurements for SSB generation

I have played a bit with Digital SSB generation, see June 2020 below. There are two methods

1. Phasing - where both AF and RF I & Q (90deg shift) signals are generated. The AF signal is produced using a TEENSY processor and filters defined on the Audio.h library.

2. Weaver - where two sine wave oscillators at half the audio bandwidth (e.g. 1400Hz) with a 90 deg phase shift feed two mixers and mix with the incoming audio, then it passes through two sharp low pass filters and on to the RF IQ mixers. Like this


In this case rather than the accurate +/-45 deg phase shifts produced by Hilbert filters, only LPF are needed. Hibert filters on the TEENSY 3.2 can run with up to 120-140 coefficients, and this does not give a flat phase shift across the full audio band. It drops off at low frequencies. 



The result it that the unwanted sideband is not phase cancelled at lower frequencies and a small amount of the wrong sideband is generated at low frequencies.

But with the Weaver system only LPFs are needed, which could have better characteristics on the TEENSY 3.2. When I tried this out I found that the same problem existed and that the LPFs did not have a sharp enough and a flat eoungh frequency response down the low audio frequencies. So I had the same wrong sideband breakthrough. Perhaps a more powerful processor, that can allow more coefficients to be used, may be needed, like the TEENSY 3.5/3.6 or 4.0.

FILTERS
I have decided to study the filter characteristics and see what can be done. For this I need an audio oscillator to feed the TEENSY and an AF meter to measure the output. I have already an AF SIGGEN  (see this blog for February 2019). Here is an AF METER, based on this circuit from the AD8307 data sheet.
Basic schematic


AF METER
Display shows a bar graph, Vrms and dBv

The software code here is very similar to an RF METER that I had built previously and which runs on an Arduino UNO (or Nano). The AD8307 output goes to the UNO A0 input. The output is displayed on an OLED display.

F1 first filter, Hilbert, 70 taps
Sample rate 41117
Fc 1500
BW 2400
Taps 70
Phase +45 (shown) or -45

Teensy code for this is here

Simulated and actual measured response:



The filter has the expected shape, but it's not what we need for a Phasing SSB exciter, we need a much, much sharper response. As you see in the simulation the phase shift falls away at low frequencies from  the programmed +45. This degrades the phase balance and causes bad balance and unwanted sideband output at low frequencies.

F2 second filter, Hilbert, 200 taps
By way of trying to better this filter, I thought I would try many more "taps" or coefficients in the Hilbert filters. So I prepared +45 and -45 filters with 200 taps. This is the result of a filter with design parameters of Fc = 1.5kHz, BW = 2.4kHz running on my TEENSY.

Simulation/design

Measured

Which is a markable improvement, even if the LF end could still be raised a little. The SSB generated sound good but needs more "punch" which I may be able to get by using the Audio Adapter built-in compressor functions. We will see.

Note: I still have a problem with my mixers (RF I&Q and AF I&Q) which are on my breadboard have too much carrier breakthrough. I thought this was the filters not having good LF phase charactersitics but now I not so sure. Investigate!

Friday, 12 June 2020

GPS 10MHz Frequency Standard

I followed the blog post of PA2OHH and programmed my GPS module to output a 10MHz pulses, in place of the normal 1pps.

Use the UBLOX Windows software (better you go to their web site and download the latest?), install it. 

First you must connect your GPS module to an FTDI Serial RX & TX to USB converter. Remember TX <-> RX and RX <-> TX.

As an alternative PA2OHM uses a programmed Nano to make a UART, and you could too using the sketch SERIAL+UART here. But using a low cost FTDI converter is much simpler.

Now open the UBOX software. First you must connect to your GPS module by selecting the correct COM port. Go to the menu Receiver > Port and select it (mine was COM10). Immediately the software will wake up an start to display graphics GPS data. Now chose View > Configuration View and you will get this window


Change the parameters like this,


Now hit the Send button lower left to program the GPS. The GPS PPS output will immediately to output a 10MHz signal. I checked this on my ELAD FDM-DUO SDR, which turned out to be 6Hz low!


In CW mode with 500Hz bandwidth


My SDR is 6Hz low!




Monday, 8 June 2020

GPS for QSOs

FOR QSOs & CONTESTS
There is a useful Amateur Radio application for your GPS, here it is. This time the latitude and longitude display is replaced by your Maidenhead Locator! This sketch GPS_QSO is here. The schematic and build are in a previous blog post below.

And this is the display at my location,

Remember: the time is in GMT

This should make field day QSOs a little easier, everything you need for your log at 13:27

"Thanks Mike, you are 59033 in India Oscar 92 Hotel Foxtrot" reports.

Sunday, 7 June 2020

GPS module - sentence and lat/lon date/time display

I have had a GPS module lying around for more than a year, but never wired it up to see if it works. When they are working they squirt out lines of text, called sentences, with starting prefixes $GPxxx which give a lot of data.

I have connected up my GPS module with another module which is a serial (RX/TX) data to/from USB converter.

 You can see the four connecting wires, Vcc-5V, Gnd-GND and Rx - TXD, Tx - RXD.

Next I connected the module to a USB port on my MacBook and ran a Serial Terminal app called "iSerialTerm" (excellent reliable app by the way). I set the terminal to the baud rate of the GPS module, 9600baud, chose the Serial terminal module USB address (which turned out to be "usbserial-00000000") and connected. Immediately I saw the GPS had acquired the satellites and was displaying received sentences.


Serial Terminal display

Coding of one sentence, RMC

A STEP FURTHER
And taking this a step further how about displaying the latitude, longitude, date and time. I wired up on my table top an Arduino Uno like this

The GPS is connected to Uno A0 and A1 as the RX & TX serial data lines. The OLED is connected to A4 and A5 as the I2C SDA and SCL lines. The other connections are power and ground (the GPS is connected to 3V3 as this is a spare pin, it works on either 3V3 or 5V). This is what it looks like



CODE
Now I have just to write some code... There is a useful library on the web called TinyGPS, it's documentation is here. I just needed two functions, one to pull down the latitude and longitude, the other to extract the date and time. These versions are,

      gps.f_get_position(&lat, &lon); // as floats
      gps.get_datetime(&date, &time, &fix_age); // as unsigned longs

Now to display them on the OLED. The lat and lon are floating point numbers and can be simply displayed using the functions

     dispNum(X, Y, lat, 2);
     dispNum(X, Y, lon, 2);

from my Oled.h header of functions using the u8g2 library behind it.

The date and time have to be sorted out. They are retrieved as "unsigned long" looking like this

Date  80620 = 8 Jun 2020
Time 9190200 = 9:19:02

If you are happy to read them like this then just display them, again using again the dispNum(...) function. 


8 Jun 2020 and 9:21:55

But if you want them as a "proper" Date (day, date, month, year "Mon 8 Jun 2020") then you have to do some extraction and use two of my Oled.h header functions

     dispDate(20, 40, dw, dy, mo, yr); // use dw = NULL
     dispTime(20, 55, hrs, mns, sec);

To avoid for now working out the day of the week (Mon, Tues...) I send a NULL which tells the function not to display any day, maybe I will add this later. Sorting out the "dy, mo, yr" and "hrs, mns, sec" is done in a couple of functions like this

// extract bytes dy, mo, yr from 80620 = 8 jun 2020
void calcDMY() {
  dy = (byte)(date / 10000);
  mo = (byte)(date / 100 - dy * 100);
  yr = (byte)(date - dy * 10000 - mo * 100 );
}

// extract bytes hrs, mns, sec from 9215500 = 9:21:55
void calcSMH() {
  unsigned long t;

  t = time / 100;
  hrs = (byte)(t / 10000);
  mns = (byte)(t / 100 - hrs * 100);
  sec = (byte)(t - hrs * 10000 - mns * 100);
}

You can then get this display

Remember: the time is in GMT

The sketch for this is GPS_DISPLAY here.

Coding & the working system











Saturday, 6 June 2020

Update on Digital SSB

I had been keen to implement a better drive AF amplifier between the Teensy output (designed to drive 10k) and the balanced mixer inputs (120R).

I have three choices, a small module using a TDA2822 stereo audio amplifier, an emitter follower or a couple of LM386 amplifiers. I wired up the TDA2822 first, then powered it up - making a grand mistake using a 12V supply, when the TDA2822 is rated at 5V. It blew up.

So now I have used a couple of LM386s which give x20 gain and use a 12V supply. The output of the Teensy Audio Adapter is max 1.2Vp-p, this is the digital limit, no wy togo higher, with an overhead margin a working outputis around 0.2Vp-p. This would give an output of 4Vp-p from the LM386. Too high. So I have included a couple of 10k trim pot volume controls. This has the added advantage of being able to balance the AF L & R channels and minimise the unwanted sideband. This is now the circuit



New circuit

And the board and system look like this


Board


System



LSB output

The rebuild has reduced the carrier break though and it is now 40dB below peak signal. There is still the issue of USB break though as I have seen before. Here is the breakthru by frequency, equals the USB dB  down level,

70 taps USB down in dB

But this is due to weakness in the FIR Hilbert filters in the Teensy, Above is the filters using 70 coefficients or taps. With 100 taps and a slightly narrower BW, the USB breakthru is improved


100Taps, narrower BW, USB down in dB

And this is the Bandwidth using white noise as a source, the SDR is set to 3KHz

SDR at thing 3kHz with white noise input

BOOST
Now I will try something else. The Audio Adapter chip can pre-process audio before passing to the I2S converter and on to the Teensy. I have enabled this and also a Auto Volume Control. The result is a more "punchy" modulation and it is more difficult to over modulate.

I still have the USB breakthru. I have tried a larger Hilbert filter (ideal would be at least 200 taps), but the Teensy cannot handle above 100 taps in two filters. 

The sketch TEENSY_TX_100_BOOST is here.






Thursday, 4 June 2020

Let's play home made WSPR

A couple of years ago I wrote an Arduino sketch to generate WSPR on 7040.1kHz. This could be loaded on my general purpose Si5351 signal generator (see this blog, 2018 August) which has three outputs (only one CLK0 is used), a rotary encoder for frequency and/or any other functions, and an OLED display. The design is straightforward,


It also includes a Real Time Clock DS3231 chip on the I2C bus to give the accurate timing required by WSPR and here is the DATE_TIME_SET sketch to set the date/time.

To drive the display I use the superb library u8g2 and an Oled header I wrote which defines some functions like 'display message' or 'number' in different sizes, or draw a 'bar graph', etc Using this header gives all my projects a uniform display GUI. The frequency can be adjusted over the narrow 40m WSPR band, initially it is set to mid-band at 7040.1kHz. The WSPR signals are encoded using a WsprMessage class library.

Back to the WSPR hardware.
The SIGGEN output is quite low, around +7dBm (5mW, 0.5Vrms) or so and not enough, unless you have a superb antenna system, to transmit WSPR. At least +25dBm (3-400mW, 4-5Vrms) is needed. Come-in the two stage amplifier I described below. This has a gain of +40dB so needs an input of around 10-20mV for full output of around 375mW.

So I have used a small attenuator to bring the SIGGEN output down to the amplifier input level.

The Si5351 SIGGEN produces a square wave output with strong harmonics, so a good Low Pass Filter is needed to feed the antenna and not radiate interference. The set up then becomes,


I checked this out by receiving the signals on my ELAD SDR tuned to 7038.6kHz USB with the audio fed to the WSJT software, which decoded it very well. (I can run this either using the SDR software FDM-SW2 -> VAC -> WSJT under Windows using Parallels on the Mac or directly using WSJT on MacOS with data outputs from the ELAD SDR, which has a built-in soundcard).


The set up, SIGGEN and +40dB amp.

After a 12 hours running these were my 'spots' using my (fairly useless) small 60cm loop antenna on an indoor windowsill...


Spots on 7038.6kHz



Best so far 989km
3km / mW!!!

Why don't you try it to see where your antenna system propagates to?