Wednesday, 27 May 2020

+40db small signal amplifier

I have been looking into small signal amplifiers, aiming to design one to have about +40dB gain and a few 100 mW output, this is the result


For both stages the DC bias is for about 1.1V on the emitters, and currents of around 10 & 50mA. Each emitter has a feedback resistor to stabilise the stage gain. The overall gain is +40dB with a 50R source and load.

In my tests I have an input of 20mVrms giving an output of 4.3Vrms, or 380mW. Here's the breadboard


+40dB amp, input at left, +12V bottom, output right
Transistors 2N3804 & 2N5109

Monday, 25 May 2020

More.. Digital SSB

I have found a solution for the USB breakthru which is to increase the number of taps (coefficients) used by the Hilbert Filters, which pushes the accurate +/-45 degrees of phase shift to a lower frequency.

I increased the number of TAPS to 100 coefficients. To do this you must run the Windows Hilbert Filter design program, output 100 +45 and 100 -45 coefficients, convert them to "short" values again  and paste them into the TEENSY_TX sketch. I tightened the original bandwidth to Fc 1.1kHz BW 3.1kHz, giving this filter shape, you can see here also the phase (-45 deg) and how is falls off at lower  audio frequencies, causing the USB breakthru as the phasing is not correct.


FIR filter Fc 1.1kHz BW 3.1kHz

This was the result, the LSB signal is fairly tight within the RX 3kHz BW, but there is a bit of splatter outside the range,


LSB output, 3kHz BW RX


RX on DSB 6kHz, showing TX switch USB/LSB
The other signals at the left are genuine stations

I am still thinking about how to reduce the bandwidth to be clearly between 300 & 3kHz as signals are spilling out to nearly 3.5kHz at the moment. I would also like to put in some audio limiting/compression to "tighten up" the audio and prevent over modulation and splatter. I also need to cancel out the remaining carrier signal...


Thursday, 16 April 2020

Digital SSB

There are some updates to this design above.

A current slide presentation of this project is here (PDF).

Previously (March 2019 down this blog) I built a traditional SSB generator using a fixed frequency balanced mixer and xtal filter to pass only one sideband. Then mixed this again to the final output frequency of 7MHz.

The objective of this development is to make an SSB exciter which generates directly the SSB digitally using a pair of mixers.

PHASING
This is a development following the "Phasing Method" of SSB generation, which has been around for many years, but has been made easier by the introduction of RF synthesisers and audio signal DSP.

Phasing system SSB generation, AF & RF 0/90degree signals

This method of SSB generation has two parts, the first is to find a way to provide audio signals with a 0/90 degree phase shifts and then two signals at the RF output frequency with 0/90 degree shifts.The challenge is to generate these two pairs of signals AF & RF. 

The RF side has traditionally been generated in many SDR designs by using a digital synthesiser (Si570 or Si5351) running a x4 the output frequency, followed by a /4 Johnson counter to generate the in-phase I and quadrature  Q signals for the mixers. But with clever programming the Si5351 can generate two output signals, CLK0 & CLK1 with a 0/90 degree relationship.

The 0/90 degree audio is more of a challenge, that cannot be done well, without a lot of op-amps and high tolerance capacitors and resistors, across the full audio range of 300-3kHz, This has been solved with Digital Signal Processing techniques. Converting the audio to digital I2S then processing it mathematically, using what are known as Hilbert Transforms, and then converting back to analog.


I/Q VFO
First a VFO which outputs two signals "I" and "Q" which are always 90 degree shifted from one another, using an Si5351 synthesiser. The Arduino code for this is here (either FREQ_0_90_7100 for a fixed 7.1MHz output or VFO_SDR0_90 for a variable VFO) which has been implemented on a Nano driving a Si5351 over an I2C bus. Here's the result:


Si5351 outputs CKL0 & CLK1 drive in to 56R


Tuning, Step change


A MIXER
An active mixer can be built using 2 x SA612. Like this

Levels: L & R input 30mV max, use 8k2/560R attenuator from Teensy

The breadboard looks like this


Top: Si5351 driven by an Arduino Nano
Centre: the two SA612 mixers
FT37-43 "combiner" transformer 10+10t

This is the test 0/90 audio input from MacOS "osilloppoi" app.


Audio L & R inputs at 0/90 deg 1000Hz

This mixer has a reasonable carrier rejection of around 30dB.  


SDR RX tuned to 7100kHz, 1000Hz modulation USB

