Announcement

Collapse
No announcement yet.

Algorithm Challenge

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

  • #31
    to extract the phase and amplitude of the target signal we solve ...

    Click image for larger version  Name:	a3.png Views:	0 Size:	1.2 KB ID:	417538
    Click image for larger version  Name:	theta3.png Views:	0 Size:	1.7 KB ID:	417539

    where a3 and theta3 are the amplitude and phase of the combined target + ground sinusoid.

    a1 can be the ground amplitude and a2 can be the target amplitude.
    theta1 is the ground phase and theta2 is target phase

    so if you have a3 and a1 you can calculate a2 phase and amplitude by rearrangement....

    Comment


    • #32
      Originally posted by ivconic View Post


      I didn't mean auto balancing at coil!
      How did this go that way??
      All the time I think about the "auto-zero" circuit in non-motion detectors, whether it is IB or PI (probably a different morphology).
      Ok, let's go slowly, so we have a non motion detector. It usually has a button next to which it often says "tune" or "retune" or "reset"...
      When the detector starts to drift; you press that button and it calms down.
      What is the name of the circuit that does that?

      I remember the button you're talking about, as I used to have a old non-motion Tandy detector that had one. I found a lot of stuff with that detector.
      Are you wanting to replace it with a "Self-adjusting Threshold" (SAT)?

      Comment


      • #33

        It is done in Quasar Arm, look R1 SIN_ C
        Originally posted by ivconic View Post

        So that we don't have to press that button often.

        .
        Click image for larger version  Name:	Screen Shot 2023-12-09 at 6.26.08 AM.png Views:	0 Size:	22.8 KB ID:	417553



        for that generator should additionally generate a sine wave with adjustable amplitude and phase, at first you can use 4 buttons and then replace them with pulses generated let say every, 5 seconds.
        I can guide you if you can do programming.​

        Comment


        • #34
          Originally posted by Carl-NC View Post
          OK, here is a mini-challenge. Let's say you design a mixed analog/digital detector. You read in the X & R signals to the micro, and at some point you want to calculate the magnitude and phase. Mathematically, they are:





          However, these can be slow calculations in a micro.
          I am using STM32F103 and do not observe problem with that, what is slowing down program is method of removing the noise, filters, averaging etc,

          Click image for larger version

Name:	noise amplitude.png
Views:	244
Size:	38.9 KB
ID:	417555
          delay in amplitude filtering

          Comment


          • #35
            Originally posted by moodz View Post



            so if you have a3 and a1 you can calculate a2 phase and amplitude by rearrangement....
            a biiiiiiig if

            Comment


            • #36
              Originally posted by Qiaozhi View Post

              I remember the button you're talking about, as I used to have a old non-motion Tandy detector that had one. I found a lot of stuff with that detector.
              Are you wanting to replace it with a "Self-adjusting Threshold" (SAT)?
              Yes. Because my great desire is to make one good non motion detector.
              Something along the lines of the Cscope 1220B or one of the White's non motion detector series.
              "...I found a lot of stuff with that detector..."
              Well done!
              Exactly!
              Although they are not "deep" (by today's standards and by the criteria of today's bench tests); however with a proper understanding of the operation of such detectors and with proper manipulation of the controls on such a detector; the results are phenomenal.
              I have found the best, most difficult to find, smallest and most valuable finds with such detectors.
              ​And working with such a detector is very interesting, exciting... you feel as if you are "listening" to the soil and everything in it.
              But all this can only be understood by someone who has such experiences.
              Your sentence testifies to that.



              Comment


              • #37
                Originally posted by pito View Post

                a biiiiiiig if
                I posted the solution in post #3 it is performing this extraction using logs .... can be achieved with very simple analogue hardware.

                The pic below shows the output from extraction of 30mV / 300mv / 3volt input waveform with 100 mv peak peak noise to give a log recovery output with noise removed.

                The top trace is the log level recovery.

                The bottom trace is the waveform phase recovery.

                I would probably need a high spec ADC to perform the same in DSP.

                Click image for larger version

