Octave Code Contribution

View: New views
4 Messages — Rating Filter:   Alert me  

Octave Code Contribution

by Nathan Bliss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

I'm interested in developing for Octave so that I can add phase constellation plots to the gnuplot capabilities. These are the kind of constellation plots used in radio comms with I/Q values corresponding to real & imaginary points on a phase constellation diagram.

For example, I have an Octave array that contains real and imaginary values (complex values). I want to, say, pass this array to gnuplot but use some of the specialised native plotting functions of gnuplot to label the axes as 'Real' and 'Imaginary' and then to plot each complex value in the array as a vector, but where a symbol is drawn at the point and with no lines or connections being made between the points.

As far as I can tell this functionality doesn't yet exist in Octave or SciLab. These kind of plots are used extensively in mobile telecoms radio software and radio signal measurement equipment at the demodulation level.

I would be very grateful for any pointers you can give me for the following:

1. What compiler I need to install to write extra functions that involve passing data from Octave to gnuplot?

2. Information about the Octave API calls I can use and also the gnuplot API calls I need to pass data between Octave and gnuplot?

3. Do you have an example of how to add a new source code library to Octave, add a function that uses one of gnuplot's native plotting functions using a gnuplot API call, and then compile everything and run this new functionality?

Many thanks,
Nathan Bliss



     


Parent Message unknown Re: Octave Code Contribution

by Robert T. Short :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

try

plot(real(constellation), imag(constellation), ".;;")

where "constellation" is your I/Q array. 

You can label the axes any way you like.

This worked in 2.9.  In older versions there was a way to do it with "gplot".  I have not tried this in 3.x and there have been lots of changes since 2.9.


What would be really nice is to have "scatterplot" like MATLAB has, but that is trivial to implement if you can do the above.  Also, to get things to look right, you need "axes("square")" which doesn't always seem to work right, but I just resize the window to give me what I want.

Bob
--
Robert T. Short
PhaseLocked Systems

Robert T. Short wrote:


Nathan Bliss wrote:
Hi,

I'm interested in developing for Octave so that I can add phase constellation plots to the gnuplot capabilities. These are the kind of constellation plots used in radio comms with I/Q values corresponding to real & imaginary points on a phase constellation diagram.

For example, I have an Octave array that contains real and imaginary values (complex values). I want to, say, pass this array to gnuplot but use some of the specialised native plotting functions of gnuplot to label the axes as 'Real' and 'Imaginary' and then to plot each complex value in the array as a vector, but where a symbol is drawn at the point and with no lines or connections being made between the points. 

As far as I can tell this functionality doesn't yet exist in Octave or SciLab. These kind of plots are used extensively in mobile telecoms radio software and radio signal measurement equipment at the demodulation level.

I would be very grateful for any pointers you can give me for the following:

1. What compiler I need to install to write extra functions that involve passing data from Octave to gnuplot?

2. Information about the Octave API calls I can use and also the gnuplot API calls I need to pass data between Octave and gnuplot?

3. Do you have an example of how to add a new source code library to Octave, add a function that uses one of gnuplot's native plotting functions using a gnuplot API call, and then compile everything and run this new functionality?

Many thanks,
Nathan Bliss



      



  



Octave Code Contribution

by John W. Eaton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 27-Feb-2009, Nathan Bliss wrote:

| I'm interested in developing for Octave so that I can add phase
| constellation plots to the gnuplot capabilities. These are the kind
| of constellation plots used in radio comms with I/Q values
| corresponding to real & imaginary points on a phase constellation
| diagram.
|
| For example, I have an Octave array that contains real and imaginary
| values (complex values). I want to, say, pass this array to gnuplot
| but use some of the specialised native plotting functions of gnuplot
| to label the axes as 'Real' and 'Imaginary' and then to plot each
| complex value in the array as a vector, but where a symbol is drawn
| at the point and with no lines or connections being made between the
| points.
|
| As far as I can tell this functionality doesn't yet exist in Octave
| or SciLab. These kind of plots are used extensively in mobile
| telecoms radio software and radio signal measurement equipment at
| the demodulation level.
|
| I would be very grateful for any pointers you can give me for the following:
|
| 1. What compiler I need to install to write extra functions that
| involve passing data from Octave to gnuplot?
|
| 2. Information about the Octave API calls I can use and also the
| gnuplot API calls I need to pass data between Octave and gnuplot?
|
| 3. Do you have an example of how to add a new source code library to
| Octave, add a function that uses one of gnuplot's native plotting
| functions using a gnuplot API call, and then compile everything and
| run this new functionality?

I don't think you should need to do anything directly with gnuplot to
implement some higher-level plotting function like you are describing.
Instead, you should be able to do it all with the existing plotting
functions and by setting properties.  This has the advantage of not
being tied to gnuplot, which may eventually not be the default
plotting engine for Octave.  If there is something you can't do by
using the current plotting capabilities of Octave, then please explain
precisely what you are trying to do and someone will probably be able
to help you.

The current development sources include the function scatter.  Does

  n = 100;
  x = rand (n, 1) + i*rand (n, 1);
  scatter (real (x), imag (x));
  xlabel ("Real");
  ylabel ("Imaginary");

do approximately what you want (see the attached plot)?

jwe



foo.pdf (13K) Download Attachment

Re: Octave Code Contribution

by dbateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Robert T. Short wrote:
try

plot(real(constellation), imag(constellation), ".;;")

where "constellation" is your I/Q array. 

You can label the axes any way you like.

This worked in 2.9.  In older versions there was a way to do it with
"gplot".  I have not tried this in 3.x and there have been lots of
changes since 2.9.


What would be really nice is to have "scatterplot" like MATLAB has, but
that is trivial to implement if you can do the above.  Also, to get
things to look right, you need "axes("square")" which doesn't always
seem to work right, but I just resize the window to give me what I want.
Does the "scatterplot" function in the communications package of octave-forge do what you want?

D.