The SA612
- I & Q inputs are 240mVrms (about +1dBm)
- L & R audio is 30mVrms
- RF output into 56R is 100mV p-p (approx -15dBm). 

The SA612 has an input impedance of 1k5. The Teensy Audio Adapter has been set for unity gain (MIC gain "0", LINE output setting "25"), and a maximum MIC input is 500mV. The output uses a 8k2/560R attenuator to feed the L&R signals to the SA612s. The Adapter LINE output levels will be adjusted on test for best opposite sideband suppression.

The FDM_DUO SDR,  iMac running Windows 10 and with FDM-SW2 SDR software, looks like this



ALTERNATIVE MIXER
I have been investigating and alternative to the SA612s mixer. This is a passive design using two of the SBL-1 Mini-Circuits mixers. The choice of which to use depends on the input and output impedances,

This is the SBL-1 mixer, which is deceptively simple,

2 x SBL-1 mixers


The Teensy Audio Adapter LINE out is  specified with a load of 10k, up to 3.18Vp-p, 1.14Vrms

The SBL-1s work at 50R impedance in and out, but the "IF" AF input is very low impedance, I use a series resistor of 120R but it cannot be driven directly by the Audio Adapter. So two buffer +10dB amps are needed,


1 x MCP6002 op amp, +10dB gain


The microcomputers are,

-  the Nano and Si5351 synthesiser, this is very simple with just four connections to the Si5351
Nano and Si5351 synthesiser

- the Teensy & Audio Adapter, also very simple with the Teensy mounted on top of the adapter board


Teensy mounted on top of Audio Adapter
with USB/LSB switch (volume control connections to A1)

The software is the key thing! The sketch for the Nano FREQ_0_90_7100 is here, and for the Teensy TEENSY_TX here. Download also the libraries from here. In particular you will need the Audio library for the audio processing and the oled header for the OLED display formatting together with the u8g2 display library. 


GENERATING AUDIO I/Q
I will generate some audio I/Q signals with 0/90phase difference using DSP techniques running on a Teensy 3.2 board with its associated audio board (rev C) designed by PRJC, available from HobbyTronics.
Teensy 3.2
Teensy Audio Adapter Rev C

The Teensy has a number of connections on the back side as well as the 28 pins along the sides and 5 on the end. It has its own DAC input, but no ADC outputs, so you have to use the stereo I/O Audio Adapter.

These are the pinouts and signals of the Teensy,

Bottom view

Top view - pin functions

The connections to the audio shield are

Bottom view
WARNING: the HP ground (VGND) is not the shield ground (GND),
do not connect them together!
Do not use the HP  output to drive the mixers!
This will destroy the device (I know, I did it)

LINE IN and LINE OUT L & R at the top, microphone direct input is on the right along with the 3.5mm Headphone jack at the bottom on the other side. The pins connect directly to the Teensy 3.2 as follows

Top view

The unused analog and digital pins of the Teensy may be used in your application.  The Teensy Audio Adapter has an output of up to 500mVrms, and uses an attenuator of 8k2/560R to drive the mixer L&R inputs at 30mVrms.


SSB GENERATION
The DSP needs to produce the 0/90deg phase shifted audio signals. It is done like this,

Block diagram

Instead of a single 90deg Hilbert Phase Transform two are used with +45 & -45deg phase shifts (two are used rather than a single 90deg to maintain the same time delay through both I and Q paths). The Out I is non-inverted for LSB output or inverted for USB output by the mixer. An alternative would be simply to changeover the +45 for the -45 transforms (in software, of course).

A design tool from PRJC, the Audio System Design Tool, is used to generate the Teensy code objects and interconnections ("patchchords") for the application, this designed using a graphic interface to draw the configuration,

The simple configuration

Each block is dragged from the left side menu. The stand alone block sgtl5000_1 is the board itself and must be present to allow software instructions to configure the input & output codecs. The other blocks are ones that are interconnected. The design tool is used to export auto-generated code, which defines a series of libraries objects with generated names to be configured later in the code, and interconnections,

Auto generated header code for the configuration above

This code can then be used directly in the application. If you look at the TEENSY_TX sketch you will see this basic outline. In addition in the sketch you can see the setup code of the blocks and the sgtl5000 itself.

The Hilbert Transform coefficients, 16bit signed integers are needed, are generated using the Windows program Iowa Hills Hilbert Filter Designer. 


Calculated HT filter response


The for a 300Hz to 3kHz BW (-3dB), wide enough for FT8, parameters are set as follows,