Name:	recovery.png
Views:	232
Size:	31.2 KB
ID:	417572

                Comment


                • #38
                  Today I was flipping through a collection of Elrad magazines from 1977 to 1997 and came across this:
                  - ELRAD 1995-03.pdf - "Trigonometrie mit CORDIC", pages 30 - 32
                  At the end of the article there are also references to some books (1959. year at one).
                  ...
                  However, I can't shake the impression that the topic of metal detectors in reality was and remains totally uninteresting for all those big magazines.
                  A rough estimate is that it is just under 1% of the content of all those magazines (I have a huge digital collection, tens of gigabytes).
                  Taking into account that many authors of articles in those magazines are very big names in the world of science, in this case Electronics.
                  It seems kind of devastating, doesn't it?

                  Comment


                  • #39
                    Originally posted by moodz View Post
                    to extract the phase and amplitude of the target signal we solve ...

                    Click image for larger version Name:	a3.png Views:	0 Size:	1.2 KB ID:	417538
                    Click image for larger version Name:	theta3.png Views:	0 Size:	1.7 KB ID:	417539

                    where a3 and theta3 are the amplitude and phase of the combined target + ground sinusoid.

                    a1 can be the ground amplitude and a2 can be the target amplitude.
                    theta1 is the ground phase and theta2 is target phase

                    so if you have a3 and a1 you can calculate a2 phase and amplitude by rearrangement....
                    I doubt this will work in a real-time metal detector where the amplitude & phase are changing almost on a cycle-by-cycle basis. This is why we demodulate and high-pass filter, leaving a target I&Q vector.

                    Originally posted by pito View Post
                    I am using STM32F103 and do not observe problem with that, what is slowing down program is method of removing the noise, filters, averaging etc,
                    Yes, that's a Cortex M3 with hardware multiplication, so it can reasonably handle the math. But what about a crappy PIC? Or an M0?

                    It's hard to know what your time scale is, but the filter latency doesn't look all that bad. If you can't get the needed filtering & latency in a single filter, use cascaded filters.

                    Originally posted by moodz View Post
                    I posted the solution in post #3 it is performing this extraction using logs .... can be achieved with very simple analogue hardware.
                    Yes, it can be done in hardware, but that's the hard way. That's how White's did it in the old 6000 series, all analog & discrete logic. And a very impressive design. But (IMO) digital is easier and way more flexible.
                    Also, whatever graphic you embedded in post #3 doesn't show up for me. Likely for anyone else, other than you. Seems to be a forum bug.

                    Comment


                    • #40
                      Originally posted by Carl-NC View Post


                      Also, whatever graphic you embedded in post #3 doesn't show up for me. Likely for anyone else, other than you. Seems to be a forum bug.
                      Click image for larger version

