Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: GNU-PLOT  (Read 3083 times)

Loading

  • Reg Member
  • ***
  • Posts: 252
GNU-PLOT
« on: April 27, 2014, 05:11:33 PM »

Can someone give me the code required to plot the qln data using gnu-plot if i provide the data?
Code: [Select]
Tone number      QLN
   0            -150.5000
   1            -150.5000
   2            -150.5000
   3            -150.5000
   4            -150.5000
   5            -150.5000
   6            -150.5000
   7            -150.5000
   8            -150.5000
   9            -150.5000
   10           -150.5000
   11           -150.5000
   12           -150.5000
   13           -150.5000
   14           -150.5000
   15           -150.5000
   16           -150.5000
   17           -150.5000
   18           -150.5000
   19           -150.5000
   20           -150.5000
   21           -150.5000
   22           -150.5000
   23           -150.5000
   24           -150.5000
   25           -150.5000
   26           -150.5000
   27           -150.5000
   28           -150.5000
   29           -150.5000
   30           -150.5000
   31           -150.5000
   32           -150.5000
   33           -123.5000
   34           -125.5000
   35           -127.5000
   36           -126.5000
   37           -119.0000
   38           -117.0000
   39           -126.0000
   40           -130.0000
   41           -132.5000
   42           -132.5000
   43           -132.0000
   44           -131.5000
   45           -133.0000
   46           -132.5000
   47           -134.0000
   48           -132.5000
   49           -133.5000
   50           -132.5000
   51           -132.0000
   52           -132.0000
   53           -131.0000
   54           -127.0000
   55           -127.5000
   56           -126.0000
   57           -121.5000
   58           -111.0000
   59           -113.5000
   60           -122.5000
   61           -126.5000
   62           -129.5000
   63           -132.0000
   64           -133.0000
   65           -134.0000
   66           -134.5000
   67           -135.5000
   68           -135.5000
   69           -135.5000
   70           -138.0000
   71           -139.0000
   72           -136.5000
   73           -135.5000
   74           -139.0000
   75           -138.5000
   76           -138.0000
   77           -139.0000
   78           -140.0000
   79           -137.0000
   80           -137.5000
   81           -138.5000
   82           -141.0000
   83           -141.5000
   84           -138.0000
   85           -138.0000
   86           -137.5000
   87           -139.5000
   88           -138.5000
   89           -136.0000
   90           -140.0000
   91           -139.5000
   92           -138.5000
   93           -134.5000
   94           -138.5000
   95           -141.0000
   96           -140.5000
   97           -134.5000
   98           -140.5000
   99           -142.0000
   100          -140.5000
   101          -136.0000
   102          -141.0000
   103          -144.5000
   104          -141.5000
   105          -140.5000
   106          -144.0000
   107          -143.0000
   108          -143.5000
   109          -144.5000
   110          -143.5000
   111          -143.5000
   112          -144.5000
   113          -141.5000
   114          -143.0000
   115          -143.0000
   116          -144.5000
   117          -141.5000
   118          -142.5000
   119          -144.5000
   120          -145.5000
   121          -143.0000
   122          -144.5000
   123          -144.5000
   124          -147.0000
   125          -144.0000
   126          -144.0000
   127          -138.0000
   128          -143.0000
   129          -142.0000
   130          -144.0000
   131          -145.0000
   132          -143.0000
   133          -144.0000
   134          -143.0000
   135          -145.0000
   136          -145.0000
   137          -143.5000
   138          -144.5000
   139          -146.0000
   140          -144.5000
   141          -144.5000
   142          -145.5000
   143          -144.5000
   144          -142.5000
   145          -144.5000
   146          -141.0000
   147          -143.5000
   148          -145.0000
   149          -143.0000
   150          -143.0000
   151          -144.5000
   152          -142.0000
   153          -143.0000
   154          -145.5000
   155          -143.5000
   156          -139.5000
   157          -142.0000
   158          -141.0000
   159          -139.5000
   160          -135.5000
   161          -129.0000
   162          -138.0000
   163          -140.0000
   164          -138.0000
   165          -140.0000
   166          -143.5000
   167          -134.0000
   168          -144.0000
   169          -144.0000
   170          -143.5000
   171          -142.5000
   172          -142.0000
   173          -142.0000
   174          -142.0000
   175          -132.5000
   176          -139.0000
   177          -142.5000
   178          -144.5000
   179          -141.5000
   180          -142.0000
   181          -141.5000
   182          -140.5000
   183          -143.0000
   184          -141.5000
   185          -139.0000
   186          -131.5000
   187          -140.0000
   188          -142.0000
   189          -143.5000
   190          -141.5000
   191          -141.5000
   192          -141.5000
   193          -142.0000
   194          -142.0000
   195          -140.0000
   196          -141.0000
   197          -140.0000
   198          -139.0000
   199          -138.5000
   200          -136.5000
   201          -134.5000
   202          -132.0000
   203          -127.5000
   204          -118.5000
   205          -117.5000
   206          -127.5000
   207          -132.0000
   208          -134.0000
   209          -135.5000
   210          -134.0000
   211          -126.5000
   212          -136.5000
   213          -138.5000
   214          -137.5000
   215          -136.0000
   216          -139.5000
   217          -142.0000
   218          -143.0000
   219          -141.5000
   220          -142.5000
   221          -143.5000
   222          -143.5000
   223          -142.0000
   224          -143.0000
   225          -144.0000
   226          -143.5000
   227          -144.0000
   228          -143.0000
   229          -139.5000
   230          -139.0000
   231          -143.0000
   232          -134.0000
   233          -143.0000
   234          -143.0000
   235          -142.5000
   236          -141.5000
   237          -141.5000
   238          -140.5000
   239          -141.0000
   240          -142.0000
   241          -140.5000
   242          -142.0000
   243          -141.0000
   244          -140.0000
   245          -139.5000
   246          -138.5000
   247          -138.0000
   248          -136.0000
   249          -134.5000
   250          -131.5000
   251          -127.5000
   252          -118.0000
   253          -117.5000
   254          -127.5000
   255          -131.5000
