From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recommended samplingrate and # of points for my harmonic analysis program

Hi,
 
I have done a program to perform amplitude and phase harmonic analysis on a digitalized signal. The harmonics I want to mesure are:
 
-DC
-50 kHz
-100 kHz
-60 kHz
-120 kHz
-10 kHz
-20 kHz
-40 kHz
-70 kHz
 
I have to detect simultaneously the amplitude and the phase of all these harmonics. They can be quite hidden in noise, and they all don't have the same amplitude. Please, if you can, have a look to the program I attach and tell me if you find it more or less ok  (I am not very skilled with labview).
 
I have tested the program I attach  and results are not bad at all, but they are quite sensitive to the sampling rate and the number of points used, so I wonder if the parameters I am using could be improved. Now I have in my adquisition board:
 
-sampling rate: 4915200 Hz
- number of points:  24576
 
¿Are they ok? ¿Do you suggest any other values without increasing dramatically the measurement/calculation time?
 
Thank you very very much in advance
 
obarriel


Message Edited by obarriel on 05-30-2008 05:15 PM
0 Kudos
Message 1 of 17
(3,148 Views)
I bump it.

Thank you!
0 Kudos
Message 2 of 17
(3,120 Views)
I bump it again. Robot Happy
0 Kudos
Message 3 of 17
(3,099 Views)
Up again
0 Kudos
Message 4 of 17
(3,085 Views)
up again
0 Kudos
Message 5 of 17
(3,069 Views)
I am not sure what you are trying to do with your VI. The Build Array creates a 2D array with each of your signal components in a separate row of the array. Typically in simulating a signal with multiple components, you add the components.

When you do the matrix math, what is the purpose? The Fourier Transform VIs or the various spectral analysis VIs are usually used to identify spectral components in a composite signal. Looking at the errors coming from the Matrix functions might help with the debugging. Two of them produce error -20039, input matrix size mismatch.

Your VI can be made much more compact by reusing code. Put the Sine and Cosine functions in a subVI. Build an array of the X values. Feed to Sine_Cos subVI in a loop.

See the attached modifications.

Lynn
0 Kudos
Message 6 of 17
(3,055 Views)
Thank you very much for your answer Lynn

The purpose of the Matrix math is to calculate the magnitude and the phase of the adquired signal. The adquired signal is the one that is called "chanel 0" and is a vector with "nº of samples" elements. For example,  if "nº of samples"  is 4096 then "channel 0" must be a vector with 4096 elements. If you give the correct size to channel 0  all the "input matrix size mismatches" disappear. So  the "nº of samples " parameter is always the size of the  array "channel 0"

With the matrix algebra you see I think I am able to measure the magnitude and the phase of the signal detected in channel 0. It is like a Fourier integration and t
he basis functions for this Fourier integration are 1.0 and the functions sin (Ωk t) and cos (Ωk t) for each analyzed frequency Ωk. Choosing x0=50000 and x1=60000, and I want to detect all these frequencies:

-DC
-50 kHz
-100 kHz
-60 kHz
-120 kHz
-10 kHz
-20 kHz
-40 kHz
-70 kHz

If eight frequencies are used, then the basis set contains 17 functions (16 for Ωk. and 1 for DC) .

I have tested that this method works ok but I don't really know if it is the best option for noise rejection, and also if it is the best option for labview in terms of speed. Moreover I have doubts about which samplingrate and the # of points I should use for the adquisition. Now I adquire arrays of 24576 data points (so chanel 0 is a vector of 24576) with a samplingrate of 4915200 Hz.

Sorry for my difficulties to explain my problem, english is not my native language, and I am not very skilled with labview and data adquisition & analysis.

Thank you again.
 

0 Kudos
Message 7 of 17
(3,046 Views)
I think I understand something of what you are trying to do. Can you post some typical data which you have acquired?

One way to do this is to run your acquisition system with it connected to your Amp&phase.vi. The for the Amp&phase.vi (or at least the Channel 0 array), choose from the Edit menu: Make current values default. Save the VI and post it again.

Lynn
0 Kudos
Message 8 of 17
(3,019 Views)

Thank you again,

I attach the program in the way you say.  Hope you can understand what I do.

obarriel 

 



Message Edited by obarriel on 06-05-2008 12:14 PM
0 Kudos
Message 9 of 17
(3,001 Views)
I bump it again.

Thank you!
0 Kudos
Message 10 of 17
(2,958 Views)