Dear Forum ,
We are in need of a signal generator functionality with accurate frequency control and low noise (THD). I have referred to code samples provided with ControlSUITE in SGEN library. This question is about understanding the three variations of sine-wave generators:
1. SGENT : Standard THD
2. SGENTL: Low THD
3. SGENHP: High-precision
I have been able to observe the sine-waves generated on 28377S. I want to understand the frequency control of these sine-waves. As the explanation in module's user guide suggests: SGENT/SGENTL use a 16 bit modulo for calculation and use step = 2^16*f/fISR and SGENHP uses 32-bit modulo and step = f*2^32 / fISR, where f is the required frequency, and fISR is the ISR frequency = 20 kHz, as given in the examples.
When I run the default code in SGENHP and SGENT which aims for a frequency of 50Hz, and sets the step and freq values appropriately, I get a SINE wave output as attached. I have changed the x axis representation to seconds from samples and I changed the y axis to Q1 format in place of Q15. From the graph we can deduce the period of sine wave to be around 400 seconds. This number was halved when I tried to set a frequency of 100 Hz in place of 50 Hz.
I have following questions regarding the generators:
1. How does the frequency of sine wave relate to the frequency we set (50hz) ? Also, if this is not the correct method of checking the period (frequency) of the generated sine wave, how should I do that ? I am sensing that this would relate to the SIGNAL_LENGTH (= 512) as well as number of points in SINE table ( = 256), but I am not able to deduce anything further.
2. What are the advantages of using high precision generator over SGENTL ? Is it only a higher frequency resolution given by Fmax/step_max or is there some advantage in THD quality as well ? The graph on page-5 and page-4 of the user guide look similar in terms of the generated signals THD. What then is the cost associated with using SGENHP ?
Thanks
SGENHP and SGENT