Forum Discussion
Altera_Forum
Honored Contributor
13 years agoThe input is 12 bits counter (not degrees but represents phase) and usually you start from zero and increment by tuning word(tw) as below. The LUT size is 4096 locations. data is 12 bits wise signed.
To produce a given frequency, you first need to know your sampling rate (Fs) then your required output frequency (Fo) then compute a tuning word: the ratio of tw/lut size = Fo/Fs i.e. tw = lut size * Fo/Fs = 4096 *Fo/Fs -- rounded up The lowest frequency is when tw = 1 and the highest frequency is when tw = 2048 i.e. the phase jumps 0 => 2048 => 0 You need to increment phase by tw modulo 4096. Hope this helps