DSPRelated.com
Forums

AM demodulation using I and Q

Started by lightmetal July 3, 2003
I started a thread re: AM demodulation using I and Q a few weeks ago
and I am still having a problem.  According to Frerking, AM should be
A=sqrt(i^2+q^2).  This works if I tune off the AM zero beat frequency
by 1/2 the low pass filter bandwidth.  I don't understand this
problem.

A little more detail:

I am using a pair of mixers fed with a sin/cos local osc. to generate
I/Q at baseband.  SSB demod works fine for upper and lower sidebands
with excellent opposite sideband rejection.  I can zero beat the AM
carrier and receive upper, lower, or both sidebands to stereo output. 
I am using a DDS LO and I am able to accurately zero beat the AM
carrier to less than 1hz. When I do this while listening to both
sidebands or I/Q in stereo, I can hear the sidebands come into phase
as I tune the radio.

Once I have the signal zero beat, I flip it into the AM algorithm and
I hear a great deal of distortion.  Assuming I use a low pass filter
(actually a bandpass) from 30-4000hz, prior to the sqrt(i^2+Q^2) math,
if I move off zero beat by 2000hz, the AM sounds great.  I can move
either higher or lower by 2000 with the same results. It almost seems
like the filter is acting like a mixer??

I'm missing something here.  When I modeled this receiver using Matlab
Simulink, it works fine at zero beat.  If I get this simple
demodulator working I am going to move onto synch AM.  I actually like
listening to the independent sidebands in stereo since it takes care
of some of the fade.

thanks.
lightmetal wrote:
> > I started a thread re: AM demodulation using I and Q a few weeks ago > and I am still having a problem. According to Frerking, AM should be > A=sqrt(i^2+q^2). This works if I tune off the AM zero beat frequency > by 1/2 the low pass filter bandwidth. I don't understand this > problem. > > A little more detail: > > I am using a pair of mixers fed with a sin/cos local osc. to generate > I/Q at baseband. SSB demod works fine for upper and lower sidebands > with excellent opposite sideband rejection. I can zero beat the AM > carrier and receive upper, lower, or both sidebands to stereo output. > I am using a DDS LO and I am able to accurately zero beat the AM > carrier to less than 1hz. When I do this while listening to both > sidebands or I/Q in stereo, I can hear the sidebands come into phase > as I tune the radio. > > Once I have the signal zero beat, I flip it into the AM algorithm and > I hear a great deal of distortion. Assuming I use a low pass filter > (actually a bandpass) from 30-4000hz, prior to the sqrt(i^2+Q^2) math, > if I move off zero beat by 2000hz, the AM sounds great. I can move > either higher or lower by 2000 with the same results. It almost seems > like the filter is acting like a mixer?? > > I'm missing something here. When I modeled this receiver using Matlab > Simulink, it works fine at zero beat. If I get this simple > demodulator working I am going to move onto synch AM. I actually like > listening to the independent sidebands in stereo since it takes care > of some of the fade. > > thanks.
I don't understand the sqrt(i^2+q^2). Intuitition tells me (i + q)/2. When you tune over by half the passband, one of the sidebands disappears, and so does the distortion. Do you know that if you eliminate one sideband from an otherwise normal AM signal, then square the peak-detected output, the result is pretty distortion free? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Jerry Avins wrote:
> > lightmetal wrote: > > > > I started a thread re: AM demodulation using I and Q a few weeks ago > > and I am still having a problem. According to Frerking, AM should be > > A=sqrt(i^2+q^2). This works if I tune off the AM zero beat frequency > > by 1/2 the low pass filter bandwidth. I don't understand this > > problem. > > > > A little more detail: > > > > I am using a pair of mixers fed with a sin/cos local osc. to generate > > I/Q at baseband. SSB demod works fine for upper and lower sidebands > > with excellent opposite sideband rejection. I can zero beat the AM > > carrier and receive upper, lower, or both sidebands to stereo output. > > I am using a DDS LO and I am able to accurately zero beat the AM > > carrier to less than 1hz. When I do this while listening to both > > sidebands or I/Q in stereo, I can hear the sidebands come into phase > > as I tune the radio. > > > > Once I have the signal zero beat, I flip it into the AM algorithm and > > I hear a great deal of distortion. Assuming I use a low pass filter > > (actually a bandpass) from 30-4000hz, prior to the sqrt(i^2+Q^2) math, > > if I move off zero beat by 2000hz, the AM sounds great. I can move > > either higher or lower by 2000 with the same results. It almost seems > > like the filter is acting like a mixer?? > > > > I'm missing something here. When I modeled this receiver using Matlab > > Simulink, it works fine at zero beat. If I get this simple > > demodulator working I am going to move onto synch AM. I actually like > > listening to the independent sidebands in stereo since it takes care > > of some of the fade. > > > > thanks. > > I don't understand the sqrt(i^2+q^2). Intuitition tells me (i + q)/2.
Nonsense! that's (upper + lower)/2. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Jerry, More input;

