S
Stephen Greenwood
Guest
I'm writing a SKILL function to count the number of crossings in a
waveform object. After some poking around in the SKILL ADE Reference,
I managed to write the following:
procedure( crossCount( inWave crosspt edgeType )
crossWave = cross(inWave crosspt 0 edgeType t "time")
numberOfCrossings = drVectorLength(drGetWaveformYVec(crossWave))
)
where the arguments are as follows:
inWave (waveform)
crosspt (float)
edgeType (string ["rising" | "falling" | "either"] )
The idea is to use the cross function to capture all crossings of a
user-defined threshold "crosspt", then get the length of one of the
vectors returned from that cross() function. (In this case I chose the
YVec.) So numberOfCrossings returns an integer, and it works fine when
"inWave" is a single waveform.
However, when "inWave" is a family of waveforms, the function does not
do what I want it to. It returns a single integer, whereas I want it
to return a vector of integers. Can anyone suggest a way to accomplish
this? I'm not so concerned about the type of the data returned
(integer or float), as long as I can get the information somehow.
Thanks for any help you can provide,
Stephen Greenwood
waveform object. After some poking around in the SKILL ADE Reference,
I managed to write the following:
procedure( crossCount( inWave crosspt edgeType )
crossWave = cross(inWave crosspt 0 edgeType t "time")
numberOfCrossings = drVectorLength(drGetWaveformYVec(crossWave))
)
where the arguments are as follows:
inWave (waveform)
crosspt (float)
edgeType (string ["rising" | "falling" | "either"] )
The idea is to use the cross function to capture all crossings of a
user-defined threshold "crosspt", then get the length of one of the
vectors returned from that cross() function. (In this case I chose the
YVec.) So numberOfCrossings returns an integer, and it works fine when
"inWave" is a single waveform.
However, when "inWave" is a family of waveforms, the function does not
do what I want it to. It returns a single integer, whereas I want it
to return a vector of integers. Can anyone suggest a way to accomplish
this? I'm not so concerned about the type of the data returned
(integer or float), as long as I can get the information somehow.
Thanks for any help you can provide,
Stephen Greenwood