Open CamphynR opened 2 weeks ago
@CamphynR thank you for this module! I have a few general remarks:
trace.get_spectrum
(the trace class stores the data internally either in the time or frequency domain depending on the last time it was used and with that you might save one fourier transformation. You can still have a function with does the transformation but this is than not used with in the module (does that make sense?).So for example find_frequency_peaks
should take the frequency spectrum but you could add a wrapper to take also the time series.
Thanks for the feedback. I tried implementing it in such a way that the code only uses the get_spectrum and get_trace methods to switch between time and frequency domains. Since the notch filter can only be applied directly on the time trace I think it's difficult to leave out any transforms but this should be more streamlined. I also added a trace wrapper for find_frequency_peaks
Inclusion of basic cw filter to NuRadioMC which uses notch filters on peaks in the frequency spectrum. The threshold for defining a peak and the width of the notch filter can be modified by parameters in the module begin() function.
This filter would serve as a quick option for people who want to filter CWs in their current work. The notch filter filters out a very narrow band around the frequency peak. To narrow(broaden) the band, increase(decrease) the parameter Q. To be more(less) strict with what to consider a CW, increase(decrease) the threshold parameter.
Note that this filter would not be extremely accurate but can be of use for its speed before the more sophisticated ARA/sine reduction filter is implemented in NuRadio (see /https://github.com/nichol77/libRootFftwWrapper)