DSPRelated.com
Forums

Spectral Purity Measurement

Started by rickman December 19, 2014
On Sun, 21 Dec 2014 14:52:40 -0500, robert bristow-johnson
<rbj@audioimagination.com> wrote:

>On 12/19/14 11:04 PM, Eric Jacobsen wrote: >> On Fri, 19 Dec 2014 18:19:24 -0500, robert bristow-johnson >> <rbj@audioimagination.com> wrote: >> >>> On 12/19/14 10:06 AM, rickman wrote: >>>> I want to analyze the output of a DDS circuit and am wondering if an FFT >>>> is the best way to do this. I'm mainly concerned with the "close in" >>>> spurs that are often generated by a DDS. >>> >>> i still get the concepts of DDS and NCO mixed up. what are the differences? >> >> One is spelled DDS and the other is spelled NCO. > >is the NCO the typical table-lookup kind (with phase accumulator)? or >can it be algorithmic? like > > y[n] = (2*cos(omega_0))*y[n-1] - y[n-2] > >where omega_0 is the normalized angular frequency of the sinusoid and >with appropriate initial states, y[-1] and y[-2] to result in the >amplitude and initial phase desired. > >is that an NCO that can be used in this DDS? or must it be LUT?
Generally NCO or DDS refers to a phase accumulator with a LUT, since it is easily implemented in hardware. That's a general architecture that is well-known and can be adjusted to produce very clean local oscillators. If somebody tried to sell me a block of IP with an "NCO" built some other way I'd be asking a lot of questions.
>anyway, in either case, the oscillator frequency is well defined and i >don't understand why rickman would just put in a simple sharp notch >filter tuned to the very same frequency and whack the sinusoid and >analyze (however he does) what is residual.
It could be because the phase accumulator/LUT architecture is general and the range of operation of the output frequency is pretty broad. A more generalized test approach is more flexible to testing over a broader range of outputs. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
On 12/21/2014 7:13 PM, Eric Jacobsen wrote:
> On Sun, 21 Dec 2014 14:52:40 -0500, robert bristow-johnson > <rbj@audioimagination.com> wrote: > >> On 12/19/14 11:04 PM, Eric Jacobsen wrote: >>> On Fri, 19 Dec 2014 18:19:24 -0500, robert bristow-johnson >>> <rbj@audioimagination.com> wrote: >>> >>>> On 12/19/14 10:06 AM, rickman wrote: >>>>> I want to analyze the output of a DDS circuit and am wondering if an FFT >>>>> is the best way to do this. I'm mainly concerned with the "close in" >>>>> spurs that are often generated by a DDS. >>>> >>>> i still get the concepts of DDS and NCO mixed up. what are the differences? >>> >>> One is spelled DDS and the other is spelled NCO. >> >> is the NCO the typical table-lookup kind (with phase accumulator)? or >> can it be algorithmic? like >> >> y[n] = (2*cos(omega_0))*y[n-1] - y[n-2] >> >> where omega_0 is the normalized angular frequency of the sinusoid and >> with appropriate initial states, y[-1] and y[-2] to result in the >> amplitude and initial phase desired. >> >> is that an NCO that can be used in this DDS? or must it be LUT? > > Generally NCO or DDS refers to a phase accumulator with a LUT, since > it is easily implemented in hardware. That's a general architecture > that is well-known and can be adjusted to produce very clean local > oscillators. If somebody tried to sell me a block of IP with an > "NCO" built some other way I'd be asking a lot of questions.
Actually this started with a discussion is s.e.d about how bad the spurs are with a typical DDS and how to mitigate them. That made me dig up my memory of designing a DDS a few years back as part of a test set. It didn't need to be anything special, but for grins I took a look at what could be done in a rather small FPGA for audio frequencies. I considered linear interpolation which gets around the close in spurs from phase truncation (seems to be the major objection to using a DDS) and with even a smallish LUT of 256 entries I get about 18 bit accuracy in the sine values. With a 1024 entry table the accuracy is more than 10 times better or around 21 bits. Of course quantization error will add to that, but this allows the close in spurs to be *much* smaller than with straight LUTs.
>> anyway, in either case, the oscillator frequency is well defined and i >> don't understand why rickman would just put in a simple sharp notch >> filter tuned to the very same frequency and whack the sinusoid and >> analyze (however he does) what is residual. > > It could be because the phase accumulator/LUT architecture is general > and the range of operation of the output frequency is pretty broad. > A more generalized test approach is more flexible to testing over a > broader range of outputs.
I'm not sure I understand the question, notwithstanding the grammar error. I think Robert meant "i don't understand why rickman >>wouldn't<< just put in"... I don't know why I wouldn't do that either. I am here asking what would be the best way. I seem to remember something similar being done in a digital receiver test. A carrier is applied to the analog input and in the digital domain (somewhere) a notch filter is used to drop out the carrier leaving most of the artifacts. It's all very fuzzy at this point. I think they also used a two tone test which shows the effects of inter-modulation products, a real concern with real signals. -- Rick
Hi,

