Forum Discussion
25 Replies
- Altera_Forum
Honored Contributor
Amplitude depends on how you want it to be and is not related to frequency. Check your nco IP mif files for maximum/minimum.
- Altera_Forum
Honored Contributor
When i sweep the frequency the amplitude is changing though, could it be to do with the dac?
- Altera_Forum
Honored Contributor
Hard to say. you better give more details about your design from NCO to DAC to the way you see amplitude. Do you use any fft?
You can exclude NCO by looking at max/min mif values per each sweep point. - Altera_Forum
Honored Contributor
My project is attached.
I am not using any FFT. I have checked my amplitude on an osciliscope and also through NIOS to the pc. - Altera_Forum
Honored Contributor
I am sorry I can't run any projects at the time being.
I suggest the easiest way is to use nios or signaltap(or simulation) after adding this simple piece of code on your sine data:
you can use nios to clear temp or read its value per each frequency. Remember to make temp and data signed type-- get max data process(clear,clk) begin if clear = '1' then temp <= (others => '0'); elsif rising_edge(clk) then if temp < data then temp <= data; end if; end if; end process; - Altera_Forum
Honored Contributor
It is definatly something to do with the DAC / ADC, as i just run it without using the dac and is fine.
- Altera_Forum
Honored Contributor
check your DAC number system. It is either 2's complement or offset binary.
if offset binary you need to do one more thing: invert the sign bit I don't know what is ADC doing here. - Altera_Forum
Honored Contributor
I have already inverted sign bit and is outputing a wave fine. The issue is when frequency sweeping the amplitude is changing.
Is there any files for the frequency response of the DAC? I mention the ADC as I guess it will have a similar issue when feeding a signal back into the card. - Altera_Forum
Honored Contributor
DACs do not have frequency response per se. It just converts digits to a ladder of values.
If you inject any data into DAC, it should be converted to the ladder of corresponding digits. There is no way the DAC will discriminate against the frequencies. Assuming you are not violating the DAC sampling speed. Make sure your sine data are at DAC's sampling frequency and that you are not violating the sampling rule. I don't think you are violating because you generate them in the digits(not from ADC) so make sure your DACs sampling frequncy is same as that of your sine data. - Altera_Forum
Honored Contributor
Hold on...It could be you are having sinc effect of DAC's hold device.
DACs normally have inverse sinc filter to compensate for that. But it could be you are right, as you get closer to Fs the amplitude will droop and becomes zero at Fs(in theory). So there is no problem now. Basically I missed the fact that your DAC is basic without inverse sinc correction.