DSPRelated.com
Forums

Question on AM demodulation...

Started by Andre June 13, 2014
On Wed, 18 Jun 2014 18:55:18 -0400, Randy Yates wrote:

> Tim Wescott <tim@seemywebsite.really> writes: >> [...] >> "count all the sign changes, then add in the one you missed". > > What I described isn't a simple sign change. It's a sine change for just > the quadrature components of the signal, i.e., the components that, if > transformed, would lie on the imaginary axis. The other components are > not inverted. > > So you can't fix this by simply inverting the entire signal.
Ah. I see your point. I don't think I've ever had a quadrature-reception system work the first time -- and not because I don't work out the math first and double-check, just because sign changes in the middle of equations has ALWAYS been my bane, from my high school days on. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Tim Wescott <tim@seemywebsite.really> wrote:
> On Wed, 18 Jun 2014 18:01:07 -0400, Randy Yates wrote:
(snip)
>> And who said the application here is audio? I.e., the negation may be a >> show-stopper.
> This reminds me of some advice given me by an old control systems > engineer, about getting a loop right the first time:
> "count all the sign changes, then add in the one you missed".
> He didn't tell me the part about always designing your circuit > so that you could swaps signs with a minimum number of cuts & > jumps -- I had to figure that out on my own.
I remember once in high school physics class, getting three sign errors on one problem. An old saying: "Good physicists make an even number of mistakes." -- glen
On Thu, 19 Jun 2014 03:04:13 +0000 (UTC), glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:

>Tim Wescott <tim@seemywebsite.really> wrote: >> On Wed, 18 Jun 2014 18:01:07 -0400, Randy Yates wrote: >
[Snipped by Lyons]
>I remember once in high school physics class, getting three sign >errors on one problem. > >An old saying: "Good physicists make an even number of mistakes." > >-- glen
Ha ha. Glen, to quote Hannibal Lector (in a quiet, low, growl), "That was good." [-Rick-]
On Wed, 18 Jun 2014 18:01:07 -0400, Randy Yates
<yates@digitalsignallabs.com> wrote:

>Rick Lyons <R.Lyons@_BOGUS_ieee.org> writes: > >> On Fri, 13 Jun 2014 17:39:41 -0500, Tim Wescott >> <tim@seemywebsite.really> wrote: >>
[Snipped by Lyons]
>>> >>>As mentioned, it's e^(-i*w0*t), but that's a nit -- particularly because >>>the operation will still work (why is left as an exercise to the reader). >> >> Hi Tim, >> For normal symmetrial bandpass (commercial) AM, >> yes the e^(-i*w0*t) is a "nit". > >Is it? For x(t) = sin(w_c * t), one demodulation will give you x(t), the >other will give you -x(t). Yes, that's inaudible. Is having all the >quadrature components inaudible? I think, but I'm not sure. > >And who said the application here is audio? I.e., the negation may be a >show-stopper.
Hi Randy, I don't understand what you have in mind here, but I will say that my reply to Tim's post was far too brief. What I had in mind was that with standard broadcast AM, the RF spectrum looks like: * * DSB AM * * ** ** ** ** * * * * * * * * --* * * * *---//-----//---* * * * *-- | | | -wo 0 wo where 'wo' is the RF carrier freq in radians/sec. So. ...complex down-conversion [e^(-i*w0*t)] or complex up-conversion [e^(i*w0*t)] will both translate the RF signal (with symmetrical sidebands) to be centered at 0 rad/sec (0 Hz). But for single sideband AM the RF spectrum looks like: * SSB AM * ** ** * * * * --* *------//-----//------* *-- | | | -wo 0 wo In this SSB case, complex down-conversion [e^(-i*w0*t)] will produce a different result than complex up-conversion [e^(i*w0*t)]. That's what I was thinking. Hey, wait a minute! Why are we using 'i' instead of 'j' in these complex-valued expressions? I can show you in the Bible where God wants us to use 'j', and not 'i'. Anyone who uses 'i' will surely end up in the place of eternal damnation. [-Rick-]
On Fri, 13 Jun 2014 14:22:19 -0400, robert bristow-johnson
<rbj@audioimagination.com> wrote:

