Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

VLF vs PI SHOOTOUT PROJECT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    ... and here is the manual ground balance mode ( PUMP button added )

    Click image for larger version

Name:	image.png
Views:	178
Size:	217.3 KB
ID:	441683

    Comment


    • #32
      This is impressive! Have you tested it out with any actual targets in the ground?

      Comment


      • #33
        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


        • #34
          ..added bluetooth audio for targets, haptic feedback option ( phone vibrates on target ) and cleaned up the user interface.

          Click image for larger version

Name:	image.png
Views:	148
Size:	174.4 KB
ID:	441728

          Comment


          • #35
            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


            • #36
              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


              • #37
                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


                • #38
                  Click image for larger version  Name:	image.png Views:	0 Size:	57.3 KB ID:	442256

                  Click image for larger version

Name:	image.png
Views:	87
Size:	61.7 KB
ID:	442257​​
                  Click image for larger version

Name:	image.png
Views:	85
Size:	73.4 KB
ID:	442258Click image for larger version

Name:	image.png
Views:	80
Size:	16.5 KB
ID:	442259Click image for larger version

Name:	image.png
Views:	84
Size:	113.6 KB
ID:	442260

                  Comment


                  • #39
                    Click image for larger version

Name:	image.png
Views:	92
Size:	78.6 KB
ID:	442262Click image for larger version

Name:	image.png
Views:	92
Size:	126.6 KB
ID:	442263Click image for larger version

Name:	image.png
Views:	91
Size:	72.6 KB
ID:	442264Click image for larger version

Name:	image.png
Views:	88
Size:	61.5 KB
ID:	442265Click image for larger version

Name:	image.png
Views:	86
Size:	87.3 KB
ID:	442266Click image for larger version

Name:	image.png
Views:	90
Size:	208.3 KB
ID:	442267Click image for larger version

Name:	image.png
Views:	86
Size:	76.5 KB
ID:	442268Click image for larger version

Name:	image.png
Views:	88
Size:	121.1 KB
ID:	442269Click image for larger version

Name:	image.png
Views:	86
Size:	121.8 KB
ID:	442270

                    Comment


                    • #40
                      ...too much cutting and pasting to document this ... The thread is closed.

                      See the FCMD project.

                      Comment

                      Working...
                      X