feat: SG Filter on/off 토글 추가 (Settings 패널)
- PiezoEchoAnalyzer.useSgFilter: true/false로 SG 필터 on/off - OFF 시 raw ADC 그대로 low-echo detection에 사용 - Settings 패널에 Switch 토글 추가 (기본 ON) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -213,9 +213,10 @@ class PiezoEchoAnalyzer private constructor() {
|
||||
|
||||
// ── Denoising Pipeline ──
|
||||
|
||||
/** SG 디노이징 (6ch 알고리즘: TVD 제거, SG만 사용) */
|
||||
var useSgFilter: Boolean = true
|
||||
|
||||
fun denoise(signal: DoubleArray): DoubleArray {
|
||||
return sgSmooth(signal)
|
||||
return if (useSgFilter) sgSmooth(signal) else signal.copyOf()
|
||||
}
|
||||
|
||||
/** 1D Total Variation Denoising — Chambolle (2004) dual projected gradient */
|
||||
|
||||
+20
@@ -681,6 +681,26 @@ fun PiezoMonitoringView(appState: AppState) {
|
||||
|
||||
HorizontalDivider()
|
||||
|
||||
// SG Filter toggle
|
||||
var sgEnabled by remember { mutableStateOf(analyzer.useSgFilter) }
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text("SG Filter", fontSize = 14.sp, fontWeight = FontWeight.SemiBold)
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
Switch(
|
||||
checked = sgEnabled,
|
||||
onCheckedChange = {
|
||||
sgEnabled = it
|
||||
analyzer.useSgFilter = it
|
||||
},
|
||||
colors = SwitchDefaults.colors(checkedTrackColor = MlPrimary)
|
||||
)
|
||||
}
|
||||
|
||||
HorizontalDivider()
|
||||
|
||||
Row {
|
||||
Text("Max Volume", fontSize = 14.sp, fontWeight = FontWeight.SemiBold)
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
|
||||
Reference in New Issue
Block a user