1. Menu > Passband > Phase Added
2. Frequency 44117 (audio sample frequency of the Audio Codec)
3. Fc = 1.65kHz (0.0747)
    BW = 3.0kHz (0.1360)
    TAPS = 70
4. Two versions will be generated for +45deg and -45deg phase 
5. Chose Kaiser window
6. For both +45 & -45, File > Save Coefficients in temporary files (I saved these coefficients as text files 45p.txt and 45m.txt)

The generated coefficient ".txt" files can be eventually be used as arrays in the TEENSY_TX sketch code. 

BUT FIRST they must be converted to the right format. The Teensy code FIR filters need a pointer to an array of "short"  values (Teensy is a 32bit processor, so a short is a 16bit signed integer). The output of the IOWA HT app is a list of "float" 18 point decimal numbers. Which have been saved to temporary files (45m.txt and 45p.txt). Like this


Hilbert Transform coefficient IOWA program output values

The first thing to do is import these text files  (one by one) into a spreadsheet, then export them as two CSV (Comma Separated Variable) files. Next paste them into the sketch called  Convert_45 here and use it to convert them to 16bit "short" arrays needed for use in the Teensy sketch. These are output on the Arduino IDE Monitor Screen.



The output is two (plus & minus 45 degrees) completely formatted arrays.


The two HILBERT_COEFFS (70) coefficients converted to "short" value arrays

These two complete arrays are then copy & pasted directly into the actual TEENSY_TX sketch

PUTTING IT ALL TOGETHER
On the bench this is it,


Left: Nano
Middle: Si5351, SBL-1 mixer and audio buffer amps
Right: Teensy and Audio Adapter

The Arduino Nano is programmed to drive the Si5351 over an I2C bus (SCL/A5, SDA/A4). The output drive is set at 2mA giving about 0dBm on the SBL-1 inputs. The SBL-1 outputs are combined with a BN43-2402 combiner. The Teensy has a mono microphone inputs and two line outputs -45/+45 deg phase shifter, and is filtered to 300Hz-3kHz. A x3 (+10dB) AF amplifier increases the Audio Adapter output drive to the mixers.

RESULTS
These are screen shots from my SDR receiver. 3kHz filter bandwidth, 7.1MHz. Using a fixed 7.1MHz frequency VFO sketch FREQ_0_90_7100 here.


1.5kHz tone input, 
USB breakthrough -40dB



Calling CQ with MIC input
DSP filter could be narrower

The RF output from the mixer is about -20dBm (10-30mV). 

I have tested the SSB exciter on 40m through 10m and it seems to work well. It does not work so well on 80m as the RF 0/90 output from the Si5351 is not accurate and there are both sidebands on the output.

A couple more photos, showing the addition of a rotary encoder for tuning and an OLED display of the frequency, using the VFO_SDR0_90 sketch here.


OLED display
Mixer board
Teensy & Audio Adapter


Arduino Nano
Mixer board with Si5351 synthesiser
OLED display


AUDIO LIMITER/COMPRESSOR
The SGTL5000 IC has  some built-in DSP functions of its own. These include and auto-volume control and EQ filters.

Obviously these would both be useful for processing the MIC input. But so far I have failed to get them going. I will continue to work on it.




ACKNOWLEDGEMENT
Acknowledgement to ZL2CTM for educating me in this effort. See his videos here


Sunday, 12 April 2020

5W RF Amp

Taking a look at RF amplifiers. And the development of a driver and a PA output stage, with output somewhere around 5W.

DRIVER STAGE
 I tried a simple circuit using a pair of 2N3904 which quite a few people seem to use, but the results were poor with not much gain - 10dB or so at best.
My feeling is that this is due to a low fT (transition frequency) of the 2N3904, or these low cost versions of them.

I have now switched to a proper HF device, the 2N5109 (with an fT of 500MHz). And results are spectacular. This is the small circuit I am trying out.

Vcc = 12V, Ic = 52mA

Using a 100R potentiometer on the input from my Si5351 SIGGEN, and adjusting for 250mVrms input, the output is then 2.4Vrms, or 94mW. The highest output without clipping is around 3.9Vrms, or 290mW with an input of 420mVrms. Assuming (not unreasonably) an input and output impedance of 50R the power gain is

Pgain = 10 * log (3.9^2 / 0.42^2) ~ 20dB

Voltages were measured by my SmartScope running on my iMac. (Blue output, Green input)



OUTPUT STAGE
Also tried the (in)famous IRF510 as an output device, poor results - gain 10dB at best. So I plan to use the RD16FHH device. The final circuit is


