patch-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch-gnuradio] Typo in gr_peak_detector_XX.cc.t


From: Andreas Müller
Subject: [Patch-gnuradio] Typo in gr_peak_detector_XX.cc.t
Date: Fri, 11 Apr 2008 11:49:17 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20080229)

Hello 

gr.peak_detector_fb sometimes detects the peaks at a later position than
they actually are.

It looks to me, like this happens when the peak is in one bunch of
samples, but the values stay above the threshold until the next bunch. 

If I understand this correctly, in this case, the work function will get
the same samples again and again, and the last return in
gr_peak_detector_XX.cc.t will always return 1, until all samples have
been "processed", and the peak is moved to the first sample of the next
bunch.

The patch below fixes it for me.

Regards, Andreas

Index: gnuradio-core/src/lib/gengen/gr_peak_detector_XX.cc.t
===================================================================
--- gnuradio-core/src/lib/gengen/gr_peak_detector_XX.cc.t       (revision 8183)
+++ gnuradio-core/src/lib/gengen/gr_peak_detector_XX.cc.t       (working copy)
@@ -105,6 +105,6 @@
   }
   else {   // only return up to passing the threshold
     //printf("Leave in State 1, only produced %d of 
%d\n",peak_ind,noutput_items);
-    return peak_ind+1;
+    return peak_ind;
   }
 }

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]