09-10-2013 03:59 AM
Hello, i need to generate waveform using existing phases and amplitudes of harmonics taken from plotted signal(Voltage signal in my project). I started with a for loop which searches up to 20th harmonics for phases and amplitudes, but i dont know why the output of Tone Measurements vi cant put values into array. Then i need to create a waveform which will be a sum of cosinus functions where amplitude and phase correspond to each taken phase and amplitude from harmonics. Can anyone take a look why i cant get datas from loop into array, or has another idea how to generate such a waveform? Apologize for my english
09-11-2013 03:29 AM
Hi Menomena!
If I understood correctly, you would like to find harmonics of a signal with amplitude and phase, then recreate the signal by generating the multitone of said freqencies. For detection, you can use Extract Multiple Tone Information.vi or Harmonic Distortion Analyzer.vi, to recreate, the Multitone Generator.vi is most appropriate. You will find these in te Signal Processing palette. Let me paste an example snippet to see what I meant:
Of course your individual application might be different, but I hope this will be of some help.
Regards:
Andrew Valko
NI Hungary
09-11-2013 04:48 AM
Big thanks for reponse. I have some troubles with running ur conception. Can u look an my VI? Above ur idea i tried to use harmonic analyzer and then multitone generator but i dont think the plot is correct, i think i shouldnt see 20th peaks with same amplitudes, it looks kinda weird, can u consider this?
To be more clear what kind of formula i am trying to get look at the attachment.
09-11-2013 05:03 AM
I loaded wrong VI, reupload in new reply, couldnt edit old
09-11-2013 06:34 AM - edited 09-11-2013 06:35 AM
Dear Menomena,
A few things to consider:
1. You have indexing inputs on two of the For loops, so no need to wire the count terminal
2. Be aware that the iteration terminal is zero indexed, so if you output i*50, then you will get [0,50,100,..].
3. I used the frequecy output of the Analyzer instead of a constant, but they are the same for this particular waveform.
4. You can use Add and other functions on arrays, no need for for loops (except maybe to generate the array of harmoic counts).
I have made modified your code a bit to reflect these things, please check it out.
Regards:
Andrew Valko
NIH
09-11-2013 07:07 AM - edited 09-11-2013 07:10 AM
ValkoA,
Really big thanks for your help, now it seems to work correctly. Probably would never have fixed that on my own. I have last question to u, can u help me consider why values of the amplitudes are bit different than FFT plot? And one more thing, maybe i dont understand this, if my fundamental frequency is 50hz, harmonics shouldnt be a multiplication of 50hz(i mean, fundamental is 50hz, harmonics are: 100, 150, 200 etc)? Cause i see at the first index in the harmonics' amplitudes array value -6,32, it looks like an amplitude for 0hz?(btw should it be 6,32?) U can check it in my attachment
09-11-2013 07:28 AM
Dear Menomena,
You are indeed correct, the array index is the harmonic number including 0 (DC), 1 (fundamental), 2 (second harmonic),... n (nth harmonic), up to and including the highest harmonic. Glad to haer that it's working as expected now.
Regards:
Andrew
09-12-2013 06:47 AM
Valkoa, thx for the reply,
I have another problem, i did my project complete but after running it all is lagging (i am getting no response in my labview window). Can U, or anyone check what is wrong?