This has an overall gain of around 40dB (20 + 20dB), and needs a signal of 35mVrms, after the 100R variable, for an output of 1W. I cannot measure the maximum output as the heat sink on the RD16HHF1 is too small to allow me to crank it up, but on a quick flip test it easily outputs 5W into a LPF and 50R load.

An LPF must be added to the output and a 40m one has been used in testing.



Wednesday, 8 April 2020

Mac, SoundSource and audio to FDM-DUO

The FDM-DUO menu 34 allows you to set the output RF power limit. This may be set to specific values 1-2-5W or to MAX. When set to a specific value AGC is applied to the audio input (USB or MIC) to limit the output RF power. When set to MAX there is no AGC and higher powers maybe output, but there are two dangers. Heating of the PA starts a small fan, and high SWR shuts down the PA completely.

On some apps the maximum audio output from the Mac is not enough to drive the FDM-DUO modulation to its selected power limit level. This is especially true when the menu 34 is selected as "MAX" and the output is set entirely by the audio input.

If the desired output cannot be achieved at 100% computer audio output settings, then a program SoundSource can be used to increase the output level of computer audio output beyond 100%, by factors of x2, x3 or x4.

SOUNDSOURCE
The increase of the audio level can only be applied to a specific application, so this must be chosen first, as shown here


Select the app output audio to go to the USB output FDM-DUO Audio. Then hit to small > right hand icon to show the adjustment menu


Here two adjustments can be made, the Volume Overdrive and the Equalizer. To boost the audio level to the FDM-DUO select x2 up to x4. The volume adjust slider at the top will show the 100% level, and can now be increased up above this by the factor selected.


Saturday, 21 March 2020

Some WSJT Notes

There are a few basic settings for WSJT. These are ones I have on my MacBook for my ELAD FDM-DUO SDR transceiver. Connection, simple. Just two USB cables from USB-C MacBook to a USB hub for serial CAT (TX/RX), PTT (RTS signal) & digital audio I/O on radio.



PREFERENCES

General
CALL SIGN ... LOCATION

Radio
ELAD-FDM-DUO (do not use TS480)
CAT
 - Serial Port [...]
 - Speed 38400 (same as radio setup)
 - Data 8/1/none
PTT
 - RTS
 - Serial Port [...same as above...]
 - USB
 - None

Test both CAT (Green button) and PTT (Red button)

Audio
Input [FDM-DUO Audio v1.04]
Output [FDM-DUO Audio v1.04]

Colors
[x] My call in message. RED
[x] CQ in message. GREEN
[x] Transmitted message. YELLOW

WATERFALL
Controls
Bins/Pixel 4
Start [200Hz]
[N Avg 2]

All other settings as default, set audio levels - input comes from Aux Audio output of FDM-DUO, set using FDM-DUO menu 6 to 30-40% indicated level. Adjust WSJT power slider to control your TX output.




Saturday, 14 March 2020

30dB Tap for RF METER

A while ago now I designed and built an RF power meter, as part of Banbury Amateur Radio Society "BARSicle" or LEARN-CODE-BUILD project, here and here.

This meter used an AD8307 module to measure RF powers from -70 to +20dBm (micro-watts up to 100mW), and displays these on an OLED display, as a top bar (limited to -20 to +20dBm, 0.01 to 100mW), the RMS voltage, the actual dBm value and the power (watts) into 50R. Details of this are down this blog (see September 2018). Arduino Nano software is here. There is a direct input RF _METER also another version RF_METER_30 of the software which shows the actual dBm and Power when using the -30dB TAP.

Note, the AD8307 needs a 12V supply, and has the module from SV1AFN  has a native input impedance of 50R.

HIGHER POWERS UP TO 100W

For higher power measurements (e.g. +10dBm to +50dBm or 10mW to 100W)  a "TAP" or resistive divider can be used. I have now made myself up a very small box containing a 50R/50W RF dummy load and a -30dB TAP (x1000). The dummy load is switched so that I can use the box alternatively as an RF voltmeter (with 760R input impedance) or with a switched-in TX dummy load.



This works very well for powers up to 100W (but needs a better heat sink at this power!). The RF METER effectively displays +10 to +50dBm (10mW to 100W) on its bar scale and related values for voltage, dBm and power. 

This is a dBm/power table that maybe useful:


VNA

Sticking this on the Nano VNA I get these numbers

Marker at 30MHz

This shows the 50R load is not usable across the V/UHF range, but usable on HF up to 30MHz or so with a reasonable SWR.