1) If I tune over by half the filtered I/Q channels, only half of one
sideband would be out of the passband, I think.

2) I found last night that if I zero beat wwv on 10.000.0mhz and
listen to the alternating 600 and 500hz tones, when I switch to the AM
algorithm, the tones jump to 1200hz and 1000hz respectively.  This is
the effect one would get from squaring a signal, correct?  My sqrt
function is working.

2.5) since I/Q are out of phase when I tune over by half, I think the
square problem is going away.  By the way, It doesn't have to be
exactly half, anything from about 25% on works but the audio sounds
best at half.

3) As far as sqrt(i^2+q^2), this should return the envelope of the
signal according to Frerking and others.  I don't think I should be
just applying this to one sideband.  If so, then 1/2 the signal will
be gone with a 3db s/n penalty.

4) Getting back to item (2), I am looking at decimating by 2 on the
output (or 4 on the input??) to clear up the problem.  I saw a diagram
of an AM demod by Dough Smith that had a decimation filter prior to
the sqrt function.

Thanks for your quick response.  I was hoping your would chime in. 
I've read a lot of your posts.


> I don't understand the sqrt(i^2+q^2). Intuitition tells me (i + q)/2. > When you tune over by half the passband, one of the sidebands > disappears, and so does the distortion. Do you know that if you > eliminate one sideband from an otherwise normal AM signal, then square > the peak-detected output, the result is pretty distortion free? > > Jerry
lightmetal wrote:
> > Jerry, More input; > > 1) If I tune over by half the filtered I/Q channels, only half of one > sideband would be out of the passband, I think.
Yes, but tuning over by half the RF passband will move one sideband completely out of it. Which is it?
> > 2) I found last night that if I zero beat wwv on 10.000.0mhz and > listen to the alternating 600 and 500hz tones, when I switch to the AM > algorithm, the tones jump to 1200hz and 1000hz respectively. This is > the effect one would get from squaring a signal, correct? My sqrt > function is working.
Why are you square rooting? AM is simply the sum of the sidebands, I think. On the other hand, a lone sideband beat with the carrier then squared yields a clean signal, so each sideband squared yields two good signals. Maybe you want the sum of the squares without the square root. The square comes into it as the first term of a longer series, IIRC, but I haven't done the analysis since about 1954, and I'm not certain.
> > 2.5) since I/Q are out of phase when I tune over by half, I think the > square problem is going away. By the way, It doesn't have to be > exactly half, anything from about 25% on works but the audio sounds > best at half. > > 3) As far as sqrt(i^2+q^2), this should return the envelope of the > signal according to Frerking and others. I don't think I should be > just applying this to one sideband. If so, then 1/2 the signal will > be gone with a 3db s/n penalty. > > 4) Getting back to item (2), I am looking at decimating by 2 on the > output (or 4 on the input??) to clear up the problem. I saw a diagram > of an AM demod by Dough Smith that had a decimation filter prior to > the sqrt function. > > Thanks for your quick response. I was hoping your would chime in. > I've read a lot of your posts.
<blush> I wish I still had those notes! Did you look in the ARRL handbook? If it's not there, I may tackle the math for myself.
>
Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Jerry Avins" <jya@ieee.org> wrote in message
news:3F062B77.5D54ADEA@ieee.org...
> lightmetal wrote: > >
[deleted]
> > <blush> I wish I still had those notes! Did you look in the ARRL > handbook? If it's not there, I may tackle the math for myself.
The Handbook has the same sqrt(I^2 + Q^2) formula for AM demodulation. Leon -- Leon Heller, G1HSM leon_heller@hotmail.com http://www.geocities.com/leon_heller
Leon Heller wrote:
> > "Jerry Avins" <jya@ieee.org> wrote in message > news:3F062B77.5D54ADEA@ieee.org... > > lightmetal wrote: > > > > > [deleted] > > > > > <blush> I wish I still had those notes! Did you look in the ARRL > > handbook? If it's not there, I may tackle the math for myself. > > The Handbook has the same sqrt(I^2 + Q^2) formula for AM demodulation. > > Leon > -- > Leon Heller, G1HSM > leon_heller@hotmail.com > http://www.geocities.com/leon_heller
Now I need to see why. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry, Thanks again.  LSB+USB/2 = ((I+Q)+(I-Q))/2 or I.  This isn't
it.

