Modifying .cc file of gr_peak_detector. Change number of output ports?

Hello all,
I try to modify the C++ code of the
The peak_detector gives only 1 or 0 out if it found a peak. I want that
will give me also where the peak is and the amplitude of the peak.
My questions are:

  • Which variables in the code can give me these information (amplitude,
    of occur) ?
  • At the moment gr_peak_detector2 has only one output, how can I change
    to get 2 or more outputs ?

Thanks in advance for for reply.

View this message in context:
Sent from the GnuRadio mailing list archive at

On Tue, May 18, 2010 at 12:29:17AM -0700, grc007 wrote:

Thanks in advance for for reply.

If you look at the code, you will see that it will output either one
or two streams of information. The first stream is the peak/no-peak
information. The second stream (float), is the current average at
that sample.

To figure out when it occurred, you can count samples.