LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tone measurements -> phase output into array

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

0 Kudos
Message 1 of 8
(3,481 Views)

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:

Exact Tones and Recreate.png

 

Of course your individual application might be different, but I hope this will be of some help.

 

Regards:

 

Andrew Valko

NI Hungary

Andrew Valko
National Instruments Hungary
0 Kudos
Message 2 of 8
(3,452 Views)

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.

Download All
0 Kudos
Message 3 of 8
(3,446 Views)

I loaded wrong VI, reupload in new reply, couldnt edit old

0 Kudos
Message 4 of 8
(3,439 Views)

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

Andrew Valko
National Instruments Hungary
Message 5 of 8
(3,431 Views)

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

0 Kudos
Message 6 of 8
(3,423 Views)

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

 

 

Andrew Valko
National Instruments Hungary
0 Kudos
Message 7 of 8
(3,419 Views)

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?

0 Kudos
Message 8 of 8
(3,400 Views)