LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best fit lines for loops and sine waves

Attepmt 2

Unflitlered resultes

0 Kudos
Message 11 of 17
(1,243 Views)
0 Kudos
Message 12 of 17
(1,243 Views)

I think I agree with the suggestion of separating the data into two sets, one for forwards and one for backwords, and then doing the fitting that way.

 

Jon S

Applications Engineer
National Instruments
0 Kudos
Message 13 of 17
(1,139 Views)

Hi NI Support Engineer,

 

I have a similar requirement. In my situation I know the original analog signals frequency, and the sample frequency of the A2D converter and have discrete samples (3 samples per cycle) of a known frequency sine wave.  The goal is to determine the peak-peak value of the original analog signal, or RMS value of the original signal from the discrete samples.  What is the best Lab view function to accomplish this?

 

Restating:

We have several cycles of an analog sine wave signal, at a known frequency (Fa). We then discretely sample this analog signal at a known sampling frequency, approx 3.125 x faster (Fs = 3.125xFa ).   So for each cycle I have at least 3 samples of the original analog signal.   We may have a range of cycles available from 1 cycle to dozens of cycles of the original analog signal that was sampled.

 

Goal:-> efficiently find the RMS or Peak value of the original analog signal. 

 

What's the easiest way to accomplish this task in lab view?  

 

thanks in advance.

  

0 Kudos
Message 14 of 17
(1,117 Views)

I think that you will find that curve fitting will likely be the best way to determine the amplitude from a very small sample set.  Since you know the frequency you only need to fit the phase and the amplitude.

 

Is your signal clean? By that I mean high signal to noise ratio and any interfering signals have much smaller amplitude.  If you have a noisy signal or interference, I think your probability of getting good results will be low.

 

Lynn

0 Kudos
Message 15 of 17
(1,108 Views)

Hi Lynn,

 

thanks for the quick reply.   Yes S/N is good and no interference.   What secific functions ??? Can you put the specific function name in quotes and suggest some code snippets to look at or VI ?

 

thanks,

 

0 Kudos
Message 16 of 17
(1,093 Views)

The Lev-Mar curve fitting VIs in Mathematics >> Fitting are the place to start.  These are not always easy to use, so read the help files carefully and plan to run some tests with known data to see what works.

 

Curve fitting routines tend to work poorly if the frequency does not match because they use derivatives to determine how to change parameters.  However you know the frequency so this should not be an issue.

 

I have never tried to fit so few points, so I do not have any idea of how well this will work.  You have very little information so large errors may be expected.  If you have any other information such as maximum or minimum amplitudes or approximate phase, that might be quite helpful.

 

Is there a reason why you cannot sample faster or longer to get more points?

 

Lynn

0 Kudos
Message 17 of 17
(1,088 Views)