Connect with us

mixing sampled sine waves

Discussion in 'Electronic Basics' started by viswanath, May 11, 2004.

Scroll to continue with content
  1. viswanath

    viswanath Guest

    I have a question regarding mixing discrete sine waves. If you have
    two sine waves sin(w1*t) and sin(w2*t) and they are sampled at the
    same rate. If you are mixing them in a receiver operation, we are
    supposed to get at the output of the mixer the sum and difference of
    frequencies. But it is just the values that we are multiplying isn't
    it, at the sampled time instants?
    How do we end up getting a difference frequencies and sum frequencies
    which have to be low pass filtered?
    I have read from trigonometry and analog communications but somehow I
    am missing some essence here. Could you please let me know how the
    above is possible?
    I would greatly appreciate a response.
  2. In most mixers, the two frequencies are not sampled, but simply
    multiplied on a continuous basis (or the signum of one is multiplied
    times the other). Multiplication is a nonlinear process (unlike
    addition) so new components appear. The trig identity for the product
    of two sine waves is:

    So I don't follow your mention of sampling in this context.
  3. Bob Masta

    Bob Masta Guest

    It turns out this works exactly the same as for continuous waves.
    This is essentially what is done in an FFT analysis, where you
    effectively are multiplying the input signal by the sine and cosine
    of each frequency you want to measure. If you were to work
    through the multiplication of the sampled values, you'd find
    that they perform just as you might expect from the continuous
    formulas for products of sinusoids.

    I've got some tutorials on this at

    Hope this helps!

    Bob Masta

    D A Q A R T A
    Data AcQuisition And Real-Time Analysis
  4. Hi Bob,

    I saw your site earlier also, but never came across those interesting

    I read first part and appreciated it a lot, you started from where
    books usually stop.

    Concepts of imaginary plane and negative frequencies always baffles me
    a lot, infact everything goes in imaginary mind, round and round and

    I hope after complete reading a learner like me will get benefited to
    really handle those real world problem.

    Please put on the source code of those crisp plot, so the reader can
    tweak it to learn more, are those MATLAB one.


    Best regards,
    Animesh Maurya
  5. Bob Masta

    Bob Masta Guest

    Note that I avoided the imaginary plane stuff. This is an unneeded
    complication when you are trying to understand what is really
    going on, although it has a certain charm for the mathematically
    inclined. My own casual experience is that many people who
    appear to have mastered the imaginary math and integrals don't
    really have a clue what is actually going on at the level of "doing
    the work". I recall having a gentle debate with a physicist who
    seemed to think that FFTs actually used e to imaginary powers
    in the computation!
    No source code. All plots are from Daqarta for DOS, which
    you can download for free. If you use only the DEMO.ADC
    driver instead of a sound card, there is no time limit or
    registration required. You can use the built-in STIM3A
    signal generator to try different test signals and see what
    their waveforms, spectra, spectrograms, histograms, etc
    look like. I've tried to include a fair amount of tutorial
    info in the built-in Help system.

    Note, however, that Daqarta for DOS runs only in
    real-mode DOS, so you need Win9x or earlier...
    not NT, 2K, XP, etc.

    You can also download DaqGen for Windows,
    which is freeware. This is like an enhanced STIM3A
    signal generator that works with any Windows sound
    card, and also includes waveform and
    spectrum displays. The next version (in a week or two,
    hopefully) will include signal averaging and histograms.
    Eventually (several months) Daqarta for Windows
    will include this functionality as a subset, and will
    allow analysis of inputs as well, just like Daqarta for DOS.

    Hope this helps!

    Bob Masta

    D A Q A R T A
    Data AcQuisition And Real-Time Analysis
  6. Rich Grise

    Rich Grise Guest

    I disagree. It helped me immensely to understand what is going on,
    especially when talking about phase. The sine and cosine plot nicely
    on a polar coordinate plane, and you can draw an impedance with a
    line segment at an angle. So when you put an AC signal on a pure
    resistance, the point in question just bounces back and forth on
    the X axis, but if there's reactance, there's an up-and-down
    component. And to visualize the time domain, just imagine a dot
    moving around in a circle, or maybe an ellipse, if it's nonlinear
    or something.

    At least, that helped me.

    Good Luck
  7. (Bob Masta) wrote in message
    Thanks for those encouraging words.

    Bob, once you told me that your software works only with ISA sound
    card, so did you fixed your software to work with PCI sound cards this
    time, just want to know from you? I should check your too.

    Best regards,
    Animesh Maurya
  8. Bob Masta

    Bob Masta Guest

    DaqGen is a true Windows program, so it doesn't care whether the
    sound card is ISA or PCI, as long as it has a Windows driver (as all
    sound cards do these days!). The same for Daqarta for Windows,
    when released.

    The problem with Daqarta for DOS is that there are no standards for
    DOS sound drivers, so I had to write everything from scratch. That
    typically took weeks for each sound card family, considering that
    manufacturer's were less than forthcoming with thier documentation.
    That's why I only supported a few sound card families.


    Bob Masta

    D A Q A R T A
    Data AcQuisition And Real-Time Analysis
  9. Bob Masta

    Bob Masta Guest

    My focus was more on understanding what actually
    goes on in an FFT. The real/imaginary treatment
    doesn't lead (for me, anyway) to an intuitive grasp
    of the mechanics, which use sine/cosine multiplication.
    It's not obvious to newcomers how to go from the
    texbook's complex FFT representation to real hardware
    or software, but in fact the actual mechanics involve
    nothing more than the "product of sinusoids" formulas
    you got in high school.


    Bob Masta

    D A Q A R T A
    Data AcQuisition And Real-Time Analysis
  10. Rich Grise

    Rich Grise Guest

    Apparently, I was answering the wrong question. :)

    Yeah, a polar diagram probably doens't help much with FT;
    but for that I found that just a plot kinda helps. And,
    of course, when I asked someone more knowledgeable than
    I how the sidebands of an FM signal are _only_ at the
    harmonics of the modulating waveform, he said, "It's the
    Fourier Transform." Which kinda wrapped it up for me.

  11. viswanath

    viswanath Guest

    Thanks everyone for the replies.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day