Announcement

Collapse
No announcement yet.

VLF MD with digital signal processing : Bee-Buzz 1

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

  • Detectorist#1
    replied
    Hi Atul,

    It is interesting how low noise OpAmp needs VLF MD for first Rx stage. You mention using of TL072 ( 18nV sqr Hz at 1KHz) and OPA2134 (8nV sqr Hz at 1KHz) is possible. How to calculate the real value of the voltage noise of OpAmp allowed to use for first Rx stage in VLF MD?

    Leave a comment:


  • Atul Asthana
    replied
    Here are some details I managed to gather about the Garrett AT Pro (current internet price of around USD 600/-) which appears to be similar or more advanced version of what we are aiming for. However, I am uncertain about the accuracy of this information below. I also came across mentions of attempts to reverse engineer the Garrett AT Pro.

    I couldn't find specifics about the weakest target it can detect or the total gain in its signal chain. That said, it might be possible for us to achieve similar performance with our detector.

    While I am unsure about the overall performance of this detector compared to current detectors in the same price range, we could attempt to compare its technical specifications with our expected performance.

    The Garrett AT Pro employs advanced digital signal processing (DSP) to detect and discriminate metallic targets. It begins with the RX coil capturing weak electromagnetic signals, which are amplified and digitized using a 12-16 bit ADC, sampling at ~100 kHz. A microcontroller or DSP (likely an ARM Cortex-M4/M7) processes this data in real-time.

    Digital filtering isolates the detector's operating frequency (15 kHz) while removing ground noise and interference using adaptive algorithms. Phase and amplitude analysis, often involving cross-correlation and Hilbert transforms, determine the target's conductivity. Proprietary lookup tables and pattern recognition algorithms identify specific metals by comparing signal characteristics to pre-stored profiles.

    Depth estimation is achieved by analyzing signal attenuation, while proportional audio tones reflect the target’s depth and conductivity. Advanced features include Iron Audio, which uses separate signal paths to detect ferrous materials, and Ground Balance, which compensates for mineralized environments by dynamically adjusting ground phase response.

    The hardware includes a crystal oscillator for the TX coil, low-noise amplifiers for signal conditioning (e.g., TL072/OPA2134), and efficient power management for portable operation. Digital signal pipelines involve ADC, band-pass filtering, and discrimination, culminating in real-time visual and audio feedback. The exact chipsets and algorithms are not in the open.​

    Technical Details:
    • Submersible: The AT Pro is submersible to 10 feet, making it suitable for underwater use in lakes, rivers, and even saltwater beaches.
    • Frequency: The AT Pro operates at 15 kHz, which is generally considered a good frequency for finding both gold and silver coins.
    • Coil: The AT Pro comes standard with an 11-inch DD coil, but other coil options are available, including an 8-inch DD coil and a larger concentric coil.
    • Ground Balance: The AT Pro has an automatic ground balance feature that makes it easy to adjust to different soil conditions.
    • Discrimination: The AT Pro has adjustable discrimination settings that allow you to filter out unwanted targets like iron.
    • Notch Feature: The AT Pro has a notch feature that allows you to eliminate specific targets, such as pull tabs, from your detection.
    • Iron Audio: The AT Pro has an iron audio feature that allows you to hear the sound of iron targets, even when they are being discriminated out.
    • Pinpoint: The AT Pro has a pinpoint feature that helps you locate the exact position of a target.
    • Depth Indication: The AT Pro provides an estimated depth reading for detected targets.
    Performance Details:
    • Depth: The AT Pro demonstrated good depth performance in the video, detecting a quarter at 10 inches and a dime at 8 inches in challenging soil conditions.
    • Sensitivity: The AT Pro is a sensitive detector, capable of picking up small and deeply buried targets.
    • Recovery Speed: The AT Pro has a fast recovery speed, allowing you to quickly detect multiple targets in close proximity.
    • Stability: The AT Pro is a stable detector, even in high-mineralization areas.
    • Ease of Use: The AT Pro is relatively easy to use, with simple controls and a user-friendly interface.
    points to be noted (differences and similarities) :
    1. tx frequency is 15 khz as against 6 khz of ours, if recommended, we can also change to some higher frequency.
    2. rx sampling is around 100 ksps (I guess, must be around 120 khz : 8 times per sinewave.
    3. tx sine is generated by xtal.
    4. adc could be 12 to 16 bits.
    5. an ARM processor is used.
    6. uses adaptive filtering.
    6. uses hilbert transform/FFT for phase+amplitude detection.
    7. uses pattern recohnition and lookup tables for target identification.
    8. dynamic ground balancing.
    ​​​​​​
    please comment on our design, and changes that we should carry out, without overwhelming the processor.

    --------------


    ​

    Leave a comment:


  • ivconic
    replied
    Originally posted by moodz View Post


    No I have not made it ... but Ivica might like it because it uses ESP32 .
    IMHO Noise specs are not relevant till the noise is specified with respect to bandwidth ... and also if the noise is synchronous with the wanted signal elements. Generally speaking non synchronous wideband noise has little effect on the wanted synchronous components. - in oversampling schemes .. noise at the input actually helps.
    A wideband software defined radio has no preselectors at its wideband input but can resolve less than 1 Hertz of bandwith signal in an input bandwidth spanning 10s of Mhz. Lock in amplifiers are an extreme example of this and can recover signals below the wideband noise floor at the input ... in fact the lock in amp will recover the phase and amplitude of a signal well below the input noise floor ( if the TX phase and frequency is known --- CRITICAL POINT 1 ). If the signal is very weak then you just integrate the phase and amplitude for longer. Sampling ADCs use a modulator to do the sampling .... the sampling frequency adds convolution noise to the samples .. almost impossible ( cant be filtered ) to remove once its in the data so care in choice of sampling frequency for high performance systems..CRITICAL POINT 2. The sweep speed of the coil determines the target detection passband ( for most handheld detectors this will be from DC to 10 hertz for example ) this is the demodulation target bandwith CRITICAL POINT 3. Has to be DC so phase and amplitude polarity can be resolved without reference to an artificial tracking level... most detectors cant do this because integrator baselines drift all over the place. ( hence motion and non motion ).
    moodz
    Don't think I overlooked that!
    After returning from downtown this morning, I immediately researched that project.
    Interesting because it is simple to make. I have a surplus of ESP32 modules...
    BTW Thanks for posting the link!

    Happy New Year to You and ALL other good people!

    ...
    But at the same time, this also caught my attention: https://x.com/Alexand36635968/status...ja-foto%2Fvest
    But this comment knocked me off my chair:


    Click image for larger version  Name:	image.png Views:	0 Size:	12.9 KB ID:	432241​

    Leave a comment:


  • Atul Asthana
    replied
    great, good that you joined in the discussions

    Leave a comment:


  • moodz
    replied
    Originally posted by Atul Asthana View Post

    yes, good amount of information in the project document.

    Have you made it? hows the performance?

    In our case, we are still discussing an exploratory project, where everything is under scrutiny and discussion, and nothing is concretised yet. once we are clear about the hardware, methodology etc, it will be converted into a project document.

    I was looking for explicit references to the noise figures, what noise figures have these students quoted in this project?

    btw, I read that esp32's adc is not very linear and this reduces senstivity, injects harmonic noise.

    No I have not made it ... but Ivica might like it because it uses ESP32 .
    IMHO Noise specs are not relevant till the noise is specified with respect to bandwidth ... and also if the noise is synchronous with the wanted signal elements. Generally speaking non synchronous wideband noise has little effect on the wanted synchronous components. - in oversampling schemes .. noise at the input actually helps.
    A wideband software defined radio has no preselectors at its wideband input but can resolve less than 1 Hertz of bandwith signal in an input bandwidth spanning 10s of Mhz. Lock in amplifiers are an extreme example of this and can recover signals below the wideband noise floor at the input ... in fact the lock in amp will recover the phase and amplitude of a signal well below the input noise floor ( if the TX phase and frequency is known --- CRITICAL POINT 1 ). If the signal is very weak then you just integrate the phase and amplitude for longer. Sampling ADCs use a modulator to do the sampling .... the sampling frequency adds convolution noise to the samples .. almost impossible ( cant be filtered ) to remove once its in the data so care in choice of sampling frequency for high performance systems..CRITICAL POINT 2. The sweep speed of the coil determines the target detection passband ( for most handheld detectors this will be from DC to 10 hertz for example ) this is the demodulation target bandwith CRITICAL POINT 3. Has to be DC so phase and amplitude polarity can be resolved without reference to an artificial tracking level... most detectors cant do this because integrator baselines drift all over the place. ( hence motion and non motion ).
    moodz

    Leave a comment:


  • Atul Asthana
    replied
    Originally posted by moodz View Post
    There are quite a few starting points on the web ... that will save time. A modular approach will be most beneficial. ( TX FRONTEND, RX FRONTEND, ADC BLOCK, DSP BLOCK, USER INTERFACE BLOCK, POWER BLOCK )
    and you need system and signal flow diagrams rather than word essays.

    eg. This was done in 3 weeks ? and well documented.

    GitHub - teiturhelgi/VLF-Metal-Detector: Very Low Frequency Metal Detector designed and built as a project for three week course in Electromagnetics at DTU.


    ​just sayin ... moodz.
    yes, good amount of work done and information collected in the project document.

    Have you made it? hows the performance?

    This is still an exploratory project where we are researching various aspects, with everything under review and nothing finalized yet. Once the hardware, methodology, and other details are clear, we’ll formalize it into a project document.

    My target audience includes metal detector users and experts who have in-depth knowledge of the technology. Unlike a student project aimed at beginners, this project requires a different approach—focusing on core aspects like noise figures and dynamic range rather than covering the basics. The goal is to discuss essential elements and leverage expert insights of users/designers to refine the design.

    With this in mind, I am specifically looking for explicit references to noise figures, dynamic range and distortions in the quoted student project. What noise figures have these students quoted in their project?
    ​
    btw, I read that esp32's adc is not very linear and this reduces senstivity, injects harmonic noise. "
    The ADC of the ESP32 has a – fully justified – bad reputation.
    • The advertised 12 bits are practically 9 bit +3 bit noise.
    • The V/ADC relation is not linear
    • The first 0.21V of the input (by 11dB attenuation) are ignored"
    1. https://github.com/e-tinkers/esp32-a...ster/README.md
    2. https://stackoverflow.com/questions/...ading-on-esp32
    3. https://esp32.com/viewtopic.php?t=2881
    4. https://forum.arduino.cc/t/fixing-th...n-esp32/699190

    Leave a comment:


  • Atul Asthana
    replied
    Originally posted by Repwoc View Post

    What is the advantage of using the Goertzel algorithm over sampling the RX waveform at the zero-crossing and wave peak points to determine phase and amplitude? I can see that the Goertzel algorithm is good for detecting if specific frequencies are present in a signal, but you already know what frequency will be there and you just need to know the phase shift and amplitude change. It seems like a large processing overhead for no obvious benefit.

    paul
    I am aware of the following methods of amplitude and phase extraction, of which, I've used all except wavelet transform. fft was a very common spectrum analysis methodology for machinery vibration analysis, Goertzel was used in fsk/psk demodulation, zerocrossing for power control using triacs, PLL for frequency syntheciser, quadrature sampling for am nbfm demodulation. I dont recall how I used hilbert, but was probably for machine vibration analysis.

    here are the methods, their computational load, susceptibility to noise and best use scenario :

    Method, Computational Load, Noise Susceptibility, Best Use Case

    Fourier Transform, Moderate to High, Moderate, Wideband analysis

    Goertzel Algorithm, Low, Moderate, Single-frequency detection

    Zero-Crossing/Peak, Very Low, High, Low-complexity scenarios with high SNR

    Hilbert Transform, Moderate, Moderate, Precise phase and amplitude tracking

    Phase-Locked Loop, Low to Moderate, Low, Real-time phase tracking in noisy signals

    Quadrature Sampling, Low to Moderate, Moderate, Direct amplitude and phase calculation

    Wavelet Transform, High, Low to Moderate, Non-stationary signals or detailed analysis

    ​Zero crossing reuires high snr signal, and our problem is to identify and extract target in very low snr scenario.

    Leave a comment:


  • moodz
    replied
    There are quite a few starting points on the web ... that will save time. A modular approach will be most beneficial. ( TX FRONTEND, RX FRONTEND, ADC BLOCK, DSP BLOCK, USER INTERFACE BLOCK, POWER BLOCK )
    and you need system and signal flow diagrams rather than word essays.

    eg. This was done in 3 weeks ? and well documented.

    GitHub - teiturhelgi/VLF-Metal-Detector: Very Low Frequency Metal Detector designed and built as a project for three week course in Electromagnetics at DTU.


    ​just sayin ... moodz.

    Leave a comment:


  • Atul Asthana
    replied
    Originally posted by Repwoc View Post

    What is the advantage of using the Goertzel algorithm over sampling the RX waveform at the zero-crossing and wave peak points to determine phase and amplitude? I can see that the Goertzel algorithm is good for detecting if specific frequencies are present in a signal, but you already know what frequency will be there and you just need to know the phase shift and amplitude change. It seems like a large processing overhead for no obvious benefit.

    paul
    thanks for bringing up this point.

    zero crossing + peak detection is very susceptible to noise,
    • Frequency Specificity: Goertzel precisely isolates the 6 kHz frequency component, rejecting noise and interference at other frequencies, while zero-crossing + peak detection is more susceptible to broadband noise.
    • Noise Resilience: Goertzel's inherent filtering properties make it more robust to noise than simple peak detection, which can be easily triggered by noise spikes.
    In a metal detector, the noise figure is critical as it determines whether a target can be detected or missed. To address this, I plan to incorporate a 24-bit audio codec, as recommended by Carl, to improve the noise performance.

    Additionally, oversampling the waveform provides a significant advantage in noise reduction compared to using only two samples for a 6 kHz signal. By sampling the waveform at 16 points, the noise can be reduced by 9 dB, allowing detection of targets with signals up to 8 times weaker. This improvement, achieved through oversampling and the Goertzel algorithm combined, outperforms the traditional zero-crossing and peak-detection methods.

    kindly opine. we need lots of nitpicking, advise and suggestions to improve this md, while keeping the costs, complexities and component counts low.

    Leave a comment:


  • Carl-NC
    replied
    Mostly the CODEC is just a cheap way to get a decent 24b ADC. CODEC ADCs are usually sigma-delta and typically have an SNR of 100dB or so for as little as $3. A 24b SAR has about the same SNR for $15-50.

    Leave a comment:


  • JoyJo
    replied
    Greetings! Gentlemen, Merry Christmas and Happy New Year to all! If we talk about the topic of signal digitization: what is the difference in using a special ADC chip or an audio codec? How is the audio codec better or worse than the classic ADC?

    Leave a comment:


  • Repwoc
    replied
    Originally posted by Atul Asthana View Post
    Signal Processing:
    Fixed-point Goertzel algorithm (optimized for single-cycle processing) extracts amplitude and phase.
    ​
    What is the advantage of using the Goertzel algorithm over sampling the RX waveform at the zero-crossing and wave peak points to determine phase and amplitude? I can see that the Goertzel algorithm is good for detecting if specific frequencies are present in a signal, but you already know what frequency will be there and you just need to know the phase shift and amplitude change. It seems like a large processing overhead for no obvious benefit.

    paul

    Leave a comment:


  • Atul Asthana
    replied
    VLF Metal Detector DSP V0.1
    (31 Dec 2024)

    Aim and Objectives:

    The project aims to create a "somewhat" commercial-grade VLF metal detector using the STM32F103C8T6, prioritizing hardware and software simplicity while achieving reasonable depth and discrimination.

    Design Aspects:

    TX Coil Design:
    Diameter: 10 inches.
    Wire: 22 AWG.
    Turns: 25.
    Estimated Inductance: ~223 µH.
    Target Resonant Frequency: 6 kHz.
    Tuning Capacitor: ~315 nF (to achieve resonance at 6 kHz).
    DC Resistance: 0.84 Ω
    Impedance at 6 kHz: 8.44 Ω
    Q Factor: 10

    RX Coil Design:
    Diameter: 10 inches.
    Wire: 28 AWG.
    Turns: 40.
    Estimated Inductance: ~678 µH.
    Target Resonant Frequency: 6 kHz.
    Tuning Capacitor: ~104 nF (to achieve resonance at 6 kHz).
    DC Resistance: 4.8 Ω
    Impedance at 6 kHz: 26 Ω
    Q Factor: 5.3

    TX Signal Generation: A 6 kHz sine wave is approximated using 16-point PWM, driving an H-bridge powered by 5V. PWM duty cycle modulation controls transmit power (50-250mW range).

    RX Front-End Amplifiers:
    Two-stage non-inverting amplifier using the OPA2376.
    Stage 1: High input impedance buffer and moderate gain (around 30). AC coupled to the RX coil using a 1uF capacitor.
    Stage 2: Additional gain (around 37) and bandpass filtering.
    Sallen-Key Bandpass Filter: Center frequency 6 kHz, bandwidth 15% (900 Hz), Q ≈ 6.67. This filter is implemented around the second op-amp of the OPA2376.
    Output AC coupled to ADC with a 1uF capacitor and biased to 1.65V using a voltage divider.

    Data Acquisition/Sampling Methodology:
    The STM32's internal ADC is used.
    Sampling Frequency: 16 samples per 6 kHz cycle (96 kHz).
    16 consecutive cycles are sampled.
    Corresponding points from the 16 cycles are summed. This provides a 12dB SNR improvement from averaging, and 9dB from oversampling.

    Signal Processing:
    Fixed-point Goertzel algorithm (optimized for single-cycle processing) extracts amplitude and phase.
    Two 16-tap Butterworth IIR low-pass filters are applied to the amplitude and phase outputs of the Goertzel algorithm. One filter extracts the slowly changing "ambient" ground response, and the other extracts the faster changing "target" response.
    VDI is calculated based on the phase difference between the ambient and target responses.

    Noise Mitigation
    Low-noise op-amps (OPA2376).
    Tuned TX and RX coils for pre-filtering harmonics.
    Sallen-Key bandpass filter.
    Oversampling and averaging.
    Synchronous detection (using Goertzel phase output).

    Total Signal Dynamic Range and System's Dynamic Range:
    Estimated Signal Dynamic Range: The target signal is estimated to be between 1 µV and 4 mV (72 dB) at the receiver coil input.
    System's Dynamic Range: The system's dynamic range will be primarily limited by the noise floor of the receiver. With careful design and the noise mitigation techniques described, a noise floor of around 1 µV or slightly less might be achievable. This would give the system a dynamic range close to the signal's dynamic range (around 70dB or slightly more). The averaging and oversampling will improve the dynamic range by 21dB.

    Contentious Issues/Trade-offs:

    16-point PWM still introduces harmonics, though significantly attenuated by the tuned coils and filter. Increasing PWM points would reduce harmonics but increase processing.
    The bandwidth of the Sallen-Key filter is a trade-off between selectivity and signal strength. A narrower bandwidth improves selectivity but reduces the signal amplitude.
    The computational cost of the 16-tap IIR filters is a consideration on the STM32F103C8T6. Optimizations will be necessary.
    Without DMA, the ADC sampling and processing must be carefully timed to avoid missing samples.

    Hardware Connections:

    TX Coil H-Bridge:
    PA0: PWM output (Timer 2 Channel 1) - H-bridge input 1
    PA1: PWM output (Timer 2 Channel 2) - H-bridge input 2
    H-bridge power: 5V

    RX Coil Amplifier Input:
    PA2: Analog input (ADC Channel 2) - Output of the RX amplifier
    Buttons (9 total):
    PB0 - PB8: Connected to the buttons. Configure these pins as inputs with internal pull-up resistors enabled.
    ​​​​Speaker:
    PA8: PWM output (Timer 1 Channel 1) - Connected to the speaker through a transistor or small audio amplifier.

    Power LED:
    PC13: Output - Connected to the power LED through a current-limiting resistor (e.g., 220 Ω).
    Error LED:
    PB9: Output - Connected to the error LED through a current-limiting resistor (e.g., 220 Ω).

    This description provides a complete overview of the metal detector's design, including the specific hardware and signal processing choices as of 31 Dec 2024.

    ​

    Leave a comment:


  • Atul Asthana
    replied
    I'd request more experts to advise so that, we can start at a good enough level of designed performsnce, and can try achieving real performance as close as possible to theoretical designed performance at the lowest possible cost and lowest possible complexity.

    Leave a comment:


  • Atul Asthana
    replied
    Originally posted by Carl-NC View Post
    One thing you should try to avoid is manually controlling timers. STM timers can be set up to create autonomous arbitrary waveforms via DMA. See STM App Note AN4776. Once you have it set up, the timer runs completely autonomously with no further need to intervene in code. It therefore has zero impact on code execution. If you set up your timing properly, you can also use one of the other channels to autonomously trigger the ADC.
    I am not too familiar with the modes of the timers (in fact, I am unfamiliar with the whole of stm32 processor specialities. my other engagements are much more and are much more taxing, and are not even remotely connected to anything here), but by bruteforce, I can possibly get it working to a satisfactory level, with advantage of some portability to other microcontroller arhitectures like esp32 etc, though I am not aiming for it.

    to simplify the scheduler, I will run the internal ticker at 96 khz, that is :
    generate 16 point pwm sine wave and sample the rx wave 16 times.

    though this will increase the thd of tx wave ie 18 khz (-10 to-15 dbc) and 30 khz (-20 to -25 dbc), but I have three filters : tx tuned circuit, rx tuned circuit and a single pole band pass in the rx amplifier to filter out this noise. Considering the filtering effect of the tuned coils+opamp filter (5 poles in total) in this design, the 3rd and 5th harmonics will likely be suppressed by -40 dBc or more, possibly even below -60 dBc. This is significant and helps reduce scheduler design complexities.​

    in fact, if I improve the Q of both tanks, I can probably get still better dupression of the harmonics.

    And, sampling the rx signal at 16 points, instead of original 8 gives added advantage of noise reduction (equivalent of 1 bit resolution). My calculation is that theoretically, I should be able to derive 3+4 bits of additional gain, provided the noise is incoherent with the signal. But in our case, we may get 4 - 5 bits at the best. And I think thats pretty good and sufficient for the project in its present form.

    this scheme will reduce my need to further learn something about something that I am not too familiar with.

    for the rx front end design, I've asked one of my analog design friends to help out. I may also need to approach some one with some experience on stm32 programming to further reduce my load. let us see if I can find some one who can implement your suggestion of running the pwm+adc independently.
    Last edited by Atul Asthana; 12-31-2024, 06:46 AM.

    Leave a comment:

Working...
X