Sunday, 5 July 2020

Measuring SSB TX filters

I have just finished building all the blocks of my test lab (so far...). These are:

1. A Direct Conversion RX, DCRX, for the 40m band, with VFO input from an RF SIGGEN
2. An RF SIGGEN. Based on the Si5351 and covering 1-150MHz (my limits, the Si5351 can do more).
3. An AF SIGGEN. Based on the AD9833 and covering 0-100kHz (my limits, the AD9833 cam do more.
4. An RF METER which uses a -30dB TAP to allow power measurements. The TAP includes a 50R dummy load
5. A 12V/1.5A power supply to power the above
6. And finally, not yet boxed, an AF METER measuring in dBv and Vrms.
Also in the picture is the MAT-125e auto ATU.

In this project I use these along with my MacBook & software to measure the TX filter response of my ELAD FDM-DUO transceiver. This is the setup

Block diagram of the setup

The FDM-DUO transceiver has an RF output up to 5W over all bands. It has two USB inputs for digital transmissions. A "CAT" serial data port and a digital audio port "TX", which actually is an input and an output and is used with apps like WSJT for FT8 mode.
Connections on the FDM_DUO

The RF output is fed to the 30dB TAP attenuator, with a built-in 50R dummy load, and on to the RF METER which has an Arduino sketch written to display the power before the attenuator. This meter can display RF from -50 to +30dBm.

The USB CAT and TX audio inputs come from my MacBook. Where I use two applications, first a serial terminal app "iSerial" to connect to the FDM-DUO CAT port. This allows me to send PTT transmit and receive commands, "TX1;" and "RX;". The second app is Audio Hijack which is a wonderful app allowing you to make any audio connections inside the MacBook just by dragging the items to the screen. I have a USB audio ADC plugged into the USB input which is connected through to the FDM-DUO TX audio port:

The Hijack audio and iSerial terminal apps

The input to the USB ADC is from my AF SIGGEN I built a while ago (look down this blog for details, schematics and software). This SIGGEN covers the needed 50-3000Hz for filter measurements.

To receive the FDM-DUO RF signals I am using a direct conversion receiver that I designed for the Banbury Amateur Radio Society "LEARN-CODE-BUILD" project that I ran a couple of years ago. It is a 40m RX with VFO input from a matching RF SIGGEN. It was targeted at FT8 reception and performed excellently, allowing club members to become familiar with this digital mode using the WSJT app few had tried at that time. The audio output of the DCRX goes finally to my new AF METER.

To measure the filter response, set to one option of 200-2700Hz, the FDM-DUO is switched into transmit by sending a CAT command "TX1;" from the iSerial app. The AF SIGGEN output is adjusted to give 1-2W output power. The frequency is scanned in 50Hz steps over the low and high filter cut off limits and the AF signal from the DCRX is measured. This is the result

The cutoff frequencies of the FDM-DUO filter set to 200-2700Hz

As you can see the upper cut off is very sharp, which is good to avoid spill over to adjacent stations. The low cut off is a little smoother which gives fuller voice characteristic.

It is very noticeable when using an SDR waterfall on your receiver, that  you can see the spectrum of the other station. These vary a lot, showing both the Bandwidth and signal from full and solid across the frequency range. It is also very clear when the station is using audio compression.

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.

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

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, 100 taps

Saturday, 20 June 2020

QRP Amplifier

I am often in need of a small amplifier that can output a few watts. For example recently I put together a demo WSPR frequency generator using an Arduino and a Si5351 synthesiser. 

The output is +10dBm.

 On ebay there are ready built modules that can output up to 3W. Like this one, that works on 12V,

But I find that the gain of these amplifiers is more than I need. So I am building a small box that has in it an amplifier module to which I will add a stepped attenuator. 

I found this design on the web,

This will give me steps of 5dB from 0-35dB overall, perfect.

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

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

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

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



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

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.