Forum Discussion

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

Confirmation about sine wave equation of NCO IP Core

I tried plotting the following sine wave equation from page 3-1 of NCO IP Core User Guide v14.1 into an excel file.

s(nT) = Asin[2π(fO+ fFM)nT+ ϕPM+ ϕDITH)]

I also generated the waveform using the same settings in the NCO IP Core.

Based on the result, I think that "A = (2^N) - 1" should be "A = ((2^N)/2)-1".

Is my understanding correct?

Thanks!

4 Replies

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

    A is amplitude and so you can choose any value up to a mximum. e.g. for N = 16 bits signed the maximum magnitude is 2^15 -1 = 32767

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

    Thanks!

    But what I am trying to say is that it seems that the Altera NCO Time domain graph always results to half of the value of the sine wave equation from page 3-1 of NCO IP Core User Guide when I tried to plot it in excel.

    Am I missing something on this? I'm confused because I expected the two to be the same since it is said in the user guide that the generated sine wave by the NCO IP Core is defined by the equation s(nT) = Asin[2π(fO+ fFM)nT+ ϕPM+ ϕDITH)].

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

    Section 3-1 defines N as the "magnitude precision," and with that definition it is more or less correct if you consider that magnitude is separate from the sign. An M-bit 2's complement sample has a maximum range of -2^N - +(2^N)-1, where N is M-1. However the UG is not entirely consistent because later on the value M refers to all bits of the output, including sign, and they still call it "magnitude precision."

    The take-away is that the core will give you a full-amplitude signal, no bits are wasted, so you have to use a bit of thought and not take the UG too literally.

    My $0.02 anyway.

    -Fred