>> *much* smaller than with straight LUTs.
I guess a polynomial (spline) could be more accurate. Higher order usually beats more points. I've done a similar exercise for 18 bit fractional accuracy: http://www.dsprelated.com/showarticle/594.php The output bit width can be increased easily. _____________________________ Posted through www.DSPRelated.com
On Sun, 21 Dec 2014 19:30:48 -0500, rickman <gnuarm@gmail.com> wrote:

>On 12/21/2014 7:13 PM, Eric Jacobsen wrote: >> On Sun, 21 Dec 2014 14:52:40 -0500, robert bristow-johnson >> <rbj@audioimagination.com> wrote: >> >>> On 12/19/14 11:04 PM, Eric Jacobsen wrote: >>>> On Fri, 19 Dec 2014 18:19:24 -0500, robert bristow-johnson >>>> <rbj@audioimagination.com> wrote: >>>> >>>>> On 12/19/14 10:06 AM, rickman wrote: >>>>>> I want to analyze the output of a DDS circuit and am wondering if an FFT >>>>>> is the best way to do this. I'm mainly concerned with the "close in" >>>>>> spurs that are often generated by a DDS. >>>>> >>>>> i still get the concepts of DDS and NCO mixed up. what are the differences? >>>> >>>> One is spelled DDS and the other is spelled NCO. >>> >>> is the NCO the typical table-lookup kind (with phase accumulator)? or >>> can it be algorithmic? like >>> >>> y[n] = (2*cos(omega_0))*y[n-1] - y[n-2] >>> >>> where omega_0 is the normalized angular frequency of the sinusoid and >>> with appropriate initial states, y[-1] and y[-2] to result in the >>> amplitude and initial phase desired. >>> >>> is that an NCO that can be used in this DDS? or must it be LUT? >> >> Generally NCO or DDS refers to a phase accumulator with a LUT, since >> it is easily implemented in hardware. That's a general architecture >> that is well-known and can be adjusted to produce very clean local >> oscillators. If somebody tried to sell me a block of IP with an >> "NCO" built some other way I'd be asking a lot of questions. > >Actually this started with a discussion is s.e.d about how bad the spurs >are with a typical DDS and how to mitigate them. That made me dig up my >memory of designing a DDS a few years back as part of a test set. It >didn't need to be anything special, but for grins I took a look at what >could be done in a rather small FPGA for audio frequencies. I >considered linear interpolation which gets around the close in spurs >from phase truncation (seems to be the major objection to using a DDS) >and with even a smallish LUT of 256 entries I get about 18 bit accuracy >in the sine values. With a 1024 entry table the accuracy is more than >10 times better or around 21 bits. > >Of course quantization error will add to that, but this allows the close >in spurs to be *much* smaller than with straight LUTs. > > >>> anyway, in either case, the oscillator frequency is well defined and i >>> don't understand why rickman would just put in a simple sharp notch >>> filter tuned to the very same frequency and whack the sinusoid and >>> analyze (however he does) what is residual. >> >> It could be because the phase accumulator/LUT architecture is general >> and the range of operation of the output frequency is pretty broad. >> A more generalized test approach is more flexible to testing over a >> broader range of outputs. > >I'm not sure I understand the question, notwithstanding the grammar >error. I think Robert meant "i don't understand why rickman > >>wouldn't<< just put in"... > >I don't know why I wouldn't do that either. I am here asking what would >be the best way. > >I seem to remember something similar being done in a digital receiver >test. A carrier is applied to the analog input and in the digital >domain (somewhere) a notch filter is used to drop out the carrier >leaving most of the artifacts. It's all very fuzzy at this point. I >think they also used a two tone test which shows the effects of >inter-modulation products, a real concern with real signals. > >-- > >Rick
Do a web search on "Analog Devices DDS", and in the first few entries you should find links to some white papers that are good on details of DDS architecture and analysis. Also, Qualcomm's "Synthesizer Products Data Book" is also very good. Some of those documents are from the 90s, and there are other public docs out there that go into more detail on spur mitigation and analysis, but these are good references. BTW, Qualcomm was a leader in supplying stand-alone silicon DDS products, which were called by the name DDS, even though they didn't have an integrated DAC. Back then mixed-signal products weren't really available. For implementations where memory is very constrained, like potentially in an FPGA, the phase resolution in the LUT can be increased 4x by only storing a quarter of the wave. We've done this in the past with good results. DDS implementations can sometimes also benefit from dithering, at the outputs of both the phase accumulator and the LUT, although the usual tradeoffs apply. There are a number of tricks that have been learned over the years, and many are application dependent. e.g., different tricks may apply for generating a low-jitter clock than generating a local oscillator. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
On 12/21/2014 5:13 PM, Eric Jacobsen wrote:
> On Sun, 21 Dec 2014 14:52:40 -0500, robert bristow-johnson > <rbj@audioimagination.com> wrote: > >> On 12/19/14 11:04 PM, Eric Jacobsen wrote: >>> On Fri, 19 Dec 2014 18:19:24 -0500, robert bristow-johnson >>> <rbj@audioimagination.com> wrote: >>> >>>> On 12/19/14 10:06 AM, rickman wrote: >>>>> I want to analyze the output of a DDS circuit and am wondering if an FFT >>>>> is the best way to do this. I'm mainly concerned with the "close in" >>>>> spurs that are often generated by a DDS. >>>> >>>> i still get the concepts of DDS and NCO mixed up. what are the differences? >>> >>> One is spelled DDS and the other is spelled NCO. >> >> is the NCO the typical table-lookup kind (with phase accumulator)? or >> can it be algorithmic? like >> >> y[n] = (2*cos(omega_0))*y[n-1] - y[n-2] >> >> where omega_0 is the normalized angular frequency of the sinusoid and >> with appropriate initial states, y[-1] and y[-2] to result in the >> amplitude and initial phase desired. >> >> is that an NCO that can be used in this DDS? or must it be LUT? > > Generally NCO or DDS refers to a phase accumulator with a LUT, since > it is easily implemented in hardware. That's a general architecture > that is well-known and can be adjusted to produce very clean local > oscillators. If somebody tried to sell me a block of IP with an > "NCO" built some other way I'd be asking a lot of questions.
I have built NCOs using CORDIC rotators. No lookup tables. They pipeline nicely and are therefore very fast, they require no multipliers [1], they generate quadrature outputs for free, they can perform frequency translations for free (again no multipliers), and they are simple prove numerical accuracy. [1] Maybe not a huge issue these days. The LUT-based NCOs requires two multipliers to combine the coarse and fine LUTs (four multipliers if you need a complex NCO output) and perhaps another four multipliers if you need to do a frequency translation. Rob.
>> anyway, in either case, the oscillator frequency is well defined and i >> don't understand why rickman would just put in a simple sharp notch >> filter tuned to the very same frequency and whack the sinusoid and >> analyze (however he does) what is residual. > > It could be because the phase accumulator/LUT architecture is general > and the range of operation of the output frequency is pretty broad. > A more generalized test approach is more flexible to testing over a > broader range of outputs. > > > Eric Jacobsen > Anchor Hill Communications > http://www.anchorhill.com >
On 12/21/14 7:30 PM, rickman wrote:
> On 12/21/2014 7:13 PM, Eric Jacobsen wrote: >> On Sun, 21 Dec 2014 14:52:40 -0500, robert bristow-johnson >> <rbj@audioimagination.com> wrote: >>
...
>>> anyway, in either case, the oscillator frequency is well defined and i >>> don't understand why rickman would just put in a simple sharp notch >>> filter tuned to the very same frequency and whack the sinusoid and >>> analyze (however he does) what is residual. >> >> It could be because the phase accumulator/LUT architecture is general >> and the range of operation of the output frequency is pretty broad. >> A more generalized test approach is more flexible to testing over a >> broader range of outputs. > > I'm not sure I understand the question, notwithstanding the grammar > error. I think Robert meant "i don't understand why rickman >>wouldn't<< > just put in"...
abstively correct. i often suffer from the "Wicked Bible" syndrome.
> I don't know why I wouldn't do that either. I am here asking what would > be the best way. > > I seem to remember something similar being done in a digital receiver > test. A carrier is applied to the analog input and in the digital domain > (somewhere) a notch filter is used to drop out the carrier leaving most > of the artifacts. It's all very fuzzy at this point. I think they also > used a two tone test which shows the effects of inter-modulation > products, a real concern with real signals.
okay, let's say that you have N points in your LUT. (if N is a power of two, the table wrap-around is trivial.) and let's say that there is a single cycle of a sine function in that LUT. and let's say your sample rate is Fs. the phase increment for a frequency of f0 would be phase_increment = N*(f0/Fs) every sample the phase is incremented: phase[n] = (phase[n-1] + phase_increment)modulo_N and phase[n] is divided into its integer part that tells you where to go in your LUT and a fractional part that tells you how you might interpolate. integer_part = floor(phase[n]) fractional_part = phase[n] - integer_part if you're doing no interpolation the waveform output is x[n] = LUT[integer_part] if you're doing linear interpolation the waveform output is x[n] = LUT[integer_part] + fractional_part*(LUT[integer_part+1] - LUT[integer_part]) just make sure you have an extra point at the end of your LUT that is the same as the zeroth point: LUT[N] = LUT[0] now, using that very same f0 and Fs and some Q or BW that you'll have to decide (make the BW sorta tight), then implement a very simple biquad notch filter: y[n] = b0*x[n] + b1*x[n-1] + b2*x[n-2] - a1*y[n-1] - a2*y[n-2] where b0 = b2 = 1/( 1 + sin(w0)/(2Q) ) b1 = a1 = -2*cos(w0)/(1 + sin(w0)/(2Q)) a2 = ( 1 - sin(w0)/(2Q) )/( 1 + sin(w0)/(2Q) ) and w0 = 2*pi*f0/Fs 1/Q = 2*sinh( ln(2)/2 * BW * w0/sin(w0) ) (BW in octaves) straight outa da cookbook. whatever comes out at y[n] is whatever is impure in your sinusoidal output. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On Monday, December 22, 2014 5:17:30 PM UTC-5, Rob Doyle wrote:
> On 12/21/2014 5:13 PM, Eric Jacobsen wrote: > > On Sun, 21 Dec 2014 14:52:40 -0500, robert bristow-johnson > > <rbj@audioimagination.com> wrote: > > > >> On 12/19/14 11:04 PM, Eric Jacobsen wrote: > >>> On Fri, 19 Dec 2014 18:19:24 -0500, robert bristow-johnson > >>> <rbj@audioimagination.com> wrote: > >>> > >>>> On 12/19/14 10:06 AM, rickman wrote: > >>>>> I want to analyze the output of a DDS circuit and am wondering if an FFT > >>>>> is the best way to do this. I'm mainly concerned with the "close in" > >>>>> spurs that are often generated by a DDS. > >>>> > >>>> i still get the concepts of DDS and NCO mixed up. what are the differences? > >>> > >>> One is spelled DDS and the other is spelled NCO. > >> > >> is the NCO the typical table-lookup kind (with phase accumulator)? or > >> can it be algorithmic? like > >> > >> y[n] = (2*cos(omega_0))*y[n-1] - y[n-2] > >> > >> where omega_0 is the normalized angular frequency of the sinusoid and > >> with appropriate initial states, y[-1] and y[-2] to result in the > >> amplitude and initial phase desired. > >> > >> is that an NCO that can be used in this DDS? or must it be LUT? > > > > Generally NCO or DDS refers to a phase accumulator with a LUT, since > > it is easily implemented in hardware. That's a general architecture > > that is well-known and can be adjusted to produce very clean local > > oscillators. If somebody tried to sell me a block of IP with an > > "NCO" built some other way I'd be asking a lot of questions. > > I have built NCOs using CORDIC rotators. No lookup tables. They pipeline > nicely and are therefore very fast, they require no multipliers [1], > they generate quadrature outputs for free, they can perform frequency > translations for free (again no multipliers), and they are simple prove > numerical accuracy. > > [1] Maybe not a huge issue these days. The LUT-based NCOs requires two > multipliers to combine the coarse and fine LUTs (four multipliers if you > need a complex NCO output) and perhaps another four multipliers if you > need to do a frequency translation. > > Rob. > > >> anyway, in either case, the oscillator frequency is well defined and i > >> don't understand why rickman would just put in a simple sharp notch > >> filter tuned to the very same frequency and whack the sinusoid and > >> analyze (however he does) what is residual. > > > > It could be because the phase accumulator/LUT architecture is general > > and the range of operation of the output frequency is pretty broad. > > A more generalized test approach is more flexible to testing over a > > broader range of outputs.
By fine and coarse LUTS, I assume you are referring to a linear interpolation? That is what I did in a design working at audio rates. With the data being shifted serially I was able to perform a step and add multiply as the prior sample was being shifted out. The analysis I did (although a bit off the cuff) indicates the spurs are minimal, -120 dBc ballpark depending on the exact details of word size and table sizes. Any idea of the spurs for a CORDIC technique? Rick
On 12/22/2014 8:57 PM, rickman wrote:
> On Monday, December 22, 2014 5:17:30 PM UTC-5, Rob Doyle wrote: >> On 12/21/2014 5:13 PM, Eric Jacobsen wrote: >>> On Sun, 21 Dec 2014 14:52:40 -0500, robert bristow-johnson >>> <rbj@audioimagination.com> wrote: >>> >>>> On 12/19/14 11:04 PM, Eric Jacobsen wrote: >>>>> On Fri, 19 Dec 2014 18:19:24 -0500, robert bristow-johnson >>>>> <rbj@audioimagination.com> wrote: >>>>> >>>>>> On 12/19/14 10:06 AM, rickman wrote: >>>>>>> I want to analyze the output of a DDS circuit and am wondering if an FFT >>>>>>> is the best way to do this. I'm mainly concerned with the "close in" >>>>>>> spurs that are often generated by a DDS. >>>>>> >>>>>> i still get the concepts of DDS and NCO mixed up. what are the differences? >>>>> >>>>> One is spelled DDS and the other is spelled NCO. >>>> >>>> is the NCO the typical table-lookup kind (with phase accumulator)? or >>>> can it be algorithmic? like >>>> >>>> y[n] = (2*cos(omega_0))*y[n-1] - y[n-2] >>>> >>>> where omega_0 is the normalized angular frequency of the sinusoid and >>>> with appropriate initial states, y[-1] and y[-2] to result in the >>>> amplitude and initial phase desired. >>>> >>>> is that an NCO that can be used in this DDS? or must it be LUT? >>> >>> Generally NCO or DDS refers to a phase accumulator with a LUT, since >>> it is easily implemented in hardware. That's a general architecture >>> that is well-known and can be adjusted to produce very clean local >>> oscillators. If somebody tried to sell me a block of IP with an >>> "NCO" built some other way I'd be asking a lot of questions. >> >> I have built NCOs using CORDIC rotators. No lookup tables. They pipeline >> nicely and are therefore very fast, they require no multipliers [1], >> they generate quadrature outputs for free, they can perform frequency >> translations for free (again no multipliers), and they are simple prove >> numerical accuracy. >> >> [1] Maybe not a huge issue these days. The LUT-based NCOs requires two >> multipliers to combine the coarse and fine LUTs (four multipliers if you >> need a complex NCO output) and perhaps another four multipliers if you >> need to do a frequency translation. >> >> Rob. >> >>>> anyway, in either case, the oscillator frequency is well defined and i >>>> don't understand why rickman would just put in a simple sharp notch >>>> filter tuned to the very same frequency and whack the sinusoid and >>>> analyze (however he does) what is residual. >>> >>> It could be because the phase accumulator/LUT architecture is general >>> and the range of operation of the output frequency is pretty broad. >>> A more generalized test approach is more flexible to testing over a >>> broader range of outputs. > > By fine and coarse LUTS, I assume you are referring to a linear > interpolation? That is what I did in a design working at audio > rates. With the data being shifted serially I was able to perform a > step and add multiply as the prior sample was being shifted out.
Not linear interpolation. Simple trig identities. cos(u+v) = cos(u)cos(v) - sin(u)sin(v) where u is the coarse phase and v is the fine phase. You can get whatever accuracy you want using more and more cascaded lookup tables with finer and finer phase resolution.
> Any idea of the spurs for a CORDIC technique?
As you mentioned previously, there are two sources of spurs - phase truncation and amplitude truncation. You don't want the phase truncation to dominate the spurs - it is so inexpensive to remedy. The CORDIC will give you 1 bit of accuracy per iteration - i.e., the numerical error is cut in half with each iteration. This corresponds to 6dB spurious reduction per iteration (assuming no phase truncation). -120 dBc spurious requires 20 iterations. More or less. Rob.
On 12/23/2014 1:20 AM, Rob Doyle wrote:
> On 12/22/2014 8:57 PM, rickman wrote: >> On Monday, December 22, 2014 5:17:30 PM UTC-5, Rob Doyle wrote: >>> On 12/21/2014 5:13 PM, Eric Jacobsen wrote: >>>> On Sun, 21 Dec 2014 14:52:40 -0500, robert bristow-johnson >>>> <rbj@audioimagination.com> wrote: >>>> >>>>> On 12/19/14 11:04 PM, Eric Jacobsen wrote: >>>>>> On Fri, 19 Dec 2014 18:19:24 -0500, robert bristow-johnson >>>>>> <rbj@audioimagination.com> wrote: >>>>>> >>>>>>> On 12/19/14 10:06 AM, rickman wrote: >>>>>>>> I want to analyze the output of a DDS circuit and am wondering >>>>>>>> if an FFT >>>>>>>> is the best way to do this. I'm mainly concerned with the "close >>>>>>>> in" >>>>>>>> spurs that are often generated by a DDS. >>>>>>> >>>>>>> i still get the concepts of DDS and NCO mixed up. what are the >>>>>>> differences? >>>>>> >>>>>> One is spelled DDS and the other is spelled NCO. >>>>> >>>>> is the NCO the typical table-lookup kind (with phase accumulator)? or >>>>> can it be algorithmic? like >>>>> >>>>> y[n] = (2*cos(omega_0))*y[n-1] - y[n-2] >>>>> >>>>> where omega_0 is the normalized angular frequency of the sinusoid and >>>>> with appropriate initial states, y[-1] and y[-2] to result in the >>>>> amplitude and initial phase desired. >>>>> >>>>> is that an NCO that can be used in this DDS? or must it be LUT? >>>> >>>> Generally NCO or DDS refers to a phase accumulator with a LUT, since >>>> it is easily implemented in hardware. That's a general architecture >>>> that is well-known and can be adjusted to produce very clean local >>>> oscillators. If somebody tried to sell me a block of IP with an >>>> "NCO" built some other way I'd be asking a lot of questions. >>> >>> I have built NCOs using CORDIC rotators. No lookup tables. They pipeline >>> nicely and are therefore very fast, they require no multipliers [1], >>> they generate quadrature outputs for free, they can perform frequency >>> translations for free (again no multipliers), and they are simple prove >>> numerical accuracy. >>> >>> [1] Maybe not a huge issue these days. The LUT-based NCOs requires two >>> multipliers to combine the coarse and fine LUTs (four multipliers if you >>> need a complex NCO output) and perhaps another four multipliers if you >>> need to do a frequency translation. >>> >>> Rob. >>> >>>>> anyway, in either case, the oscillator frequency is well defined and i >>>>> don't understand why rickman would just put in a simple sharp notch >>>>> filter tuned to the very same frequency and whack the sinusoid and >>>>> analyze (however he does) what is residual. >>>> >>>> It could be because the phase accumulator/LUT architecture is general >>>> and the range of operation of the output frequency is pretty broad. >>>> A more generalized test approach is more flexible to testing over a >>>> broader range of outputs. >> >> By fine and coarse LUTS, I assume you are referring to a linear >> interpolation? That is what I did in a design working at audio >> rates. With the data being shifted serially I was able to perform a >> step and add multiply as the prior sample was being shifted out. > > Not linear interpolation. Simple trig identities. > > cos(u+v) = cos(u)cos(v) - sin(u)sin(v) > > where u is the coarse phase and v is the fine phase. > > You can get whatever accuracy you want using more and more cascaded > lookup tables with finer and finer phase resolution.
So the tables would be sin(u) and sin(v) with the cosine calculated by manipulating the phase as in cos(u) = sin(u+pi/2)? Yeah, I can see the difference is that this requires two multiplications and has no built in error, while linear interp only requires one multiply but has some error which is easy to define.
>> Any idea of the spurs for a CORDIC technique? > > As you mentioned previously, there are two sources of spurs - phase > truncation and amplitude truncation. You don't want the phase > truncation to dominate the spurs - it is so inexpensive to remedy. > > The CORDIC will give you 1 bit of accuracy per iteration - i.e., the > numerical error is cut in half with each iteration. This corresponds > to 6dB spurious reduction per iteration (assuming no phase truncation). > > -120 dBc spurious requires 20 iterations. More or less.
So phase truncation in CORDIC is determined by a constant in the math? Make the constant and the arithmetic longer and you get better phase error? -- Rick
On Mon, 22 Dec 2014 15:17:23 -0700, Rob Doyle <radioengr@gmail.com>
wrote:

>On 12/21/2014 5:13 PM, Eric Jacobsen wrote: >> On Sun, 21 Dec 2014 14:52:40 -0500, robert bristow-johnson >> <rbj@audioimagination.com> wrote: >> >>> On 12/19/14 11:04 PM, Eric Jacobsen wrote: >>>> On Fri, 19 Dec 2014 18:19:24 -0500, robert bristow-johnson >>>> <rbj@audioimagination.com> wrote: >>>> >>>>> On 12/19/14 10:06 AM, rickman wrote: >>>>>> I want to analyze the output of a DDS circuit and am wondering if an FFT >>>>>> is the best way to do this. I'm mainly concerned with the "close in" >>>>>> spurs that are often generated by a DDS. >>>>> >>>>> i still get the concepts of DDS and NCO mixed up. what are the differences? >>>> >>>> One is spelled DDS and the other is spelled NCO. >>> >>> is the NCO the typical table-lookup kind (with phase accumulator)? or >>> can it be algorithmic? like >>> >>> y[n] = (2*cos(omega_0))*y[n-1] - y[n-2] >>> >>> where omega_0 is the normalized angular frequency of the sinusoid and >>> with appropriate initial states, y[-1] and y[-2] to result in the >>> amplitude and initial phase desired. >>> >>> is that an NCO that can be used in this DDS? or must it be LUT? >> >> Generally NCO or DDS refers to a phase accumulator with a LUT, since >> it is easily implemented in hardware. That's a general architecture >> that is well-known and can be adjusted to produce very clean local >> oscillators. If somebody tried to sell me a block of IP with an >> "NCO" built some other way I'd be asking a lot of questions. > >I have built NCOs using CORDIC rotators. No lookup tables. They pipeline >nicely and are therefore very fast, they require no multipliers [1], >they generate quadrature outputs for free, they can perform frequency >translations for free (again no multipliers), and they are simple prove >numerical accuracy.
CORDICs are fine when and where they make sense, but they are often not the best tradeoff. If you have no memory, no multipliers, or gates are way cheaper than memory, and if the latency is tolerable, then a CORDIC may be a good option.
>[1] Maybe not a huge issue these days. The LUT-based NCOs requires two >multipliers to combine the coarse and fine LUTs (four multipliers if you >need a complex NCO output) and perhaps another four multipliers if you >need to do a frequency translation.
Many applications don't need separate LUTs to get the required performance, and even then, or even in the case of complex output, it can be done without multipliers. As is often the case, there are many ways to get the job done. Sometimes the complications aren't necessary, they're just convenient.
>Rob. > >>> anyway, in either case, the oscillator frequency is well defined and i >>> don't understand why rickman would just put in a simple sharp notch >>> filter tuned to the very same frequency and whack the sinusoid and >>> analyze (however he does) what is residual. >> >> It could be because the phase accumulator/LUT architecture is general >> and the range of operation of the output frequency is pretty broad. >> A more generalized test approach is more flexible to testing over a >> broader range of outputs. >> >> >> Eric Jacobsen >> Anchor Hill Communications >> http://www.anchorhill.com >> > >
Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com