:)
Logged

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: GNU-PLOT
« Reply #1 on: April 27, 2014, 06:12:54 PM »

Certainly.  :)

Here is a "knocked about" Bash script that will be appropriate for any system using the Unix or Linux kernel-based operating systems --

Code: [Select]
#!/bin/bash

#
# Version 2.2
#
# Sat Jan 25 00:21:00 UTC 2014
#
# Based on the ideas of Asbokid and Little_bird.
# Enhanced by Bald_Eagle1 and Mystica.
# Developed by Burakkucat.
#
# For this script to produce meaningful results, the data file
# should contain the output of the following four "xdslcmd info"
# command interrogations (in no particular order):
#
# xdslcmd info --Bits
# xdslcmd info --linediag
# xdslcmd info --pbParams
# xdslcmd info --show
#

PNAME=$(basename $0)

if [ $# -ne 1 ]; then
echo "usage: $PNAME data_file"
exit 1
fi

if [ ! -r $1 ]; then
echo "$PNAME: $1 is unreadable or does not exist."
        exit 2
fi

bits_gnp() {
echo "set terminal png"
#echo "set title 'VDSL2 (Profile $PROFILE) - Bit Loading'"
echo "set title 'xDSL - Bit Loading'"
echo "set timestamp 'Data obtained $OBSTAMP                         Graph created %d/%m/%y %H:%M' 5,-1"

echo "set nokey"

echo "set ylabel 'Bits per Tone'"
echo "set xlabel 'Tone (subcarrier index - 4.3125KHz spacing)'"

echo "set yrange [0:16]"
echo "set xrange [0:256]"

echo "set ytics nomirror 1"
#echo "set xtics nomirror 250"
echo "set xtics nomirror 50"

echo "set mxtics 5"

echo "set grid ytics back"
echo "set grid xtics back"
echo "set grid mxtics back"

echo "set boxwidth 0.1 absolute"

echo "plot 'Bits.txt' with boxes"
}

snr_gnp() {
echo "set terminal png"
#echo "set title 'VDSL2 (Profile $PROFILE) - Signal to Noise Ratio'"
echo "set title 'xDSL - Signal to Noise Ratio'"
echo "set timestamp 'Data obtained $OBSTAMP                         Graph created %d/%m/%y %H:%M' 5,-1"

echo "set nokey"

echo "set ylabel 'SNR (dB)'"
echo "set xlabel 'Tone (subcarrier index - 4.3125KHz spacing)'"

echo "set xrange [0:256]"

echo "set ytics nomirror 10"
#echo "set xtics nomirror 250"
echo "set xtics nomirror 50"

echo "set mytics 5"
echo "set mxtics 5"

echo "set grid ytics back"
echo "set grid xtics back"
echo "set grid mxtics back"

echo "set boxwidth 0.1 absolute"

echo "plot 'SNR.txt' with boxes"
}

qln_gnp() {
echo "set terminal png"
#echo "set title 'VDSL2 (Profile $PROFILE) - Quiet Line Noise (QLN)'"
echo "set title 'xDSL - Quiet Line Noise (QLN)'"
echo "set timestamp 'Data obtained $OBSTAMP                         Graph created %d/%m/%y %H:%M' 5,-1"

echo "set nokey"

echo "set ylabel 'QLN (dBm/Hz)'"
echo "set xlabel 'Tone (subcarrier index - 4.3125KHz spacing)'"

echo "set yrange [-150:-50]"
echo "set xrange [0:256]"

echo "set ytics nomirror 10"
#echo "set xtics nomirror 250"
echo "set xtics nomirror 50"

echo "set mytics 5"
echo "set mxtics 5"

echo "set grid ytics back"
echo "set grid xtics back"
echo "set grid mxtics back"

echo "plot 'QLN.txt' with lines"
}

hlog_gnp() {
echo "set terminal png"
#echo "set title 'VDSL2 (Profile $PROFILE) - Line Characteristics [Hlog(f)]'"
echo "set title 'xDSL - Line Characteristics [Hlog(f)]'"
echo "set timestamp 'Data obtained $OBSTAMP                         Graph created %d/%m/%y %H:%M' 5,-1"

echo "set nokey"

echo "set ylabel 'Hlog (dB)'"
echo "set xlabel 'Tone (subcarrier index - 4.3125KHz spacing)'"

echo "set yrange [-100:0]"
echo "set xrange [0:256]"

echo "set ytics nomirror 10"
#echo "set xtics nomirror 250"
echo "set xtics nomirror 50"

echo "set mytics 5"
echo "set mxtics 5"

echo "set grid ytics back"
echo "set grid xtics back"
echo "set grid mytics back"
echo "set grid mxtics back"

echo "plot 'Hlog.txt' with lines"
}

# Remove redundant control characters from the data.
tr -d "\r" < $1 | tr -d "\007" > GDATA$$

# Set the DTSTAMP and the OBSTAMP variables.
DTSTAMP=$(awk '/ Plink / { print $4,$5 }' GDATA$$ | sed 's/\.//g; s/ /-/; s/://g' | cut -c1-13)
DATE=$(awk '/ Plink / { print $4 }' GDATA$$ | cut -c3- | awk -F. '{ print $3"/"$2"/"$1 }')
TIME=$(awk '/ Plink / { print $5 }' GDATA$$ | cut -c1-5)
if [ -z "$DTSTAMP" ]; then
DTSTAMP=$(date '+%Y%m%d-%H%M')
OBSTAMP="- unknown    "
else
OBSTAMP="$DATE $TIME"
fi

# Determine and announce the VDSL2 profile. Default to profile 17a, if undeterminable.
#PROFILE=$(awk '/VDSL2 Profile:/ { print $4 }' GDATA$$ | uniq)
#if [ -z "$PROFILE" ]; then
# PROFILE=17a
# echo "The VDSL2 profile could not be determined."
# echo "Defaulting to produce graphs for VDSL2 profile $PROFILE."
#else
# echo "Producing graphs for VDSL2 profile $PROFILE."
#fi

# Set the X-axis maximum, as per the profile.
#case $PROFILE in
# 8a) XMAX=2000 ;;
# 8b) XMAX=2000 ;;
# 8c) XMAX=2000 ;;
# 8d) XMAX=2000 ;;
# 12a) XMAX=4100 ;;
# 12b) XMAX=4100 ;;
# 17a) XMAX=4100 ;;
# 30a) XMAX=4100 ;;
#esac

# Extract the Bits data.
grep -A 256 "^Tone number      Bit Allocation" GDATA$$ | tail -n 256 > Bits.txt

# Extract the SNR data.
grep -A 256 "^Tone number      SNR" GDATA$$ | tail -n 256 > SNR.txt

# Extract the QLN data.
grep -A 256 "^Tone number      QLN" GDATA$$ | tail -n 256 > QLN.txt

# Extract the Hlog data.
grep -A 256 "^Tone number      Hlog" GDATA$$ | tail -n 256 > Hlog.txt

# Extract the pbParams data.
grep -A 21 "xdslcmd info --pbParams" GDATA$$ | expand - > pbParams.txt

# Extract the show data.
grep -A 13 "xdslcmd info --show" GDATA$$ | expand - > show.txt

# Create the graphs.
[ -s Bits.txt ] && bits_gnp | gnuplot 2>/dev/null > bits-$DTSTAMP.png
[ -s SNR.txt ]  && snr_gnp  | gnuplot 2>/dev/null > snr-$DTSTAMP.png
[ -s QLN.txt ]  && qln_gnp  | gnuplot 2>/dev/null > qln-$DTSTAMP.png
[ -s Hlog.txt ] && hlog_gnp | gnuplot 2>/dev/null > hlog-$DTSTAMP.png

# Create the pbParams image.
[ -s pbParams.txt ] && convert -size 640x -background white -fill black -font courier -pointsize 14 label:@pbParams.txt pbparams-$DTSTAMP.jpg

# Create the show image.
[ -s show.txt ] && convert -size 640x -background white -fill black -font courier -pointsize 14 label:@show.txt show-$DTSTAMP.jpg

# Create a landscape format montage.
#montage bits-$DTSTAMP.png qln-$DTSTAMP.png pbparams-$DTSTAMP.jpg snr-$DTSTAMP.png hlog-$DTSTAMP.png show-$DTSTAMP.jpg -quality 80 -geometry 640x480 -border 5 -tile 3x2 line_stats_l-$DTSTAMP.png 2>/dev/null

# Create a portrait format montage.
#montage bits-$DTSTAMP.png qln-$DTSTAMP.png snr-$DTSTAMP.png hlog-$DTSTAMP.png pbparams-$DTSTAMP.jpg show-$DTSTAMP.jpg -quality 80 -geometry 640x480 -border 5 -tile 2x3 line_stats_p-$DTSTAMP.png 2>/dev/null

# Remove the intermediate files.
rm -f GDATA$$ {Bits,SNR,QLN,Hlog,pbParams,show}.txt

exit 0

Attached, below, is the graph it has produced from the data that you provided in your previous post.
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

Loading

  • Reg Member
  • ***
  • Posts: 252
Re: GNU-PLOT
« Reply #2 on: April 27, 2014, 06:55:19 PM »

Sorry for windows and how would I input the right code?
Logged

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43614
  • Penguins CAN fly
    • DSLstats
Re: GNU-PLOT
« Reply #3 on: April 27, 2014, 07:30:45 PM »

Are you still using DSLstats? If so, it will plot QLN for you.
Logged
  Eric

Loading

  • Reg Member
  • ***
  • Posts: 252
Re: GNU-PLOT
« Reply #4 on: April 27, 2014, 08:14:58 PM »

Yeah i'm still using DSLstats, it's the best monitoring software i've used! ;D
Logged

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: GNU-PLOT
« Reply #5 on: April 27, 2014, 09:18:44 PM »

Sorry for windows and how would I input the right code?

  :(  Sorry, I don't do BGW (Billy Gates Ware a.k.a. Windoze).  :no:

If you really want to play with GNUplot on a BGW system, then Bald Eagle1 is the person to ask. I'm sure he has some code, archived away, somewhere in the eyrie.
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

loonylion

  • Reg Member
  • ***
  • Posts: 723
Re: GNU-PLOT
« Reply #6 on: April 27, 2014, 11:10:38 PM »

would it not run in cygwin?
Logged

Bald_Eagle1

  • Helpful
  • Kitizen
  • *
  • Posts: 2721
Re: GNU-PLOT
« Reply #7 on: April 27, 2014, 11:44:31 PM »


  :(  Sorry, I don't do BGW (Billy Gates Ware a.k.a. Windoze).  :no:

If you really want to play with GNUplot on a BGW system, then Bald Eagle1 is the person to ask. I'm sure he has some code, archived away, somewhere in the eyrie.

I have attached a very trimmed down version of a graphing batch file script.



For it to work, you would have to do these things:-

Unzip the batch file to a folder of your choice.

Edit the relevant row in the batch file to confirm the path to where you have installed gnuplot.

This is where it is on my system:-

PATH="C:\Program Files\gnuplot\binary"


Save the raw QLN data to a file named QLN_data.txt.

Edit the saved file to remove the row containing the text "Tone number      QLN".


Drag & drop the QLN_data.txt file onto the batch file's icon.


You should then see the attached graph in the folder containing the QLN_data.txt file



Logged

Loading

  • Reg Member
  • ***
  • Posts: 252
Re: GNU-PLOT
« Reply #8 on: April 28, 2014, 07:15:52 AM »

Thanks very much for all the help! :graduate:
Logged