Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

Generate sine wave and triangular with Megafunction

Hi everybody!

I wonder if you can make a sine and triangle wave generator using mega unctions, if so hopefully I can guide on how to do it please.

Greetings

Edgardo

9 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    the NCO core will generate sine waves. triangle waves are probably best done in code, its not much more than an accumulator.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Why only megafunctions?

    What is the sine wave/triangle wave used for? Will you use a DA converter for making the analog signal? What is the maximum frequency?

    Stefaan
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I need to generate a sine wave of 50 Hz and a two triangular carriers of about 1.5 kHz to drive inverters. These waves must be compared and will drive the IGBT with the inverter, this is essentially what I need to do.

    Greetings from Chile

    PS: sorry for writing, but I'm using a translator to write the text.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Here is a more complete example of the NCO code, I mentioned in your previous thread. I have used e. g. for 16,7/50 Hz inverter.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I need to generate a sine wave of 50 Hz and a two triangular carriers of about 1.5 kHz to drive inverters. These waves must be compared and will drive the IGBT with the inverter, this is essentially what I need to do.

    --- Quote End ---

    If you take it a step further, and do the comparison in the logic chip, you need only to output some digital signals that can be used as input for your IGBT-gate-driver chips. If you have the logic available, it can save you some analog chips and hassle.

    STefaan
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    as in megafunction make sure my sine wave is 50 Hz and algorithm I should use in this case

    Large ROM

    Small ROM

    CORDIC

    Multiplier Based

    I need your help friends, I need guidance.

    Greetings

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    the different NCO methods have different trade offs as far as resources used (RAM, logic, multipliers). they are explained on page 34 of the NCO User Guide. or you could look at the resource estimation tab in the MegaWizard.

    http://www.altera.com/literature/ug/ug_nco.pdf

    in your case i would choose multiplier-based if you have some available.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I need to generate a sine wave of 50 Hz and a triangular carrier (2 kHz) to drive inverters using Quartus II and Cyclone II device. These waves must be compared and will drive the IGBT with the inverter , this is essentially what I need to do.