Hello all, I'm trying to find the series resonant frequency of an RF component, which is where the component reactance switches from positive to negtive or vice-versa.
Given an N-vector PDL of sorted elements, I need to know at what index it switches from positive to negative. Here are some examples; in real life these are real values from physical measurements, so they are never going to be nice round integers---but you can assume they will be sorted in ascending or descending order. Example 1: pdl> p sequence(10)-5 [-5 -4 -3 -2 -1 0 1 2 3 4] ^^ I need to know "index 4" is the place at which it switches. Example 2: pdl> p ((-sequence(10))+5+rand()) [ 5.3332316 4.3332316 3.3332316 2.3332316 1.3332316 0.33323163 -0.66676837 -1.6667684 -2.6667684 -3.6667684] ^^^^^^^^^^ In this floating-point example it would be "index 5" Is there already a "PDL-broadcast-way" of doing this? How would you do it? -- Eric Wheeler _______________________________________________ pdl-general mailing list pdl-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-general