>On 6/13/14 9:26 AM, Andre wrote: >> Hi all, >> >> I am a bit stuck in a demodulation thing. >> >> Lets say I have a system that generates an AM signal and >> wants to detect distorsions of the LF signal after feeding >> the AM modulated signal through a potentially nonlinear system. >> >> This means I have phase locked TX and RX. > >well, we normally get phase locking between TX and RX because the >carrier is not suppressed. commercial AM that is not over-modulated is >not quite the same thing as DSB-SC. it is because of this that one can >use a simple rectifier (like the 1N34 i used in a crystal radio 5 >decades ago - sheeesh i'm getting old!) to demodulate the AM.
[Snipped by Lyons] Hi Robert, I was always under the impression that standard commercial broadcast AM transmitted energy at the carrier frequency (therefore it is not DSB-SC). Is that true? (I did a little searching on the web to answer my "Is that true?" question but I failed to find an answer.) [-Rick-] PS. I'm in my 60's. One of my fondest childhood memories was when I had a little (Made in Japan) crystal radio. NO BATTERIES NEEDED!!! It had a wire with an alligator clip that was the antenna, an earphone wire and earphone, and a little metal rod that you pushed in and pulled out to tune tune to different radio stations. (The metal rod was connected to some sort of magnetic rod that moved up & down inside a cylindrical coil of wire. Moving the magnetic rod up & down changed the inductance of the coil and that's how the radio was tuned.
On 6/21/14 11:45 PM, Rick Lyons wrote:
> On Fri, 13 Jun 2014 14:22:19 -0400, robert bristow-johnson > <rbj@audioimagination.com> wrote: > >> On 6/13/14 9:26 AM, Andre wrote: >>> Hi all, >>> >>> I am a bit stuck in a demodulation thing. >>> >>> Lets say I have a system that generates an AM signal and >>> wants to detect distorsions of the LF signal after feeding >>> the AM modulated signal through a potentially nonlinear system. >>> >>> This means I have phase locked TX and RX. >> >> well, we normally get phase locking between TX and RX because the >> carrier is not suppressed. commercial AM that is not over-modulated is >> not quite the same thing as DSB-SC. it is because of this that one can >> use a simple rectifier (like the 1N34 i used in a crystal radio 5 >> decades ago - sheeesh i'm getting old!) to demodulate the AM. > > [Snipped by Lyons] > > Hi Robert, > I was always under the impression that standard > commercial broadcast AM transmitted energy at the > carrier frequency (therefore it is not DSB-SC). > > Is that true? (I did a little searching on the > web to answer my "Is that true?" question but > I failed to find an answer.)
it has to be true. i know so, simply from my ham radio days. how else does 100% modulation or "overmodulation" have meaning? how could a rectifier work for demodulation.
> PS. I'm in my 60's.
i'm nearly there.
> One of my fondest childhood > memories was when I had a little (Made in Japan) > crystal radio. NO BATTERIES NEEDED!!!
me too. mine was a Knight-Kit (we bought it from the Allied Radio catalog). had a 1N34 diode in it, a coil we wound with enameled wire, a small variable capacitor for tuning. i threw out a 100 ft long-wire antenna outside my 2nd-floor bedroom window, obtained a few insulators (used for electric fences, which were common) and fastened the other end to a power pole. my dad had a pair of old headphones from the 40s that were *efficient* (unlike modern stereo music headphones). worked great for the local stations. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Rick Lyons <R.Lyons@_BOGUS_ieee.org> writes:

> On Wed, 18 Jun 2014 18:01:07 -0400, Randy Yates > <yates@digitalsignallabs.com> wrote: > >>Rick Lyons <R.Lyons@_BOGUS_ieee.org> writes: >> >>> On Fri, 13 Jun 2014 17:39:41 -0500, Tim Wescott >>> <tim@seemywebsite.really> wrote: >>> > [Snipped by Lyons] >>>> >>>>As mentioned, it's e^(-i*w0*t), but that's a nit -- particularly because >>>>the operation will still work (why is left as an exercise to the reader). >>> >>> Hi Tim, >>> For normal symmetrial bandpass (commercial) AM, >>> yes the e^(-i*w0*t) is a "nit". >> >>Is it? For x(t) = sin(w_c * t), one demodulation will give you x(t), the >>other will give you -x(t). Yes, that's inaudible. Is having all the >>quadrature components inaudible? I think, but I'm not sure. >> >>And who said the application here is audio? I.e., the negation may be a >>show-stopper. > > Hi Randy, > I don't understand what you have in mind here, but > I will say that my reply to Tim's post was far too > brief. What I had in mind was that with standard > broadcast AM, the RF spectrum looks like: > > > * * DSB AM * * > ** ** ** ** > * * * * * * * * > --* * * * *---//-----//---* * * * *-- > | | | > -wo 0 wo > > where 'wo' is the RF carrier freq in radians/sec. > So. ...complex down-conversion [e^(-i*w0*t)] or > complex up-conversion [e^(i*w0*t)] will both > translate the RF signal (with symmetrical sidebands) > to be centered at 0 rad/sec (0 Hz).
Hi Rick, I presume what you are representing above in the "ascii spectrum" (pretty nice, BTW!) is the magnitude of the original baseband spectrum, shifted up and down by wo. Right? I agree that this is what the spectrum magnitude looks like. However, plotting just the magnitude obscures the detail that is behind my point. Separate out from the magnitude the real and imaginary components and let's discuss those. If we assume we have a real baseband signal r(t), then R(w) = R*(-w), which is that so-called Hermitian symmetry. (I love that term, don't you?) That means that Re(R(w)) = Re(R(-w)) and Im(R(w)) = -Im(R(-w)); In other words, the negative and positive components of the real part of the spectrum of the baseband components can be swapped without changing anything. However, if you swapped the negative and positive components of the imaginary part of the spectrum of the baseband components, you would NOT have the exact same thing; you would have Im(R(w)) = -1 * Im(W(w)), where W(w) is the spectrum of a signal that is identical to R(w) except that the positive and negative components of the imaginary part of the signal have been swapped. And that is precisely the difference between shift the negative component of BANDPASS signal to DC versus shifting the positive component of the BANDPASS signal to DC - the real parts of the spectrum of those two results are identical, but the imaginary parts are negatives of one another. That's why I said sin(wt) would change into -sin(wt), since sin has imaginary spectral components. Shew! That was tought to explain. Did you get it? --Randy
> > But for single sideband AM the RF spectrum looks > like: > > * SSB AM * > ** ** > * * * * > --* *------//-----//------* *-- > | | | > -wo 0 wo > > In this SSB case, complex down-conversion > [e^(-i*w0*t)] will produce a different result > than complex up-conversion [e^(i*w0*t)]. > That's what I was thinking. > > Hey, wait a minute! Why are we using 'i' > instead of 'j' in these complex-valued > expressions? I can show you in the Bible > where God wants us to use 'j', and not 'i'. > Anyone who uses 'i' will surely end up in > the place of eternal damnation. > > [-Rick-]
-- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
On Sun, 22 Jun 2014 00:21:59 -0400, robert bristow-johnson
<rbj@audioimagination.com> wrote:

>On 6/21/14 11:45 PM, Rick Lyons wrote: >> On Fri, 13 Jun 2014 14:22:19 -0400, robert bristow-johnson >> <rbj@audioimagination.com> wrote: >> >>> On 6/13/14 9:26 AM, Andre wrote: >>>> Hi all, >>>> >>>> I am a bit stuck in a demodulation thing. >>>> >>>> Lets say I have a system that generates an AM signal and >>>> wants to detect distorsions of the LF signal after feeding >>>> the AM modulated signal through a potentially nonlinear system. >>>> >>>> This means I have phase locked TX and RX. >>> >>> well, we normally get phase locking between TX and RX because the >>> carrier is not suppressed. commercial AM that is not over-modulated is >>> not quite the same thing as DSB-SC. it is because of this that one can >>> use a simple rectifier (like the 1N34 i used in a crystal radio 5 >>> decades ago - sheeesh i'm getting old!) to demodulate the AM. >> >> [Snipped by Lyons] >> >> Hi Robert, >> I was always under the impression that standard >> commercial broadcast AM transmitted energy at the >> carrier frequency (therefore it is not DSB-SC). >> >> Is that true? (I did a little searching on the >> web to answer my "Is that true?" question but >> I failed to find an answer.) > >it has to be true. i know so, simply from my ham radio days. how else >does 100% modulation or "overmodulation" have meaning? how could a >rectifier work for demodulation.
Definitely true. This is normal AM, where the instantaneous value of the signal modulates the amplitude of the carrier. Witn no signal, the carrier is at 50% amplitude. Positive signal increases the carrier amplitude, and negative decreases it. As you note, if the signal goes too far negative it "breaks through" into overmodulation. (And in the real world, if it goes to far positive it can clip in the RF amps and transmitter.) The simplest way to get supressed carrier is to use a conventional 4-quadrant multiplier in place of the AM (which is a biased 2-quadrant multiplier). Then you have the sum-and-difference components (only!) that we first saw in high-school trig formulas for the product of sinusoids. The classical formula for AM is: sin(carrier) * [1 + Depth * sin(modulator)] But for signal generator applications (not broadcast radio) I prefer: sin (carrier) * [1 - Depth/2 + Depth/2 * sin(modulator)] This makes more intuitive sense (to me, anyway), and is more practical to use. At Depth=0 you get only the carrier, at 100% amplitude. As you increase Depth, the peaks of the modulated waveform still go to 100%, with troughs down to 50%. At 100% Depth the peaks are still the same, with the troughs at 0. So you are always using the full-scale range of your D/A (or transmitter) for maximum dynamic range. As a nice little side benefit, 200% Depth converts this into a simple multiplier for suppressed carrier. <http://www.daqarta.com/dw_aa0d.htm> Best regards, Bob Masta DAQARTA v7.60 Data AcQuisition And Real-Time Analysis www.daqarta.com Scope, Spectrum, Spectrogram, Sound Level Meter Frequency Counter, Pitch Track, Pitch-to-MIDI FREE Signal Generator, DaqMusiq generator Science with your sound card!
Dear all,

thanks for all the feedback, that was much more than expected!!!

Just to add some light on what I am doing:
I want to detect a "second source" that will add to my signal
at the same frequency, and depends on its amplitude with some
nonlinear function.

To separate the added signal from my original signal (which are
both audio signals), I thought to modulate the transmitted signal
by just a pure sine and look for overtones of this modulation
in the recorded signal.

However, it does not seem to work as easy as I thought.

best regards,

Andre



On 14.06.2014 00:39, Tim Wescott wrote:
> On Fri, 13 Jun 2014 15:26:22 +0200, Andre wrote: > >> Hi all, >> >> I am a bit stuck in a demodulation thing. >> >> Lets say I have a system that generates an AM signal and wants to detect >> distorsions of the LF signal after feeding the AM modulated signal >> through a potentially nonlinear system. >> >> This means I have phase locked TX and RX. > > How so? AM has never required phase locking -- the TX can free run, and > the RX can do envelope detection. > >> Lets say I modulate a signal at f0 with sine at f1 with 100% modulation: >> >> signal = sin(w0*t) * (0.5 + 0.5 * sin(w1*t)) >> >> I then receive this signal and downmix it by multiplying with sin and >> cos of the carrier frequency, in complex writing: >> >> baseband = received_signal * e^(i*w0*t) > > As mentioned, it's e^(-i*w0*t), but that's a nit -- particularly because > the operation will still work (why is left as an exercise to the reader). > > For that matter, if the receiver really is phase locked, then you only > need to down-convert with sin(w0*t). > >> I have then a complex baseband signal, in which I expect sidebands at +- >> f1. > > Again, as mentioned, you're neglecting the signal at 2*f0 here, which one > would usually filter out. > >> Lets say I am after the overtones of that f1 in the complex baseband >> signal. For example, I want to detect components at +-f2 with f2 = 2*f1. >> >> Can I not just multiply the complex baseband signal with e^(i*w2*t) to >> get the (compelex)component at f2? >> Like: >> >> what_i_look_for = baseband * e^(i*w2*t) > > You could, yes. That'll only yet you the second harmonic of the > fundamental, though -- it'll miss the third, fourth, etc. > >> Or do I miss some conjugate etc? >> >> As said above, everything is phase locked, so I do not need to recover >> any phase. > > I don't know if your "everything is phase locked" statement comes from > naivet&eacute; or from some system feature you're not sharing with us, but in > conventional AM reception you _do_ need to recover phase, usually via a > PLL, or you do envelope detection and stay blithely unaware of phase. >
Rick Lyons <R.Lyons@_BOGUS_ieee.org> writes:

> On Wed, 18 Jun 2014 18:01:07 -0400, Randy Yates > <yates@digitalsignallabs.com> wrote: > >>Rick Lyons <R.Lyons@_BOGUS_ieee.org> writes: >> >>> On Fri, 13 Jun 2014 17:39:41 -0500, Tim Wescott >>> <tim@seemywebsite.really> wrote: >>> > [Snipped by Lyons] >>>> >>>>As mentioned, it's e^(-i*w0*t), but that's a nit -- particularly because >>>>the operation will still work (why is left as an exercise to the reader). >>> >>> Hi Tim, >>> For normal symmetrial bandpass (commercial) AM, >>> yes the e^(-i*w0*t) is a "nit". >> >>Is it? For x(t) = sin(w_c * t), one demodulation will give you x(t), the >>other will give you -x(t). Yes, that's inaudible. Is having all the >>quadrature components inaudible? I think, but I'm not sure. >> >>And who said the application here is audio? I.e., the negation may be a >>show-stopper. > > Hi Randy, > I don't understand what you have in mind here, but > I will say that my reply to Tim's post was far too > brief. What I had in mind was that with standard > broadcast AM, the RF spectrum looks like: > > > * * DSB AM * * > ** ** ** ** > * * * * * * * * > --* * * * *---//-----//---* * * * *-- > | | | > -wo 0 wo > > where 'wo' is the RF carrier freq in radians/sec.
> SO. ...COMPLEX DOWN-CONVERSION [E^(-I*W0*T)] OR > COMPLEX UP-CONVERSION [E^(I*W0*T)] WILL BOTH > TRANSLATE THE RF SIGNAL (WITH SYMMETRICAL SIDEBANDS) > TO BE CENTERED AT 0 RAD/SEC (0 HZ).
(emphasis mine) Rick, let me be a little more critical. Yes, both will "translate" the RF signal to be centered at 0 rad/sec, but you do NOT get exactly the same thing at baseband in each case. Do you agree? -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com