[Kst] Number formats in ASCII data file

Barth Netterfield netterfield at astro.utoronto.ca
Tue Jun 12 21:16:12 UTC 2012

On Tue, Jun 12, 2012 at 11:51 AM, Svenn Are Bjerkem <
svenn.bjerkem at googlemail.com> wrote:

> Hi,
> I have an ASCII log file from an Agilent logic analyzer which gives me
> hedadecimal numbers in signed 12-bit format from a quadrature ADC.
> 1,fff,002,001,ffe
> 0,ffe,fff,000,fff
> 1,000,001,fff,ffe
> 0,fff,ffd,000,001
> ....
> The first column is indicating I (1) or Q (0) and the following values
> are the 12-bit data values from four ADCs operating in parallell using
> the same clock.
> So far I have used an awk script to extract all I-lines and Q-lines
> separately and convert them to signed decimal and write to two files
> and then read those two files into kst2. I wonder if there is a way
> inside kst to sample every line starting with 0 and put into one
> vector, and then sample every line starting with 1 and put into
> another vector. The next thing is the conversion of fff to -1 and so
> on. Usually hexadecimal numbers are prefixed with 0x, but that is not
> done by this Agilent device.
> I have a workaround through the awk script, but I wonder if this kind
> of number filtering and conversion is already available in kst, or if
> it is something I can write a plugin to achieve.

A plugin could be written.  On the other hand...

> Advantage would be to
> have the logic analyzer stream the data on a network connection
> directly into kst.

You could probably achieve this with "tail -f" supplying your awk script,

% tail -f file_Agilent_Is_Dumping_To.dat | awk yourcommand.awk >
ascii_file.dat &
% kst ascii_file.dat -n 100 -y 1 -y 2

This should give you happy real-time kst fun.

In case somebody wonders why I don't use signed decimal representation
> on the logic analyzer, it is because the same data will be used in a
> VHDL testbench which is optimized for reading the 12-bit numbers on
> exactly this format.
> I am using kst 2.0.3 as that is the latest version available in Debian
> unstable.

You will have a far far better experience with kst 2.0.5

We should look into getting that package into debian!

> --
> Svenn
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst

C. Barth Netterfield
University of Toronto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kst/attachments/20120612/932abc79/attachment.html>

More information about the Kst mailing list