Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SKILL: How to convert a waveform object into a list?

2,655 views
Skip to first unread message

Bernd Fischer

unread,
Aug 17, 2006, 11:56:52 AM8/17/06
to
Hi,

I'm curios if it is possible to convert a
waveform object into a list?


I knew that I can use 'ocnPrint', e.g.
ocnPrint( o_wave ?output t_file )
to print a waveform object into a file.

But I want to postprocess the data before
I write them to a file. And I didn't want to
do a cost effective file out, file in and file out
again.

Thanks Bernd

Svenn Bjerkem

unread,
Aug 17, 2006, 1:06:17 PM8/17/06
to

How about using some of the functions that Andew use to create
waveforms with new xaxis in his abChangeXAxis function? I just saw it
the other day when the question plot somewave vs otherwave in ocean
showed up again. drGetWaveform* should also give some hits in
cdsFinder.

I personally don't like the way ocnPrint formats the data because it is
more or less useless without further processing. I need to move a lot
of ocnPrint data over in excel to postprocess because we haven't
discovered qtiplot, or labplot in my company yet. (But I would rather
like to have something that perl can read in to use
Spreadsheet::WriteExcel perl module)

Any perl hackers out there who have time and energy to write a wrapper
around the psf executable to extract data from the psfbin waveform data
on a command line base. (No OCEAN here) I would gladly cooperate.

--
Svenn

Andrew Beckett

unread,
Aug 18, 2006, 2:30:51 AM8/18/06
to

A SKILL function to do what Bernd wants:

/* abWaveToList.il

Author A.D.Beckett
Group Custom IC (UK), Cadence Design Systems Ltd.
Language SKILL
Date Nov 17, 2003
Modified
By

Convert a waveform to a list

***************************************************

SCCS Info: @(#) abWaveToList.il 11/17/03.15:08:15 1.1

*/

/************************************************************************
* *
* (abWaveToList wave @key transpose) *
* *
* Take a waveform object, and return it as a list of xy pairs. Or *
* if transpose is set, it returns a list of x values followed by a list *
* of y values. *
* *
************************************************************************/


(procedure (abWaveToList wave @key transpose)
(let (xList yList xyList len
(xVec (drGetWaveformXVec wave))
(yVec (drGetWaveformYVec wave))
)
(setq len (drVectorLength xVec))
;-----------------------------------------------------------------
; Return value of this if is the list
;-----------------------------------------------------------------
(if transpose
(progn
(for i 0 (sub1 len)
(setq xList (tconc xList (drGetElem xVec i)))
(setq yList (tconc yList (drGetElem yVec i)))
)
(list (car xList) (car yList))
)
; else
(progn
(for i 0 (sub1 len)
(setq xyList (tconc xyList (list (drGetElem xVec i)
(drGetElem yVec i))))
)
(car xyList)
)
) ; if
) ; let
) ; procedure

Andrew.
--
Andrew Beckett
Principal European Technology Leader
Cadence Design Systems, UK.

Bernd Fischer

unread,
Aug 18, 2006, 4:28:51 AM8/18/06
to
Thanks guys, especially Andrew, this helps me to move further.

Cheers Bernd

Sylvio Triebel

unread,
Sep 12, 2006, 7:52:36 AM9/12/06
to
Hi Andrew,
do you have an estimation, how fast this conversion would be
compared with ocnPrint (which is probably a native implementation)?

Thanks,
Sylvio

Andrew Beckett

unread,
Oct 8, 2006, 11:35:06 AM10/8/06
to
On Tue, 12 Sep 2006 13:52:36 +0200, Sylvio Triebel <Sylvio....@nospam.com>
wrote:

>Hi Andrew,
>do you have an estimation, how fast this conversion would be
>compared with ocnPrint (which is probably a native implementation)?
>
>Thanks,
>Sylvio
>

I don't think there would be much in it. I've not done any profiling, but I
expect it to be similar speed.

ign...@gmail.com

unread,
Jul 3, 2019, 12:15:31 PM7/3/19
to
On Thursday, August 17, 2006 at 2:06:17 PM UTC-3, Svenn Are Bjerkem wrote:
> Any perl hackers out there who have time and energy to write a wrapper
> around the psf executable to extract data from the psfbin waveform data
> on a command line base. (No OCEAN here) I would gladly cooperate.

Hi Svenn,

Why not use nutbin format? It is very easy to parse.

Regards
Ignacio
0 new messages