Getting back to the filter issue.  4k low pass at zero beat (Fc) would
put both sidebands (positive and negative) frequencies in the passband
(I think).  Moving the 4k passband up or down by 2k would center Fc at
2k with 1/2 of each passband in the filter.

I think the solution is somehow related to the frequency doubling I
mentioned in the other note.


Thanks again.  This is a perplexing problem.



Jerry Avins <jya@ieee.org> wrote in message news:<3F06DADC.B1C76844@ieee.org>...
> Leon Heller wrote: > > > > "Jerry Avins" <jya@ieee.org> wrote in message > > news:3F062B77.5D54ADEA@ieee.org... > > > lightmetal wrote: > > > > > > > > [deleted] > > > > > > > > <blush> I wish I still had those notes! Did you look in the ARRL > > > handbook? If it's not there, I may tackle the math for myself. > > > > The Handbook has the same sqrt(I^2 + Q^2) formula for AM demodulation. > > > > Leon > > -- > > Leon Heller, G1HSM > > leon_heller@hotmail.com > > http://www.geocities.com/leon_heller > > Now I need to see why. > > Jerry
lightmetal wrote:
> > Jerry, Thanks again. LSB+USB/2 = ((I+Q)+(I-Q))/2 or I. This isn't > it.
Yeah. I figured that out already. :-(
> > Getting back to the filter issue. 4k low pass at zero beat (Fc) would > put both sidebands (positive and negative) frequencies in the passband > (I think). Moving the 4k passband up or down by 2k would center Fc at > 2k with 1/2 of each passband in the filter. > > I think the solution is somehow related to the frequency doubling I > mentioned in the other note. > > Thanks again. This is a perplexing problem.
How wide is the whole signal -- both sidebands? You don't have AM if they aren't both in the passband. The doubling is a good sign of nonlinearity. I'll plug away when holiday chores are over. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry,

I am using the AM broadcast band for testing.  I think the bandwidth
is 10k or 5k per sideband.  I am also using WWV at 10.000mhz to get
the regular tones.

If I set my input filters (one for I and the other for Q) equal to 5k
and tune to Fc, then I get distortion.  Adding or subtracting 2.5k,
which puts my LO at Fc - 2.5k gives me a clear signal.

If you search author:jehancoc@pacbell.net you will see the other
thread and a recommended AM demod from Vlad but it was compute
intensive.

thanks again