Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21615 Discussions

NCO Frequency modualtion

Altera_Forum
Honored Contributor II
2,679 Views

Hi, I am trying to make a frequency sweeper with an NCO. 

 

Can anyone tell me how the modulation input into the NCO works. I want it sweep from 1MHZ to 48MHZ? 

 

Thank you in advance.
0 Kudos
10 Replies
Altera_Forum
Honored Contributor II
1,222 Views

Hi, 

 

If you mean generate frequencies 1MHz to 48MHz: 

 

For altera NCO with accumulator width set at 32 bits running and running at a sampling frequency of Fs: 

 

tuning word = 2^32 * freq(MHz)/Fs(MHz) 

 

so you need to generate the tuning words for freq = 1Mhz up to 48MHz in steps that you choose. 

 

If you mean modulate an input of 1MHz to 48MHz then just connect your input to the modulation input.
0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

So i would generate these tuning words say using a counter and just input them straight into the phi_inc_i input? 

 

Would the best way to do this using a counter with my required steps? 

 

Cheers
0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

Hi, 

you can either precalculate the values and insert in LUT then run an address 

scheme. Or you can compute that on the fly in software or in hardware. The choice is yours. 

A counter alone can't do that.
0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

i'm not sure why a counter wouldn't work for what you're trying to do. you can just reset the counter to the minimum phase increment value needed when it reaches the maximum needed. the rate at which you update the counter would be inversely proportional to the sweep time of the oscillator.

0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

 

--- Quote Start ---  

i'm not sure why a counter wouldn't work for what you're trying to do. you can just reset the counter to the minimum phase increment value needed when it reaches the maximum needed. the rate at which you update the counter would be inversely proportional to the sweep time of the oscillator. 

--- Quote End ---  

 

 

Good thinking, if you start with a value that produces tuning word for 48MHz then increment by the step and rollover at tuning word that produces 1MHz
0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

Or better if you start with a value that produces tuning word for 1MHz then decrement by the step and rollover at tuning word that produces 48MHz. 

 

Note that to produce 48MHz you need 96MHz Fs in order not to violate sampling theorem. In fact Fs should much higher to avoid close images e.g. 

150MHz or more. 

You will also need to consider the update rate not to be too fast
0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

isn't a small phase increment equal to a low frequency and a large phase increment a high frequency...so an up counter is appropriate? 

 

that's right, the sample rate should be more than double of the maximum frequency of 48MHz. sweep is a modulation that increases bandwidth, so extra care has to be taken not to alias. if you do a pretty slow sweep you can get away with no oversampling.
0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

Hi, 

 

You are right. Tuning word becomes the internal increment value for the NCO's modulo adder. A small increment value leads to low frequency and a large value leads to higher frequency. At the extreme an increment of 1 will need 2^32 clocks to finish one sinusoid cycle(full modulo adder cycle). 

 

Sorry I was rushing at the end of a hard working day, good excuse
0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

i know the feeling. :)

0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

Hi, thanks for the help.

0 Kudos
Reply