[Top][All Lists]

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

Re: [Discuss-gnuradio] new peakfinding and averaging wxgui fft code (and

From: James Cooley
Subject: Re: [Discuss-gnuradio] new peakfinding and averaging wxgui fft code (and dummy block has huge impact on usability fir filter)
Date: Tue, 01 Feb 2005 15:30:21 -0500
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

Speaking of averaging and peak-detection, I'm interested in doing so outside of the gui.

Could you build an averager like this, with fir filters applied to the fft of the signal? Would it work? Is there a better way?

-take fft of signal (much as fft_sink does)

-Run fft output through an averager to smooth it out a bit:
FIR filter with taps [1/N,1/N,1/N,1/N,1/N,1/N...] up until N number of samples you want to average over. (A running average FIR filter)
averager = gr.fir_filter_fff(1, taps)

-run filter to find some peaks. Can this be done by constructing a FIR with taps [1,-1] and then noting where the 0 crossings take place? These taps should be equivalent to:
y[n] = -1*x[n] + 1*x[n+1]
which is like the slope.... derivative in continuous functions.... over a pair of samples.

-probably you'd want to also use a threshold on the original fft signal to weed out insignificant peaks?



Martin Dvh wrote:

Eric I am Recompiling now (again;-).
I don't know if I will be doing the testing tonight (It is kind of late here in the Netherlands)

I did however also finish my modified fft_sink in wxgui and put in on my website. I added the (default) option to average over several fft frames (default 100)
This gives a much quiter spectrum

The most interesting feature I also added is a peakfinding algorithm.
The spectrumwindow can now find peaks and shows the exact frequency and signal level of these peaks.

def make_fft_sink_f (fg, parent, label, fft_size, input_rate,show_peak_info=False,show_peak_markers=False,navg_frames=100,peak_searchwidth=-1): #show_peak_info (default=False): if set to true the fft_window will show the frequency and level of every big peak found in the spectrum #show_peak_markers (default=False): if set to true the fft_window will show a marker at every big peak found in the spectrum #navg_frames (default=100): number of fft frames to average before showing it. If set to 100 or higher you get a much quiter spectrum (less noisy and not changing very much every frame) #peak_search_width(-1 gets you the default of 10 for a fft_size of 1024): number of neigbours the peakfinding algorithm will look at for determing if something is a peak. # A higher value means you get less peaks detected #Default the peakfinding algorithm determines a minimum signalstrength threshold below which no peaks are detected # you can override this with set_autopeakthreshold(False) and set_peakthreshold(mythreshold) to use your own threshold
    # the higher the threshold, the less peaks found

I modified Makefile.am,fftsink.py and added peakfind.py
You can all find them on:

I ported peakfind.py fromjava code from:
#ported from  YALE - Yet Another Learning Environment
#  Copyright (C) 2001-2004
#      Simon Fischer, Ralf Klinkenberg, Ingo Mierswa,
#          Katharina Morik, Oliver Ritthoff
#      Artificial Intelligence Unit
#      Computer Science Department
#      University of Dortmund
#      44221 Dortmund,  Germany
#  email: address@hidden
#  web:   http://yale.cs.uni-dortmund.de/java
Which is GPL

The files need to be put into:

I also tried to make a diff against cvs.
It is at http://www.olifantasia.com/projects/gnuradio/mdvh/wxgui/fft_avg_and_peakfind.diff But cvs diff does not seem to add any new local files. So you have to still add peakfind.py manually.

How do I tell cvs diff to include local new files ???


Discuss-gnuradio mailing list

reply via email to

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