Amps
[Top] [All Lists]

Re: [Amps] IMD

To: "Fuqua, Bill L" <wlfuqu00@uky.edu>
Subject: Re: [Amps] IMD
From: Dan Mills <dmills@exponent.myzen.co.uk>
Date: Fri, 13 Jan 2012 00:12:31 +0000
List-post: <amps@contesting.com">mailto:amps@contesting.com>
On Thu, 2012-01-12 at 17:56 -0500, Fuqua, Bill L wrote:
> Hi Dan.
>   I figured the first thing I may try is just doing the math and seeing what 
> I get with phase vs frequency on one sideband or the other.
> Hilbert transform basically changes sines to cosines or the other way. Simply 
> introduces a 90 degree phase shift at all frequencies.
> Which means a different delay for each frequency. 

Of course, which is what is required to generate an I/Q analytic pair.

>   I'll go thru the math and scan it and send that to you.

Thanks, better to avoid making a fool of myself before I commit code to
hardware (And worse, RF to aerial).

> Then I when I get time I will do a simulation. But since I don't have  a " 
> simulator" I will
> have to write a program that includes the balanced mixers or multiplication 
> blocks. I think that
> is where things take a twist. That is because one path takes another 90 
> degree phase shift when
> the balanced mixers produce the RF that is then summed back together.

In C....

#include <stdlib.h>
#include <math.h>
#include <stdio.h>

#define HARMONICS (10)
#define BASEBAND (300)
// 100KHz carrier.
#define CARRIER (100000)
// 1Mhz sample rate
#define SR (1000000)
// Generate one seconds worth of data
#define LENGTH (1)

#define M_PI (3.14159265359)

int main (void)
{
        /* Create the I/Q pair */
        float I[SR * LENGTH];
        float Q[SR * LENGTH];
        FILE *FI;
        FILE *FQ;
        FILE *FIQ_ENV;
        FILE *FSSB;

        FI = fopen ("baseband_I","wt");
        FQ = fopen ("baseband_Q","wt");
        FIQ_ENV = fopen ("baseband_envelope","wt");
        FSSB = fopen ("ssb_out","wt");


        for (unsigned int i=0; i < SR * LENGTH; i++){
                I[i] = Q[i] = 0.0f;
                for (unsigned int k = 1; k <= HARMONICS; k+=2){
                        I[i] += sin (k * ((float)i * 2 * M_PI * 
BASEBAND/(float)SR))/(float) k;
                        Q[i] += cos (k * ((float)i * 2 * M_PI * 
BASEBAND/(float)SR))/(float) k;
                }
                I[i] /= 4.0/M_PI;
                Q[i] /= 4.0/M_PI;
                fprintf (FI,"%.10f\n",I[i]);
                fprintf (FQ,"%.10f\n",Q[i]);
                fprintf (FIQ_ENV,"%.10f\n", sqrt(I[i] * I[i] + Q[i] * Q[i]));
        }
        fclose (FI);
        fclose (FQ);
        fclose (FIQ_ENV);
        // Now produce the SSB Modulation.
        for (unsigned int i= 0; i < SR * LENGTH; i++){
                // Change the + to a - for other sideband. 
                float s = sin (2.0 * M_PI * i *CARRIER/(float) SR) * I[i] + cos 
(2.0 * M_PI * i * CARRIER/(float) SR) * Q[i];
                fprintf (FSSB,"%.10f\n",s);
        }
        fclose (FSSB);

        return 0;
}
 
Touch wood this should compile with more of less any c99 compliant
compiler. 

I used gcc invoked as follows:
gcc -W -Wall -O2 -std=c99 -o ssb ssb.c -lm

>   I have mixed feelings of how it will turn out simply because it is not 
> intuitive. 
>    On, now saying that. There are some conclusions that are easy to come to.
>    One is if you are simply mixing (balanced mixer) and filtering with an 
> ideal filter a single sideband signal,
> you are in effect simply translating all the baseband frequecies to higher 
> ones without introducing phase shift.

> When you do that those frequencies that made up a square wave are 
> bandpassed, which you did for your square wave approximation,
> are no longer harmonicly related. 

Clearly, but the two things are unrelated.

> In fact the envelope should be simply an RF envelop with a dip to zero where 
> your leading and trailing edges  were before.

Not sure I see it. 
The sine series goes through zero at the edges, but the cosine series
peaks at that position, and while both series have equal energy the
cosine series piles up at the edges, actually causing an amplitude peak
at that position. 

Dont forget that the waveforms we are used to seeing on a scope are
mathematically DSB with a suppressed zero frequency carrier, just moving
that carrier up merely gives DSB, so we would not expect a baseband
input squareish wave (Really a DSB signal for our purposes) to look the
same as a single sideband version. 

Regards, Dan.


_______________________________________________
Amps mailing list
Amps@contesting.com
http://lists.contesting.com/mailman/listinfo/amps

<Prev in Thread] Current Thread [Next in Thread>