... and here is the manual ground balance mode ( PUMP button added )
Announcement
Collapse
No announcement yet.
Announcement
Collapse
No announcement yet.
VLF vs PI SHOOTOUT PROJECT
Collapse
X
-
not yet ... still testing hardware codecs and how fast the phone can do DSP. I have tested two codecs one from Arturia and another from M-Audio .. they both work fine straight from the USB port on the phone, didnt have to load any drivers. The older samsung phones with audio ports built in work fine too.
There is alot of debug software running to show me what is happening in the DSP signal chain ... so for ground testing I will turn that off and simplify the user screen.
I have to go down the toy shop tomorrow and buy some plugs and stuff to rig the coils up and then see where we will go.
Comment
-
I have been looking after a friends farm and have no time till now to do anything else ( feeding, chasing, dogs running away, animals died, equipment breaks down, water runs out, fences break .... repeat every day LOL )
Project status report :
Project Overview
FCMD is an Android metal detector application using IQ demodulation and VDI (Variable Discrimination Index) target identification.
Current Status
Recent Work
- Latest commit: "Working version: Multi-tone IQ demodulator with configurable frequencies"
- Multiple modified files with uncommitted changes
- Recently added sophisticated audio feedback system
Core Features Implemented
1. Multi-tone IQ Demodulation
- Configurable tone count: 2-24 tones
- Frequency range: 1000-20000 Hz (logarithmic control)
- Stereo IQ demodulation (left/right channels)
- 40 Hz update rate with IIR filtering
2. VDI Target Identification
- 0-99 VDI scale for metal classification
- Real-time target confidence calculation
- Visual VDI display with target descriptions
- Phase slope and conductivity analysis
3. Ground Balance System
- 4 modes: OFF, Manual, Auto Track, Manual+Track
- Pump-based manual ground balance capture
- Offset adjustment (-50 to +50)
- Real-time status reporting
4. Audio Feedback (newly implemented)
- Musical pentatonic scale (15 notes, 261-1760 Hz)
- VDI-to-tone mapping for target identification
- Confidence-based pulsing (continuous vs 3Hz pulse)
- Stereo output: L=TX signal, R=Target audio
- Volume control (0-100%)
5. Haptic Feedback
- Vibration on high-confidence targets (>80%)
- Cooldown system to prevent excessive vibration
- Toggle on/off capability
6. UI Features
- Debug panel with waveform and spectrum views
- Real-time IQ analysis display
- Ground balance controls
- Audio/haptic feedback controls
- Info screen with tone configuration
Technical Details
- Platform: Android (minSdk 24, targetSdk 35)
- Language: Kotlin
- Native code: CMake/C++ (audio engine)
- Sample rate: 48 kHz
- Permissions: Audio recording, Bluetooth, vibration
Modified/New Files (Uncommitted)
- Core components: AudioEngine.kt, IQDemodulator.kt, MainActivity.kt
- New classes: AudioToneGenerator.kt, BluetoothAudioManager.kt, GroundBalanceManager.kt, VDICalculator.kt, VDIDisplayView.kt
- UI layouts and resources updated
- Documentation: AUDIO_FEEDBACK.md added
Build Configuration
- Gradle Kotlin DSL
- ViewBinding enabled
- CMake native build
- Version 1.0 (versionCode 1)
Comment
-
The original project was using "stereo" RX coils for greater depth and disc ... but now flipped back to mono to lower DSP requirement for older phones / standard coils.
✓ 50% reduction in DSP processing - Only demodulating one channel instead of two
✓ Simpler hardware interface - Single TX coil → Left out, Single RX coil → Left in
✓ Preserved all functionality -VDI, ground balance, confidence calculation unchanged
✓ Right channel freed - Available for target audio feedback to headphones
✓ Cleaner architecture - Less code complexity, easier to maintain
Audio Routing (Stereo USB Codec)
- Left Out → TX coil amplifier (multi-tone signal)
- Left In ← RX coil preamplifier (detected signal)
- Right Out → Headphones (VDI target audio feedback)
- Right In → Unused
DSP Performance Analysis
Configuration Parameters
- Sample Rate: 44,100 Hz
- Buffer Size Multiplier: 2x
- Typical Android minimum buffer: ~1024 samples for mono at 44.1kHz
- Actual buffer size: 1024 × 2 = 2048 samples (mono)
Audio Callback Rate
Callback Rate = Sample Rate / Buffer Size
= 44,100 / 2,048
= ~21.5 callbacks/second
Processing Load Per Callback (24 tones max)
Before (Stereo):
- IQ Demodulation: 24 tones × 2 channels × 2048 samples = 98,304 operations
- Per tone operations: 2048 × (2 cos + 2 sin + 6 multiply + 4 add) = ~32,768 ops/tone
- Total: ~786,432 operations per callback
After (Mono):
- IQ Demodulation: 24 tones × 1 channel × 2048 samples = 49,152 operations
- Per tone operations: 2048 × (1 cos + 1 sin + 3 multiply + 2 add) = ~16,384 ops/tone
- Total: ~393,216 operations per callback
Reduction: ~50% fewer operations ✓
Comment
-
actual performance from debug logging .. no dropped samples :-)
2025-11-08 13:07:05.023 15426-15492 IQDemodulatorDSP com.example.fcmd D Actual callback rate: 22.5 Hz, Buffer size: 1920 samples, Latency: 43.5 ms
2025-11-08 13:07:06.024 15426-15492 IQDemodulatorDSP com.example.fcmd D Actual callback rate: 23.0 Hz, Buffer size: 1920 samples, Latency: 43.5 ms
2025-11-08 13:07:07.033 15426-15492 IQDemodulatorDSP com.example.fcmd D Actual callback rate: 22.8 Hz, Buffer size: 1920 samples, Latency: 43.5 ms
2025-11-08 13:07:08.062 15426-15492 IQDemodulatorDSP com.example.fcmd D Actual callback rate: 23.3 Hz, Buffer size: 1920 samples, Latency: 43.5 ms
2025-11-08 13:07:09.103 15426-15492 IQDemodulatorDSP com.example.fcmd D Actual callback rate: 23.1 Hz, Buffer size: 1920 samples, Latency: 43.5 ms
2025-11-08 13:07:10.142 15426-15492 IQDemodulatorDSP com.example.fcmd D Actual callback rate: 23.1 Hz, Buffer size: 1920 samples, Latency: 43.5 ms
Comment

Comment