Forum Discussion
Altera_Forum
Honored Contributor
12 years agosine wave generator
Hi to all,
i want to generate high precision,low frequencies sinusoidal signals (50,80 and 180 hz) trough my altera cyclone4 (vhdl code) with the PWM technique. I've started to do some tests, in particular i've used the NCO megafunction, but the problem is that the only way to generate high precision 50hz signal is to set input clock frequency as a power of 2 (for example 65.536Khz). Is there any way to overcome this issue? Is there another more interesting techniques to generate sinusoidal samples for high precision signals? Let me know, thanks...3 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- Hi to all, i want to generate high precision,low frequencies sinusoidal signals (50,80 and 180 hz) trough my altera cyclone4 (vhdl code) with the PWM technique. I've started to do some tests, in particular i've used the NCO megafunction, but the problem is that the only way to generate high precision 50hz signal is to set input clock frequency as a power of 2 (for example 65.536Khz). Is there any way to overcome this issue? Is there another more interesting techniques to generate sinusoidal samples for high precision signals? Let me know, thanks... --- Quote End --- you can use power of 2 nco for accurate sinusoid of any value. The resolution of phase accumulator can be increased. The frequency will be correct but phase drift may occur. - Altera_Forum
Honored Contributor
--- Quote Start --- but the problem is that the only way to generate high precision 50hz signal is to set input clock frequency as a power of 2 (for example 65.536Khz). --- Quote End --- That's not the concept of NCO. You can generate arbitary frequencies with effectively unlimited accuracy and signal quality. - Altera_Forum
Honored Contributor
Maybe the TE has a look at the DDS basics. Of course any frequency can be generated this way, taking into account the limits of DDS. Regarding PWM output this is another issue. PWM limits the precision of the generated wave.
See some hints here: http://www.96khz.org/oldpages/sinesynthesisdds.htm