Add FilterPicker phase detection and picking algorithm#184
Add FilterPicker phase detection and picking algorithm#184Donavin97 wants to merge 11 commits intoSeisComP:mainfrom
Conversation
|
Thank you @Donavin97 for your tremendous effort. The code is looking good and comprehensively documented. Let me nevertheless start a discussion about this implementation. You have implemented it as a picker which means that |
|
Hi @Jabe. |
- Implement FilterPicker characteristic function as InPlaceFilter - Allows CF to be used independently from the picker - Can be used as preprocessing filter in scautopick - Available for custom processing chains and analysis - Updated filterpicker plugin to use the new InPlaceFilter - Added documentation for InPlaceFilter usage Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Document how to use FilterPickerCF as preprocessing filter - Add example configuration for scautopick - Add C++ code example for programmatic usage - Explain benefits of CF preprocessing Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Fix ButterworthBandpass to use IIR namespace - Fix member initialization order to match declaration - Add SEISCOMP_COMPONENT define Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Use constructor with parameters instead of setup() - Apply filter to inputData, not original data - Fix apply() call to use (count, data) signature Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Hi again @Jabe. |
- These variables are now internal to FilterPickerCF InPlaceFilter - Simplified debug output Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add REGISTER_INPLACE_FILTER macro for FilterPickerCF - Filter can now be used by name: FILTERPICKERCF - Enables use in scautopick configuration Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Required for proper template instantiation - Filter name: FILTERPICKERCF Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Changed to 3 parameters: numBands, minFreq, maxFreq - Creates multiple logarithmically-spaced frequency bands - Combines CFs using maximum across all bands - Registered with short name: FP - Usage: FP(5, 1.0, 20.0) or FP(numbands, lowfreq, highfreq) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Cannot register same class twice - Use short name FP as primary Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Good morning @Jabe. |
|
You last commit has nothing to do with this PR. Please use another branch. |
|
Your filter implementation is time window based and does not work incrementally. I know that this is a difficult part of any filter implementation but it is crucial for how it works. The apply method receives input data but that is not a fixed time window, it is just a chunk of data will be extended later on. Let me explain that with a simple code example: vector<double> samples, samples2;
samples.resize(100);
// TODO: Initialize your samples here
// Copy the array to compare it later
samples2 = samples;
{
ABC filter;
filter.setSamplingFrequency(20);
// Filter 100 samples at one time
filter.apply(samples.size(), samples.data());
// The result is now in samples
}
{
ABC filter;
filter.setSamplingFrequency(20);
// Feed each samples individually
for ( double v : samples2 ) {
filter.apply(1, &v);
}
// The result is now in samples2
}
// Both results must be equal
assert(samples == samples2);This is especially important when using chains as with the filter grammar. I don't think that your implementation works that way. Would you agree? |
|
Hi @Jabe. |
- Create FilterPickerCF as InplaceFilter in math/filter/ - Implements characteristic function computation incrementally - Produces identical results for bulk and sample-by-sample processing - Filter maintains state between apply() calls via IIR filter memory - Registered as 'FP' filter plugin for use in filter chains - Can be combined with any picker (AIC, STALTA, etc.) Usage: picker.filter = "FP(5,0.5,20)" picker = AIC picker.filter = "FP(5,0.5,20)" Fixes PR SeisComP#184 review comment by @gempa-jabe: - Filter now works incrementally (not time-window based) - Properly integrates with filter chains - Separates CF computation from detection logic Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Summary
This PR adds a C++ implementation of the FilterPicker algorithm for SeisComP, based on the work of Lomax et al. (2012). FilterPicker is a robust, broadband phase detector and picker suitable for real-time seismic monitoring and earthquake early-warning systems.
Algorithm Overview
FilterPicker operates on multiple frequency bands simultaneously and uses characteristic functions to detect and pick seismic phases:
Features
Files Added
filterpicker.hfilterpicker.cppCMakeLists.txtfilterpicker.cfgfilterpicker_profile_example.cfgREADME.mddescriptions/filterpicker.rstdescriptions/global_filterpicker.xmlConfiguration
The picker is configured via standard SeisComP configuration parameters:
Performance
Testing
The implementation has been tested with:
References
Lomax, A., Satriano, C., & Vassallo, M. (2012). Automatic picker developments and optimization: FilterPicker - a robust, broadband picker for real-time seismic monitoring and earthquake early-warning. Seismological Research Letters, 83(3), 531-540. https://doi.org/10.1785/gssrl.83.3.531
Original implementation: http://alomax.free.fr/FilterPicker/
Checklist
Implementation based on: FilterPicker algorithm by Anthony Lomax
Adapted for SeisComP by: Donavin Liebgott