Tool/software: TI C/C++ Compiler
Hi all
I would like to generate a signal composed of several harmonics to test a mobile effective value calculation algorithm.
I'm trying to use the SGEN library that works well for the generation of a harmonic, but I'm having trouble incorporating a second harmonic, for example the first and third (50/60 Hz and 150/180 Hz)
In the "signal generator library" document of 2011, it is not clear if it is possible to generate several harmonics, nor does it give examples.
This is the confuguration that I am trying
/ * Create an instance of Signal generator module * /
SGENTI_1 sgen_1 = SGENTI_1_DEFAULTS; // Low THD without generator
SGENTI_1 sgen_2 = SGENTI_1_DEFAULTS;
// Signal Generator module initialization fs_0 = 50 Hz
sgen_1.offset = 0;
sgen_1.gain = 0x1fff;
sgen_1.freq = 2684;
sgen_1.step_max = 2000;
sgen_1.alpha = 0;
sgen_2.offset = 0;
sgen_2.gain = 0x1fff;
sgen_2.freq = 8053;
sgen_2.step_max = 2000;
sgen_2.alpha = 0;
********************************************** *********************
//
// Next two lines for debug only to halt the processor here
// Remove after inserting ISR Code
//
Timer ISR @ 20kHz
sgen_1.calc (& sgen_1);
s1 [i] = sgen_1.out;
sgen_2.calc (& sgen_2);
s2 [i] = sgen_2.out;
********************************************** ***********
LINKER:
SINTBL:> RAMGS3, PAGE = 1
}
Do I have to generate 2 tables? If so, how is it done?
Thank you very much to all
regards
Juan