07-02-2012 11:32 AM
Hi,
I am trying to generate a sum of sines with Sinewave function and compute its fft to see if i can get back the magnitude of each harmonic. This is aiming at, later, getting a real signal and computing its fft. But for the moment I'm testing the code on virtual signals (square, triangle etc).
However, I fail at plotting the sum of 3 sines. I don"t understand how i can generate a first sine (fundamental) and then sines with a frequency multiple of the fundamental. (f, 3f and 5f).
I tryed this :
Sinewave(512,5,1/512,&ph1,sine1);
PlotWaveform(...,...,sine1,512,...,1.0,0.0,0.0,1,...,...,...,1,...);
But nothing appears except a constant line.
To sum it up : I think I have understood nothing at all about how the function sinewave works, espacially about the frequency I have to pass.
Many thanks if you can help me
Regards,
_trent_
Solved! Go to Solution.
07-02-2012 12:23 PM
Ah. This was one of those simple mistakes that takes forever to find. For the Frequency parameter you have specified "1/512", but since that is integer division, it evaluates to 0. Instead do "1.0/512".
07-03-2012 03:17 AM
Thank you so much 🙂