[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [linrad] DSP Question



Mark,

>I've begun to picture the complex LO as a phasor that rotates. To my
>understanding,  it will be positive during half of it's rotation and
>negative during the other half. Does that mean that this replica will change
>as the phasor rotates, or are you referring to the direction in which the
>phasor rotates?
>  
>
When I say positive or negative range, I mean positive or negative 
frequencies.
A real signal, let's say a carrier at 7 MHz, has a positive component at 
7 MHz, and a negative one
at -7 MHz. This is what causes the image responses when you do a mixing.
To eliminate one or the other component, you need an analytic 
description of the signal, which is
done with the two components I and Q. That's why they are so used. They 
permit you to multiply
two analytic signals, having just the sum as a  result, the difference 
is gone. 
Let's make an example for a direct conversion Rx :

Carrier at 7 MHz,   LO at 7 MHz, both real signals, which means carrier 
at +7 and -7 MHz,
Lo at +7 and -7 MHz.  Now multiply them together. The result is a 
combination of the 4 frequencies :
(+7) + (+7) = +14 MHz
(+7) + (-7)  =  0 MHz
(-7) + (+7)  =  0 MHz
(-7) + (-7)  = -14 MHz
The 14 MHz are easily filtered away with a low pass filter, but the DC 
component is nasty, because
you have the original LSB and USB of the 7 MHz carrier irremediably 
mixed together, as the zero IF
is composed of the original +7 MHz signal pushed down to zero, having 
thus its USB going from
zero to let's say 3 kHz, and the LSB going from zero to -3 kHz, _AND_ 
the -7 MHz component
pushed up to zero, with the LSB going from zero to +3 kHz, and the USB 
going from zero to -3 kHz.
At this point there is on this earth no way to separate USB from LSB.

Now keep the carrier at 7 MHz as a real signal, but make the LO an 
analytic signal, with just the positive
component. For this, you need to have the LO described by I and Q. What 
happens now ?
(+7) + (+7) = 14 MHz
(-7) + (+7) = 0 MHz
The component at zero IF isn't anymore the composition of two different 
signals, LSB and USB keep
their identities separate. In this example, you will have the LSB from 
zero to +3 kHz, and the USB
from zero to -3 kHz. They can now be individually selected, which can be 
called, with a loose term,
"demodulation". Leif is right in saying that it is not a true 
demodulation, as it is not an information
superimposed on a carrier, but let's use the word conventionally.

Of course, as the resulting 14  MHz and 0 MHz signals do lack their 
respective negative components,
they also are analytic signals, which means they must be described by I 
and Q.

Hope you are still with me ...:-) But if you sketch all this on paper, 
it is much more intuitive.

>Do I need to do this bandpass filtering before I do the complex FFT below,
>or can I use filtering in the frequency domain? If I do filter it here,
>should I decimate the sample to a lower sampling rate before doing the FFT?
>  
>
The example above is of course for an hardware half-complex mixer, as 7 
MHz are intractable in
software. Working at much lower frequencies, if you do a low pass 
filtering in the the time domain,
before the FFT, then you can downsample, and perform the FFT at the 
reduced sample rate, with
performance advantages.

>I think I understand what you are saying, but let me make sure.  A graph
>would be helpful, but I'll try and explain my understanding in words.
>
>Lets say that I do a 1024 point complex FFT and the (complex) bins are
>numbered from 0 to 1023.  The contents of bins 0 to 511 represent the USB
>signal and bins from 1023 to 512 represent the LSB.
>
>To receive USB, I replace bin 1023 with the complex conjugate of bin 0, bin
>1022 with the CC of bin 1, 1021 with CC of bin 2 and so forth.
>
>To receive LSB, I replace bin 0 with the CC of bin 1023, 1 with the CC of
>bin 1022, etc.
>  
>
Perfect ! You have grasped it exactly. It could be argued that may be 
there are other methods,
more computationally efficient to recover  (notice : I didn't say 
'demodulate' :-) the wanted audio,
but that is what I consider the most mathematically "elegant"...  and in 
any case if you want to
apply a bandpass or band reject filter, this is more easily done in the 
frequency domain.

>Thanks for the info on your SDRadio.  I downloaded the program and it looks
>pretty impressive. Is the source code of at least the demodulation
>available? A lot of time, I can understand an algorithm better if it's
>expressed in code, even if it's not in a language that I use.
>  
>
The source code is not posted on a Web site, but I send it to those who 
ask for it. I will send
it to you as attachment to a private message. The compiler used is the 
C++Builder V6 from Borland,
and the sigproc package used is what you use as well, the Intel Signal 
Processing Library.

73  Alberto  I2PHD


LINRADDARNIL