SDR A.M. Transmitter on I Q Mixer board RF harmonic problem

stefanodi

Member
Hi, after solving the code to generate the amplitude modulation in a radio transmitter (thanks again Bob!), Now I ask for help to solve the problem of the harmonic generated by the 11025Khz oscillator visible in the photo.
I am attaching the schematic of the Tayloe based mixer board designed by my radio friend Giampietro (IK3MAX) which works great in SSB.

I tried some filters (FIR), but the problem remains ... Thanks in advance to those who will help me.
Stefano.
AM_TX_MIXER_11025.jpg
FILTER.jpg
rtx_mixer.jpg
Code:
/* File: AM_TEST_TX-FORUM-1.ino
 * Project's name: "Old Style A.M. RTX"
 * Initial project request by Stefano Homebrew
 * @ https://forum.pjrc.com/forum.php
 * Forum code by BOB LARKIN
 * Developed for Teensy 4.0 https://www.pjrc.com/teensy/
 * Audio shield PCM1808 & PCM5102A
 */
//****
#include <Wire.h>                         
#include <si5351.h> 
#include <ILI9341_t3.h>
#include <Audio.h>  
#include <SPI.h>
#include <SerialFlash.h>
//****Display ILI9341
#define TFT_DC    9
#define TFT_CS    10
#define TFT_RST   255  
#define TFT_MOSI  11
#define TFT_SCLK  13
#define TFT_MISO  12

#define BLACK    0x0000//My alternative colors
#define MARRONE  0x5041//My alternative colors

#define IF_FREQ 11025.0  //15000//****sine gen.


//****var pll frequency init.
volatile long freq = 25000000;//test lab. frequency
volatile uint32_t vfoFreq = 0;//for next implementations

//****var print frequency
byte unita,decine,centinaia,migliaia,decinemigliaia,centmigliaia,milioni ;  //variabili stampa freq.
//////////////////////////////////////////////
// GUItool: begin automatically generated code
AudioInputI2S            i2s2;           //xy=151.66675567626953,142.0000286102295
AudioSynthWaveformDc     dc1;            //xy=307.6666831970215,73.00003051757812
AudioFilterBiquad        biquad1;        //xy=309.6666831970215,137.00004863739014
AudioMixer4              mixer1;         //xy=490.2820587158203,85.0000228881836
AudioSynthWaveform       waveform1;      //xy=493.12828826904297,186.00009155273438
AudioEffectMultiply      multiply1;      //xy=722.4359931945801,84.15388488769531
AudioOutputI2S           i2s1;           //xy=1117.6666526794434,77.00004529953003
AudioConnection          patchCord1(i2s2, 0, biquad1, 0);
AudioConnection          patchCord2(dc1, 0, mixer1, 0);
AudioConnection          patchCord3(biquad1, 0, mixer1, 1);
AudioConnection          patchCord4(mixer1, 0, multiply1, 0);
AudioConnection          patchCord5(waveform1, 0, multiply1, 1);
AudioConnection          patchCord6(multiply1, 0, i2s1, 0);
AudioControlSGTL5000     sgtl5000_1;     //xy=312.6666679382324,200.00005531311035
// GUItool: end automatically generated code

//*******
ILI9341_t3 tft=ILI9341_t3(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCLK, TFT_MISO);
Si5351 si5351;  

//************************

void setup() {
  Serial.begin(9600);
  
//****init ILI9341  
  tft.begin();
  tft.setRotation(3);
  tft.fillScreen(ILI9341_BLACK);
  
//*****DISPLAY REM
  tft.setCursor(2, 232);
  tft.setTextColor(ILI9341_GREEN, ILI9341_BLACK);
  tft.setTextSize(1); 
  tft.print("AM_TEST_TX-FORUM-1"); 
   
//*****PLL SET
  si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0);
  si5351.set_correction(210000, SI5351_PLL_INPUT_XO);//My XTAL correction
  si5351.set_pll(SI5351_PLL_FIXED, SI5351_PLLA);
  si5351.drive_strength(SI5351_CLK2, SI5351_DRIVE_6MA);
  si5351.set_freq((freq-IF_FREQ) * 400ULL, SI5351_CLK2);

//*****Audio shield SETUP**************************************************
  AudioNoInterrupts();
  AudioMemory(16);
  sgtl5000_1.enable();
  sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN);   
  sgtl5000_1.volume(1.0);
  
  waveform1.begin(1.0f,IF_FREQ,WAVEFORM_SINE);
  dc1.amplitude(0.5f);//*****************************livello modulazione
  
  mixer1.gain(0,1.0f);
  mixer1.gain(1,1.0f);

  biquad1.setLowpass(0,8000,0.7);//passa basso
  biquad1.setHighpass(1,100,0.7);//passa alto

  AudioInterrupts();
  
  delay(100);
    stampafrq();
}
//****Setup End

void loop() {

}

