Announcement

Collapse
No announcement yet.

Let's made a PC-base metal detector with usb interface !!!

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

  • Aziz
    replied
    Some comments on signal and reference generation:

    If they are not totally synchronized together, all the output of the Lock-in will be wrong (mainly other). So you must ensure, that there is on the received signal stream and internally generated reference stream no time gap or out of synchronisation.

    All the other parts are very easy to calculate. Probably, the LP-filter has more complexity. But you can even use the averaged mean values as a approximation for LP-filter.

    Aziz

    Leave a comment:


  • Aziz
    replied
    Originally posted by TheWizard View Post
    I know that....you dont understand me... np...
    how you make I and Q :
    0 and 90 deg samples or
    f/4 frequency translation (Down-conversion method)
    Source:
    Signal(t): A*sin(wt)

    Reference:
    Ref-I(t): B*sin(wt+ref-phase)
    Ref-Q(t):B*sin(wt+ref-phase+90°) = B*cos(wt+ref-phase)

    Mixer:
    I&Q-Channel:
    I(t) = Signal(t) * Ref-I(t)
    Q(t)= Signal(t) * Ref-Q(t)

    Low-pass filtering of I&Q-Channel:
    Removing all the high frequency parts of uninterested spectrum + noise.

    I&Q(t)-Channel is now LP-filtered.

    Calculating R&P-Channel:
    Using sqrt() and atan2() as described above for all entries of I(t) and Q(t) and calculating R(t) and P(t).
    The low-pass bandwith and response time determines, how smooth the I(t), Q(t), R(t) and P(t) will be.

    Thats all.

    Leave a comment:


  • Aziz
    replied
    I forgot to mention:

    The sqrt() and atan2() must be applied after the low-pass filtering.
    R = sqrt(I*I+Q*Q) (magnitude of r.m.s. AC-signal)
    P = atan(Q/I) or better
    P = atan2(Q, I) (phase relative the reference in radians)

    Regards,
    Aziz

    Leave a comment:


  • TheWizard
    replied
    I know that....you dont understand me... np...
    how you make I and Q :
    0 and 90 deg samples or
    f/4 frequency translation (Down-conversion method)

    Leave a comment:


  • Aziz
    replied
    Originally posted by TheWizard View Post
    I want to know how is phase noise amplitude in DEG
    in my picture - phase(and I & Q) have not filtering - it is "RAW" data from AcrTan2 function and amplitude Sqrt....

    in my second pictures phase noise is big from DC offset - soundcard problem... and I use microphone and speaker... it is audio/room phase reverb
    I have not time now to make coil test...
    TheWizard,

    the reason for lock-in is to eliminate the noise. After having multiplied the signal with Reference I and Q, you have to low-pass it. We are not interested on noise amplifiying. We are only interested on the pure signal on specified frequency. My low-pass filter is a very sharp FFT filter at 0 Hz with some bandwidth.
    The noise can be seen on the FFT-Spectrum. It is typical for my worst case coil configuration (very noisy environment). Even with a bad sound card, it should work anyway!

    Leave a comment:


  • TheWizard
    replied
    I want to know how is phase noise amplitude in DEG
    in my picture - phase(and I & Q) have not filtering - it is "RAW" data from AcrTan2 function and amplitude Sqrt....

    in my second pictures phase noise is big from DC offset - soundcard problem... and I use microphone and speaker... it is audio/room phase reverb
    I have not time now to make coil test...
    Attached Files

    Leave a comment:


  • Aziz
    replied
    Originally posted by TheWizard View Post
    Can you make graphic/diagram of phase and amplitude - some like my soft....
    Amplitude is colored magenta, phase is colored yellow in the time-domain. Due to low-pass filtering of I (Y) & Q (X) channels, you see almost the DC level of the values. If you are interested, I can also show the pure I & Q channels before filtering (after mixer), after filtering (realtime I & Q channels), etc. It is interesting to see, how lock-in amplifier is working.
    Aziz

    Leave a comment:


  • TheWizard
    replied
    Can you make graphic/diagram of phase and amplitude - some like my soft....

    Leave a comment:


  • Aziz
    replied
    Some comments on my last Lock-in experiment on Laptop/PC with Sound-Card:

    IB-Coil (PCB-Coil) with high impedance connected directly to sound card output (left channel). IB-Coil is not fine balanced. The signal is the minimum possible balanced signal given only by the PCB-traces of the coil.
    RX coil is not shielded and will show a high level of broadband induced noise. Also no amplifier is connected to the RX-coil. RX-coil is connected directly to microphone input (microphone amplifier is on) and the sensitivity is set to max.
    There is a phase shift between TX and RX signal physically.

    Sampling rate is 96 kHz, 24 Bit resolution. Signal frequency is 24 kHz.

    Despite of the high operating frequency and only four samples for one wave of signal, the Lock-in output is responding to any phase and amplitude changes very sensitiv and quite stable. More better results than I had with very small bandwidth FFT-filtering methods.

    The Lock-in method allows shorter filter bandwidths of filtering the signal of interest. And this goes by far further than FFT-filter or any other filter. So there is much more potential of detecting even very small signals buried in high noise.

    Lock-in should be also applied on PI's. There are some ready-for-use IC's on the market or can be easyly implemented on a RISC µC/DSP. Of course, on the Laptop with ease.

    I will do some more experiments with signal levels from mV to µV. Also will connect an amplifier to RX signal and will watch the response. There is more to discover.

    Aziz

    Leave a comment:


  • Aziz
    replied

    Lock-in with Sound-Cards is working!


    I will comment this later. It is too late now!
    Aziz
    Attached Files

    Leave a comment:


  • Aziz
    replied
    By the way, your guys called my interest to lock-in amps. So I will test a bad coil in low-power (low signal level) VLF mode to proof the result of TheWizard. He claims still, it won't work. I don't believe in that. So I am going to test this by myself on the coming weekend.

    This would increase the SNR dramatically on perfectly balanced IB coils probably. Of course, balancing is made with a second signal source, which adds very small magnetic field strength/density with specified amplitude and phase corrections to the coil configuration. This means, I can create a total flat signal line on the RX-signal with some high noise level. The signal then will be buried in total noise level!

    It's going to be very interesting.
    Aziz

    Leave a comment:


  • Aziz
    replied
    Hi TheWizard,

    DC offset can be occured due to different packing format to the sound card driver. It depends on the wFormatTag (WAVE_FORMAT_PCM, WAVE_FORMAT_IEEE_FLOAT, WAVE_FORMAT_EXTENSIBLE, ..) and wBitsPerSample defined in WAVEFORMATPCMEX.Format structure (if you use the Win32-API).

    Generally, you will have an internal sound format in which all calculations done. When you sending some sound data, this must be converted before sending to the sound driver. When acquiring sound data, unpacking must be applied.
    I am using internally single precision float format in range of: -1.0 .. +1.0.

    That was my first mistake I did in the past.

    Originally posted by TheWizard View Post
    PS: Sound Card is good for learning of LockIn process but for MD I am not agree....
    I am wondering, what a mysterious machine I have at home . It is a MD based on Sound Card.

    Aziz

    Leave a comment:


  • Aziz
    replied
    Originally posted by gwzd View Post
    You got this the other way around Aziz, that's a common mistake on EE 101:

    Decibels are unit less and therefore always imply a comparison.

    dB(P)=10*LOG(Pout/Pin)

    P= V^2/R

    dB(P)=10*LOG((Vout^2/R)/(Vin^2/R))

    dB(P)=10*LOG(Vout^2/Vin^2)

    dB(P)=10*2*LOG(Vout/Vin)

    dB(P)=20*LOG(Vout/Vin)

    the same can be proven true for currents also.
    Hi gwzd,

    you are right! Thanks for your attention and excellent mathematical conclusion.
    The factor 10 and 20 must be exchanged.
    10 for power relations
    20 for voltage relations

    Leave a comment:


  • TheWizard
    replied
    NO... My soft is not wrong... just is first step of tests...
    I find one problem - Soundcard Hardware DC offset
    and Amplitude and Phase result need to have very low-pass filter
    filter with a cut-off frequency of 10 Hz and down (AN1115 Microchip)

    PS: Sound Card is good for learning of LockIn process but for MD I am not agree....
    If you read AN1115 - current MCUs and DSP microcontrolers is ready for Digital IB Metal Detectors

    Leave a comment:


  • gwzd
    replied
    Originally posted by Aziz View Post

    As the FFT power spectrum is power related, you have to multiply with 20. Voltages and currents are multiplied with 10.0 for decibels.

    Aziz
    You got this the other way around Aziz, that's a common mistake on EE 101:

    Decibels are unit less and therefore always imply a comparison.

    dB(P)=10*LOG(Pout/Pin)

    P= V^2/R

    dB(P)=10*LOG((Vout^2/R)/(Vin^2/R))

    dB(P)=10*LOG(Vout^2/Vin^2)

    dB(P)=10*2*LOG(Vout/Vin)

    dB(P)=20*LOG(Vout/Vin)

    the same can be proven true for currents also.

    Leave a comment:

Working...
X