LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear Plot on a Log axis

Solved!
Go to solution

Hello,

what I want to do is quite unusual (I think) so I will explain the context :

 

I made a program which capture data off a spectrum analyser, correct these data with antenna correction, and use VIs "Limit Specification.vi" and "Limit Testing.vi" to interpolate my datas with a Pattern. The aim is to verify that the datas from the analyser don't get over the pattern.

 

Everything is then put in a Waveform Graph, with a Logarithm X Scale.

 

BUT the problem is that when I put X scale on "log" in graph properties, my Pattern representation is transformed in a Log-horrible-thing. I know it's working as intended, but my program isn't unusable because of this.

 

How can I do to make the interpolation "Linear" in a Log scale ? Is it possible using both limits VIs, or not ? I hope yes..

 

Here are some screenshot of the thing (can't join my VI, it's property of the company I work for (i'm in placement)).

 

Thanks for your future help !

 

Graph.JPG        

Diagramme.JPG

Message Edité par JDlabview le 05-27-2010 10:19 AM

J.D.
French Labview beginner
N'oubliez pas de complimenter les bonnes réponses - Don't forget Kudos for good answers
0 Kudos
Message 1 of 11
(5,748 Views)

I mean the green line on the UI screenshot?

You could just add 'a lot' (not more than your monitors pixel width) of points, which have a exponential interpolation.

 

Felix 

Message 2 of 11
(5,730 Views)
Your waveform data is linearly spaced (constant dt).  You will need to convert your data to X-Y data by creating the X data (using t0 and dt).  Once you have to X data (really all you need is the start and stop values), use the attached equation to generate new X values that are log spaced.  The LabVIEW interpolation function allows you to enter current X and Y values and new Xi values.  It will then compute the interpolated Yi values.  Since the new values are not linearly spaced, you cannot really represent them as a waveform.
Randall Pursley
Download All
Message 3 of 11
(5,720 Views)

Thanks to both of you.

 

Felix : the problem is that the analyser works with 501 or 1001 points, and there is many files of pattern, so it will be hard to get every single point manually.

 

Randall : great formula, and great screenshot, thank you very much. But there may be a problem if I change my waveform to X-Y values : the limit testing VI needs a waveform in the Input "Upper Limit". So it won't work if I'm not working in waveform datas... is it right or I am missing something ?

 

 

Message Edité par JDlabview le 05-28-2010 09:33 AM
Message Edité par JDlabview le 05-28-2010 09:33 AM

J.D.
French Labview beginner
N'oubliez pas de complimenter les bonnes réponses - Don't forget Kudos for good answers
0 Kudos
Message 4 of 11
(5,694 Views)

Just found the "Limit testing for unevenly sampled datas mesurement". Gonna test it.

 

Thanks again Randall 🙂


J.D.
French Labview beginner
N'oubliez pas de complimenter les bonnes réponses - Don't forget Kudos for good answers
0 Kudos
Message 5 of 11
(5,680 Views)

Hello, I tried hardly to get something from what you told me, but it didn't work (and from that post : http://forums.ni.com/ni/board/message?board.id=170&message.id=20205&query.id=5587881 but it didn't work because exponential of a number like 9000 give +Inf...)

 

 

I tried dozens of things to get it, but I get nothing in result..

I think the problem is that the 'Limit specification' and 'Limit testing' VIs are designed for Waveform data, and they realise their own interpolation between the pattern points and the signal, wich is not good to me... I think I am able to draw a logarithmic pattern on the graph, but not to use these limits functions, and the point is that I really need them.. Smiley Sad

 

If anyone can please help me, I'm sick of this problem...

 

 

 

 


J.D.
French Labview beginner
N'oubliez pas de complimenter les bonnes réponses - Don't forget Kudos for good answers
0 Kudos
Message 6 of 11
(5,631 Views)
Solution
Accepted by topic author JDlabview

 You should use 10^4 to get 10,000. So then you interpolate x=3.0 .. 4.0 and calculate 10^x and plot that data.

 

Felix 

Message 7 of 11
(5,626 Views)

Thanks but for what signal ? Is it a way to make a logarithmic interpolation or just to avoir the +Inf problem of the solution I linked ?


J.D.
French Labview beginner
N'oubliez pas de complimenter les bonnes réponses - Don't forget Kudos for good answers
0 Kudos
Message 8 of 11
(5,620 Views)

To make your interpolation in the range 1000 to 10,000 you will need to calculate

10^3

10^3.1

..

10^4

 

If you calculate 10^9000 you get a very large number, a 1 followed by 9000 0s.

 

Felix 

Message 9 of 11
(5,614 Views)

Thank you sooooo much Felix, you made my day !!!

 

I post the solution if someone needs it 🙂

 

1- I transform my waveform points in log10 base :

Waveform to log10.JPG

2- Same with my pattern (limit) points :

Cluster X to log10.JPG

3- I use the Limit specification and Limit testing VIs with these new X points (and dt=-1 because my waveform isn't linear anymore)

Limit.JPG

4-And finally, I use 10^x function and change my Waveform out of Limit Testing, in an XY graph :

To XY graph.JPG

 

If moderators find this post inconvenient because too big or useless, no worry to delete it.

 

Thanks to all of you LabView and NI experts to help beginners in their development 🙂


J.D.
French Labview beginner
N'oubliez pas de complimenter les bonnes réponses - Don't forget Kudos for good answers
Message 10 of 11
(5,601 Views)