In the program given below what is meaning of maximum frequency and how it is decided. what will happen if i substitute max freq also as freq. will it have any effects on code???
The following pseudo code exemplifies, 50Hz single channel digital SIN signal generation
using SGENT_1 module.
#include <sgen.h>
SGENT_1 sgen=SGENT_1_DEFAULTS;
int x1;
main ( )
{
sgen.offset=0;
sgen.gain=0x7fff; /* gain=1 in Q15 */
sgen.freq=5369; /* freq = (Required Freq/Max Freq)*2^15 */
/* = (50/305.17)*2^15 = 5369 */
sgen.step_max=1000; /* Max Freq= (step_max * sampling freq)/65536 */
/* Max Freq = (1000*20k)/65536 = 305.17 */
}
void interrupt isr_20khz()
{
sgen.calc(&sgen);
x1=sgen.out;
}
waiting for reply
Regards
Aditya