//***************PRINT @frequency DISPLAY
void stampafrq()
{       
   vfoFreq=freq; ///////////////////////////////////////////////////
    milioni = int(vfoFreq/1000000);
    centmigliaia = ((vfoFreq/100000)%10);
    decinemigliaia = ((vfoFreq/10000)%10);
    migliaia = ((vfoFreq/1000)%10);
    centinaia = ((vfoFreq/100)%10);
    decine = ((vfoFreq/10)%10);
    unita = ((vfoFreq/1)%10);
//******************************************
    tft.fillRect(112, 44, 169, 32, BLACK);
    tft.setTextSize(3);
    tft.setCursor(121,44);
    tft.setTextColor(ILI9341_WHITE);
    tft.print(milioni);//
    tft.print(".");
    tft.print(centmigliaia);
    tft.print(decinemigliaia);
    tft.print(migliaia);
    tft.print(".");
    tft.print(centinaia);
    tft.print(decine);             
}
 
I do not understand what the spectrum plot is. Is this an RF spectrum? My computer doesn't show enough resolution to read the schematic, so it is hard to help!! Bob
 
Hi Bob, I'm back online!
I am attaching the schematic of the RTX card in high resolution.
The AM modulator works well, only it gives me the problem you see in the second photo, @ RF output, it generates this harmonic: (25Mhz + & - IF_FREQ 11025.0) as you can see.
Obviously I don't have this problem in SSB because I don't have IF_FREQ 11025.0
I don't understand if the problem is my card or the software.

Thanks for your help!
Stefano

schema.jpg
AM_TX_MIXER_11025 hARMONIC.jpg
in SSB it generates 25Mhz 50Mhz etc ... of harmonics, with the IF_FREQ 11025.0 it generates the harmonic every 11025
 
Last edited:
I think one way you could send AM with your hardware was to have two versions of your AM modulator, one for the I channel and one for the Q channel. The waveform generators would be 90 degrees difference in phase. The I and Q will go through your transmitter the same as a SSB signal. If set up for USB you will have the desired AM at +11025 hz above your master SI5351 oscillator and there will be the suppressed image AM signal at master oscillator -11025 hz. If the balance is good the suppressed image should meet ( FCC for me ) requirements.

There may be different and better ways, I am not an expert but just experiment with some of the DSP stuff.

Ron K1URC


Edit:

Another way I thought of just now would be to take your existing AM signal at 11025 and run it through a pair of Hilbert filters, +45 degrees for I and -45 degrees for Q. The Hilbert filters will want to pass 11025hz +- your desired AM bandwidth. This approach may be a better fit with your current SSB processing. I think the key point here is that you need an I version and a Q version of your audio.
 
Last edited:
Thanks Ron for the reply (We know you for good QCX SDR!) :) .
With my friend Giampietro (IK3MAX, the designer of the RTX mixer board) we are also testing your proposals.
For the moment we don't have a positive result.
If you have any other suggestions ... Good!

Thank you.
Stefano
 
I think one way you could send AM with your hardware was to have two versions of your AM modulator, one for the I channel and one for the Q channel. The waveform generators would be 90 degrees difference in phase. The I and Q will go through your transmitter the same as a SSB signal. If set up for USB you will have the desired AM at +11025 hz above your master SI5351 oscillator and there will be the suppressed image AM signal at master oscillator -11025 hz. If the balance is good the suppressed image should meet ( FCC for me ) requirements.

There may be different and better ways, I am not an expert but just experiment with some of the DSP stuff.

Ron K1URC


Edit:

Another way I thought of just now would be to take your existing AM signal at 11025 and run it through a pair of Hilbert filters, +45 degrees for I and -45 degrees for Q. The Hilbert filters will want to pass 11025hz +- your desired AM bandwidth. This approach may be a better fit with your current SSB processing. I think the key point here is that you need an I version and a Q version of your audio.


Ciao everyone,
I have attached the photo of the best solution to eliminate the harmonics generated (on I & Q Mixer, Tx out) by the IF_FREQ 11025.0
If anyone has any better ideas... Great!

Stefano


AM MODULATION.png
 
Ciao everyone,
I have attached the photo of the best solution to eliminate the harmonics generated (on I & Q Mixer, Tx out) by the IF_FREQ 11025.0
If anyone has any better ideas... Great!

Stefano
View attachment 29930
That looks great Stefano!!

Not to suggest that you need to change anything, but, if you want to explore this more, there is a library class, RadioIQMixer_F32 that is what you have, after "Mixer1". That includes the two oscillators and multipliers. I mention that because it also includes small amplitude and phase adjustment functions that can compensate for errors in the external hardware. Or, you may choose to ignore that issue altogether!!

Have fun, Bob
 
That looks great Stefano!!

Not to suggest that you need to change anything, but, if you want to explore this more, there is a library class, RadioIQMixer_F32 that is what you have, after "Mixer1". That includes the two oscillators and multipliers. I mention that because it also includes small amplitude and phase adjustment functions that can compensate for errors in the external hardware. Or, you may choose to ignore that issue altogether!!

Have fun, Bob

Very good!
With this I closed and solved the AM transmission problem with Teensy 4.0, 16 Bit 44.1 Khz audio sampling system.

Dear Bob, I have tried your 32bit 96Khz system and it works very well! I will open a new post for another request that will concern
OpenAudio_ArduinoLibrary .

Now, thanks for the help!

Best regards
Stefano
 
Back
Top