Name:	image_52924.jpg
Views:	201
Size:	19.5 KB
ID:	417610

                      Comment


                      • #41
                        Originally posted by Carl-NC View Post
                        I doubt this will work in a real-time metal detector where the amplitude & phase are changing almost on a cycle-by-cycle basis. This is why we demodulate and high-pass filter, leaving a target I&Q vector.
                        Yes, that's a Cortex M3 with hardware multiplication, so it can reasonably handle the math. But what about a crappy PIC? Or an M0?
                        It's hard to know what your time scale is, but the filter latency doesn't look all that bad. If you can't get the needed filtering & latency in a single filter, use cascaded filters.
                        Yes, it can be done in hardware, but that's the hard way. That's how White's did it in the old 6000 series, all analog & discrete logic. And a very impressive design. But (IMO) digital is easier and way more flexible.
                        Also, whatever graphic you embedded in post #3 doesn't show up for me. Likely for anyone else, other than you. Seems to be a forum bug.
                        A few good observations that I can't help but notice.
                        "...I doubt this will work in a real-time metal detector where the amplitude & phase are changing almost on a cycle-by-cycle basis..."
                        Exactly! That is the crux of the problem.
                        Am I wrong to assume that analog technology is more successful in dealing with that problem?
                        (not taking into account super powerful digital platforms which are both expensive and impractical for this kind of design)
                        "...This is why we demodulate and high-pass filter, leaving a target I&Q vector..."
                        A clear and generally accepted method. Almost a "dogma" in designing. Can we try to think "outside the box" this time? We are in no rush.
                        You said it before, I repeat; is that the main reason why the "pure" non motion approach was abandoned? Can something new be done about it?
                        "...Yes, that's a Cortex M3 with hardware multiplication, so it can reasonably handle the math. But what about a crappy PIC? Or an M0?.."
                        Powerful cores, lots of peripherals, plenty of resources... but ADC is still flawed. Back to the AMX stories.
                        "...crappy PIC" still beats in Deus... the fact that Deus started a new wave of ideas cannot be ignored.
                        Although I personally still understand AVR and ARM more easily.
                        "...but the filter latency doesn't look all that bad..."
                        This gives me an idea of ​​more cheap processors with split tasks. Would it be bad to have a couple of Atmegas doing special jobs?
                        I have in mind that story from earlier about being able to reproduce a project without major problems by as many people as possible.
                        And it is an easier task if the work is divided among several people who have a good command of programming on Atmega.
                        One can write only one part of work on Atmega, another something else, third... in the end we have a project with several independent blocks of code.
                        Modular!
                        Someone won't like having an LCD on that detector. Someone will not use something else.
                        Modular, multiple solutions that are compatible and in the form of "Lego bricks" can be assembled as desired.
                        All these "modules" will be connected by one and the same "base", which should preferably be analog and universal.
                        I know you don't like it, you don't have to say, but how many people do you know here that will easily get the job done with some ARM?
                        You have the Atmega in a DIL package, anyone can solder it to the pcb. And what about Arm?
                        "...Yes, it can be done in hardware, but that's the hard way..."
                        That's exactly the right thing! If material that is easily available is used; it will be a very interesting project. From whom a lot can be learned.
                        "...But (IMO) digital is easier and way more flexible..."
                        Everyone has to agree with this.
                        But how many people are capable of following you as a couple who can do that?
                        And to get ready-made code from you... that's not it.
                        The gain is in the journey and not in just reaching the mere "goal" of having just another lookalike detector on a pile.
                        I apologize for the persistence.
                        But I've already seen everything similar on the AMX thread.
                        And not only on AMX, but also on a dozen others so far. A lot of attention and energy is spent on stories that ultimately never come to life.
                        If they ever come to life, it happens to one or two people...most are left deprived and disappointed.
                        Carl, it's clear why you would go that route, no one blames you.
                        But then it is not a project for the "broad masses". And we have seen that here on the forum many times.​


                        Comment


                        • #42
                          I am not of the opinion that the RX phase will change ( significantly ) from cycle to cycle unless it is being heavily impinged by noise ( hence a focus on recovering the RX signal from heavy noise ).

                          There is no need to reinvent the wheel with the DSP .... the code is already out there and off the shelf.
                          IQ demodulators are simple to implement. ( with only minor coding changes ) using proven SDR designs.
                          Ferinstance below is a stm32f4xx disco board implementation of a SDR ( software defined radio ). Very little to be done to drop this into a metal detector design.
                          STM32 disco boards start at $20 or therabout ... what more do you want.??

                          The CORDIC algorithm I put up earlier to calculate the arctan of X/R is has an error of about .06 degrees using signed 8 bit values ... so 12 bits is fine in this case

                          Comment


                          • #43
                            Originally posted by moodz View Post
                            I am not of the opinion that the RX phase will change ( significantly ) from cycle to cycle unless it is being heavily impinged by noise ( hence a focus on recovering the RX signal from heavy noise ).

                            There is no need to reinvent the wheel with the DSP .... the code is already out there and off the shelf.
                            IQ demodulators are simple to implement. ( with only minor coding changes ) using proven SDR designs.
                            Ferinstance below is a stm32f4xx disco board implementation of a SDR ( software defined radio ). Very little to be done to drop this into a metal detector design.
                            STM32 disco boards start at $20 or therabout ... what more do you want.??

                            The CORDIC algorithm I put up earlier to calculate the arctan of X/R is has an error of about .06 degrees using signed 8 bit values ... so 12 bits is fine in this case

                            Now I can't see the attachment?
                            ...
                            "..I am not of the opinion that the RX phase will change ( significantly ) from cycle to cycle..."
                            Yes and no, depending on sample rate and soil itself.
                            In reality there are soils and areas worse than that, you'll be surprised.
                            They (XP) f..ked up big time with f/w versions later than V3.2 at GEB algorythim.
                            So as I walking and step on such soil or area; Deus simply lose the GEB for some period, can't recover from sudden changes.
                            Just an example...
                            ...
                            SDR I do have one "dongle" for longer period. Interesting idea!
                            Please repeat the attachment, I can see a squat!


                            Comment


                            • #44
                              Originally posted by moodz View Post
                              I am not of the opinion that the RX phase will change ( significantly ) from cycle to cycle unless it is being heavily impinged by noise ( hence a focus on recovering the RX signal from heavy noise ).

                              There is no need to reinvent the wheel with the DSP .... the code is already out there and off the shelf.
                              IQ demodulators are simple to implement. ( with only minor coding changes ) using proven SDR designs.
                              Ferinstance below is a stm32f4xx disco board implementation of a SDR ( software defined radio ). Very little to be done to drop this into a metal detector design.
                              STM32 disco boards start at $20 or therabout ... what more do you want.??

                              The CORDIC algorithm I put up earlier to calculate the arctan of X/R is has an error of about .06 degrees using signed 8 bit values ... so 12 bits is fine in this case

                              But if I quote your post, I can see this:


                              Click image for larger version

Name:	image.png
Views:	189
Size:	55.0 KB
ID:	417638

                              Comment


                              • #45
                                thats strange ... I can see the attachements fine ( on multiple boxes ... windows / linux ... chrome / firefox and on my mobile ). I tried png and jpeg .. can still see OK.

                                Comment

                                Working...