LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peak and Amplitude

I’ve trying to determine the Peak and Amplitude of a signal when peak exceeds a certain threshold value that we choice. Now I can read the frequencies but I can’t have the correct values for its respective amplitudes. These are my two questions: 1. How a can read both frequency and amplitude correctly with this VI? and 2. How can send the obtained information to a spreadsheet?

 

Any input will be appreciated. Thanks.

Download All
0 Kudos
Message 1 of 6
(3,165 Views)

I would recommend using the Extract Multiple Tone Information VI instead of the Express VI.  It returns all the information you want.  Your current method is limited by the resolution of your data.  Extract Multiple Tone Information returns peak locations to sub-sample accuracy by using fitting techniques on the top few data points.

 

How would you like to send data to a spreadsheet - directly to Excel, create an Excel file, or create a tab separated text file?  The last of these is the easiest and most portable.  Use either the Write to Spreadsheet File VI or the Write to Measurement File Express VI with the file type set to LVM.

0 Kudos
Message 2 of 6
(3,127 Views)

Thank you very much for your suggestions. I used Extract Multiple Tone Information how you said, but I still have some problems to know the correct amplitudes values. If you can look over my code and give me any tips I would be very grateful.

 

You can see in my code that I was been using the Write to Spreadsheet File VI to writing some others levels and amplitudes, but my question about how to send the frequency and amplitude to spreadsheet is because I don’t know how to send 1-D array of Cluster (The format at the output of Waveform Peak Detector VI) to spreadsheet.

 

Thank you and best regards

0 Kudos
Message 3 of 6
(3,105 Views)

Write To Spreadsheet File requires an Array input, therefore if your cluster contains numeric, boolean and string data for example, you may perhaps be able to convert it all to a 2D array of strings, which will require further data manipulation. 

 

Or if the end goal is to be able to open this file in Excel, you could perhaps consider writing to a TDMS file and use the following example as a starting point. You would need the add-on install which can be found here.

 

Hope this helps!

Tejinder Gill
National Instruments
Applications Engineer
Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 4 of 6
(3,091 Views)

Thanks for your help. The TDMS file in http://decibel.ni.com/content/docs/DOC-13118 is on Labview 9 and I have 8.6. On the other hand, any suggestion to read the peaks values? Please, look over my code. Thanks!!!

0 Kudos
Message 5 of 6
(3,085 Views)

To write the array of clusters to a spreadsheet file, you will need to write your own code using the LabVIEW text file I/O primitives.  Spreadsheet files are typically arrays of strings with the row elements separated by tabs (or, less commonly, commas) and the columns by an end-of-line (CR/LF for Windows).  The following algorithm should work for you:

 

  1. Open/create the file
  2. Create a text string composed of the header information for each column you want to write.  Separate the headers with tabs and put an end-of-line at the end of the string.
  3. Write this string to the file.
  4. For each element of the cluster, create another text string with the elements separated by tabs.  End with an end-of-line.
  5. Write these lines to the file. (HINT: use a FOR loop)

Consult the LabVIEW help for how to use the file I/O primitives.  Let us know if you need more help.

 

0 Kudos
Message 6 of 6
(3,056 Views)