Author Topic: Electronic tutorial: Function Generator  (Read 2518 times)

0 Members and 1 Guest are viewing this topic.

Offline ScarionnTopic starter

  • Contributor
  • Posts: 18
Electronic tutorial: Function Generator
« on: June 17, 2012, 06:18:54 pm »
Hi Dave. I'm thinking why not build a function generator. You always said "A good function generator must have a modulation input" or something like that. So why not build your own function generator. I mean a analog one, with discrete components, a few op amps. Please give it a try.
Bye, have a great day.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16281
  • Country: za
Re: Electronic tutorial: Function Generator
« Reply #1 on: June 17, 2012, 06:26:42 pm »
No market and new/used with much better specs are cheaper as they have volume production. For a cheap FG use a sound card, free up to 15kHz and arbitary waveform generation is there.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Electronic tutorial: Function Generator
« Reply #2 on: June 17, 2012, 08:46:50 pm »
and though you lack a modulation input, its far too easy to grab a stand alone dac module and hook it up with an encoder and lcd to your favorite micro, you get a wide frequency range, minimal issues on edge ringing etc, and you can do arbitary through your micro if your update rate is sufficient,

however modulation is the hard part there, AM is fairly easy, you would just feed your input into a mosfet inline with the amplifier output, or sum into the amplifier op amp, FM though i dont quite know how that would be done,
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: Electronic tutorial: Function Generator
« Reply #3 on: June 18, 2012, 06:27:43 am »
...FM though i dont quite know how that would be done,

FM would be way, way, easy in your system, with a micro and DDS. Here's how it's done. It's not that complex.

According to Wikipedia:

If the baseband data signal (the message) to be transmitted is and the sinusoidal carrier is where fc is the carrier's base frequency and Ac is the carrier's amplitude, the modulator combines the carrier with the baseband data signal to get the transmitted signal:


         
         

In this equation, is the instantaneous frequency of the oscillator. See the wiki article for more details of FM, instantaneous phase, and instantaneous frequency. 

Ultimately, you continuously integrate the incoming signal, multiply it by 2*pi*the frequency delta (FM has a bandwidth delta above and below the center frequency), and add this as an offset to the base frequency to get a new frequency at that point in time).  That new frequency is sent to the DDS, and it changes its output frequency.

So you need an external integrator for the input signal, the micro uses it's ADC, get a digital value for the integrator output, multiplies it by 2*pi*deltaF, and adds it to the center frequency (Fc*2*pi)  All that 2*pi stuff is just to convert frequency in Hz to radians/s.  Internally you'd probably stay in radians.  There's probably some details I missed, and the devil is in the details.

and like I said, a micro + DDS chip is great at this.


« Last Edit: June 18, 2012, 06:29:36 am by codeboy2k »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf