Forum Discussion
Altera_Forum
Honored Contributor
17 years agoHi,
for 8 bits you can generate one cycle sinusoid as follows: First: what is your Fs(sampling freq or effective clk)? assume it is 50MHz what is your tone freq? assume it is 2MHz Second: decide number of sinusoid points for one cycle: 50/2 = 25 data = sin(2*pi*[0:24]/25); quantise onto 8 bits: data = round(data* (2^7-1)/max(data)); //signed When you store this data as LUT and read it out on your clk, it should generate a tone at 2Mhz. If your DAC uses offset binary as opposed to 2's complemnt then invert the sign bit for the DAC. However, I am a bit disappointed, I thought your tones are ready by now except for that wait for the orchestra director... If it turns out that your LUT is very large because your tone is very low then you can use a slightly different approach using a modulo adder.