Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Software for performing pickup analysis with a recording interface.

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

  • #16
    Joe'suggestion: Same coil, different magnetic material, etc.

    Above, Joe Gwinn suggested keeping the coil same and testing with different magnetic material, configuration, etc. This is a good idea, both for learning about magnetic effects such as eddy currents, and for testing this measurement system. The bobbin here is one you can buy that is intended to replace the flatwork in Fender type single coil pickups; it is wound with #43. You can do air, of course, and it normally holds Alnico rods, but humbucker slugs fit in loosely as well, and there is sufficient room so that you can wrap the slusg in aluminum foil for an additional test.

    There are three parts to this topic. The first will be covered in this post; a discussion of the impedance plots of the four measurements will show the effects of the different materials and the qualitative effects of eddy currents. The second part describes a test to verify the eddy current model described in the pdf file attached above in post #12 in a simple case where the assumptions used in the analysis can be shown to be valid. The third part describes comparisons of model and measurement for the four different cases.

    This figure (fourImpMs.pdf) shows the four different impedance measurements limited to 5 KHz so that the mid frequency eddy currents effects can be more easily seen. The first three measurements (air, alnico (rods), and steel (slugs)) found the same value for Rcoil (4698, to four digits), as ideally they should, but I find it a bit surprising that the measurements are so consistent. (They do differ in the next place.) On the other hand, the ExTech 120 Hz serial ac resistances for the three are 4703, 4672, and 4696, very close, but not as consistent. Perhaps this has something to do with the difference in the way the measurements are made, fitting across a small range of frequencies as opposed to a single frequency.

    It is expected that Lcoil would increase from air to alnico to steel, as it does. The values, pan versus ExTech are .7403 vs .7581, .9890 vs 1.004, and 1.3619 vs 1.379. I do not know the reason for the small consistent differences.

    The inductance of the alwrap case (1.4832, pan vs 1.513, ExTech) is surprising. Why did it go up significantly, compared to the steel case? The permeability of the magnetic material has not changed. But what has changed is the current distribution in the magnetic material because it is wrapped in a material with a higher conductivity. It is reasonable to suppose, but unproven in this case, that currents in the steel reduce its effective permeability by partially canceling the magnetic field. Perhaps moving some of these currents outside the material gives an effective permeability closer to what it would be with no currents. Also the predicted value for Rcoil is different compared to the other cases, indicating that the low frequency losses have changed, perhaps because the aluminium has a higher conductivity than the steel.

    All four capacitance measurements are within a few pf. This was not achieved so easily. The measurement described above (measurement at the peak, compensating for eddy current effects) did not turn out to be so consistent. The present method is to use 100 points from 20KHz down. This works fine for the four cases shown, but fails if the resonant frequency gets too close to 20KHz. There is still some work to be done on the algorithm for determining the capacitance. I will post a new source file later.

    It appears that there are some very slight eddy current effects in the air case because the real part (green) diverges from the dot-dash line just a little bit. This might result from interaction with the metal ground plane that the pickup sits above during the measurement. There is no significant change in the imaginary part. (The yellow line does not diverge significantly from dashed line.)

    The alnico case shows a significant increase in the real part and a small change in the imaginary part. This is a moderate eddy current effect. The steel has significantly larger effects, and the alwrap is similar, but significantly larger in the effect on the real part. Perhaps these results can be quantized, but this requires a verified model of the effects of eddy currents. The model described in the attachment to post #12, might be adequate, perhaps for some of the measurements, but not others. But first this model needs verification in a simple case where the assumptions necessary to derive it are known to be met. This will be described in a later post.

    Comment


    • #17
      Verifying the simple model for eddy currents

      The model for the effect of eddy currents attached to post #12 is simple, requiring only two parameters, a resistance and a coupling factor, although these can vary in frequency if necessary. Is the math used in deriving it correct? Even after checking it carefully, it is a good idea to generate a measurement showing simple behavior so that the comparison between it and the model gives confidence. For additional simplicity, we want a case where the parameters do not vary with frequency, and so we have to use conductors that are thin enough so that the skin effect is not an issue over the frequency range of interest (taken to go up to 5KHz). This can be achieved by wrapping a ribbon cable (Radio Shack, four conductor) around the pickup and joining all the ends together so that they act as a single low resistance shorted turn. Seven conductors (#20 something in size, I believe), four in one piece of cable, three in another, fit around the bobbin on top of the winding.

      The two parameters in the model, Rse and k, might vary in frequency, and so we need a way of modeling the frequency variation. We might expect Rse to vary as the square root of frequency in some cases because this is the variation associated with the skin effect in certain simple cases. We could write this as Rse = C*f^(.5), that is, Rse is computed by raising f to the one half power (another way of indicating the square root) and multiplying by some constant C. This suggests a more general model in which .5 is replaced by the variable p, where p is adjusted to best fit the measurement. The attached figure (powLawFns.pdf) shows the frequency variation for various values of p. They would all go zero at f = 0, except an offset has been added to the frequency to prevent this. When p is zero, the line is horizontal, no variation with frequency. The amount of variation increases as p increases.

      The next figure (fittingShort.pdf) shows the impedance up to 20Kz in the top plot. The resonant frequency has been raised significantly above that of the air case (15,200 Hz), consistent with the yellow line running well below the dashed gray line: the imaginary part of the impedance is reduced by the eddy currents in the shorted turn.

      The shorted turn is constructed from wire that is thin enough so that the skin effect is not significant up to at least 5 KHz. Therefore the resistance of the short does not change much, and so Rse should be close to constant, and the geometry (where the current flows) is constant and so k should be constant. Given the model, it is easy to employ a least squares inverse technique to find an estimate of the parameters associated with a measurement.

      The lower plot shows the impedance (with C removed, to only 5 KHz) and the results of the fit. Shown are the residuals (measurement minus model) of the real and imaginary parts. They are drawn twice, once at normal scale (the two lines essentially at zero) and again blown up 200 times. If the model were perfect and the measurement noise free, the residuals would be zero. Neither is true; however, the residuals are not too bad. The last two parameters on the plot are the powers p associated with the frequency variation of of Rse and the square of k. The latter actually is zero while the former is quite small, and could be the result of the relative insensitivity of the measurement at low frequencies. (Magnetic induction increases with frequency.) The results suggest that the analysis in the pdf file attachment is OK.

      Comment


      • #18
        Fitting with the Steel Slugs

        Another case where we expect the model to work is when the combination of conductivity and permeability is high enough so that the current flows near the surface at all frequencies of interest. In this case, Rse should vary with frequency since the conducting layer must change in thickness with frequency. k can change also since the geometry, and thus the flux linkage, is also changing, although this could be a smaller effect. Rse might not change with the square root of frequency; if the cores were very long cylinders, it should, but these are short.

        This figure(fittingSteel.pdf) shows the results; it is set up like the one for the shorted turn. The residuals are very small, indicating a very good fit, except at low frequencies. Rse varies with the 0.6 power, not far from the 0.5 (square root) that one would expect in some cases. k squared varies more slowly (p = .28); this variation is probably mostly at the lower frequencies, where the current layer might be getting thicker more quickly and also it is harder to measure there, and so there could be errors.

        The aluminum wrapped steel is shown here (). It is very similar.

        Comment


        • #19
          Fitting with Alnico Magnets

          Given the results for steel, what would one expect for alnico? The permeability is much lower than steel, and the conductivity is not very high. Thus, the current might not flow in a thin layer near the surface at all frequencies, perhaps not at any frequency within the analysis range. If so, we might not see much variation in frequency, but on the other hand, the values would have to be interpreted differently, as some kind of average, since the conditions of the model have been violated. The figure () shows high Rse; this is not surprising since the eddy current effects are less than with steel. The k is higher than with steel, and it is not clear how to interpret that. There is little variation with frequency, suggesting that the current is not flowing in a thin layer at any frequency. The residuals are also higher than with steel, possibly suggesting that the model is not as accurate as with steel.

          Comment


          • #20
            Two attachments in postings 18 and 19 come up as invalid, being Attachment 26794 and 26798.

            Comment


            • #21
              Originally posted by Joe Gwinn View Post
              Two attachments in postings 18 and 19 come up as invalid, being Attachment 26794 and 26798.
              Here is another attempt.
              fittingAlwrap.pdf
              fittingAlnico.pdf

              Comment


              • #22
                Version 1. replacing random noise, measuring frequency response with a coil

                Moving from version 0 to version 1 of the software, there are two major improvements. The first is the replacement of the measurement function of version 0, random noise, with a new function that results in accurate measurements in less time. The second improvement is a new function to complement the impedance measurement; this function uses a coil to measure frequency response.

                The first improvement is the subject of this post. We want a deterministic function that contains all frequencies over the 20KHz bandwidth of the measurement. One such function is the band limited impulse. There are two problems with using this function:
                1. The average power is extremely low, introducing possible noise problems;
                2. There is a problem using multiple impulses with reasonable spacing.

                The second needs some discussion. When a voltage impulse excites a pickup, the current response is stretched out due to the finite bandwidth of the pickup, that is, its impulse response. When the measurement is repeated at a reasonable rate, the impulse response has not completely died out, resulting in small, but annoying imperfections in the accumulated measurement. The solution is to vary the delays of the impulses from the beginnings of the measurement periods. A small systematic change from pulse to pulse is adequate.

                The first problem is solved in exactly the way one proceeds in a pulsed radar measurement. A binary phase code, the equivalent of many side by side band limited impulses of varying positive and negative polarity is used. The code should have a good approximation to a flat spectrum. The code can be specified in the parameter dictionary, but the default is one of length of 105. This is a reference for the code:
                Maryam Amin Nasrabadi and Mohammad Hassan Bastani (2010). A Survey on the Design of Binary Pulse Compression Codes with Low Autocorrelation, Trends in Telecommunications Technologies, Christos J Bouras (Ed.), ISBN: 978-953-307-072-8, InTech, Available from: InTech Open Access Publisher - Open Science Open Minds | InTechOpen telecommunications-technologies/a-survey-on-the-design-of-binary-pulse-compression-codes-with-low-autocorrelation.

                The code is shown here (code105.pdf); its autocorrelation function here (code105cor.pdf). The significance of this function for a radar is that it shows the strength of the signal of a target at its proper range (the large spike), and the strength of false targets associated with this target appearing at other ranges. This is signal, not power, which would be proportional to the square. The power spectrum of the code is shown here (code105pspc.pdf). Also shown is the spectrum of a typical random binary code, which is a much poorer approximation to flat. The poorer the approximation to flat, the longer it takes to get a measurement with a given noise level. Therefore the best code is used.

                An impedance measurement using the new function, summing 300 individual measurements, is shown here (sccode.pdf). A measurement also summing 300 individual measurements using random noise is shown here (scran.pdf). The difference in noise is about a factor of ten.

                Comment


                • #23
                  Outstanding work, Mike.

                  What is the rationale for choosing a specific binary pulse code over a generic maximum length sequence? In principle, you can get a spectral plot from both. Does the selected binary pulse code have that much of a better noise floor?

                  thx,
                  -drh
                  "Det var helt Texas" is written Nowegian meaning "that's totally Texas." When spoken, it means "that's crazy."

                  Comment


                  • #24
                    Originally posted by salvarsan View Post
                    Outstanding work, Mike.

                    What is the rationale for choosing a specific binary pulse code over a generic maximum length sequence? In principle, you can get a spectral plot from both. Does the selected binary pulse code have that much of a better noise floor?

                    thx,
                    -drh
                    That is a really good question!

                    The maximal length sequence would offer better performance, both because the sidelobe level is very low, -1, and because you could "transmit" continuously, increasing the average power. However, the implementation would be somewhat more difficult since you would have to feed something that has a characteristic length of 2^n -1 to something that prefers to work in 2^m. It is doable of course, although I would worry about the possible loss of sync because of other things happening on the computer. The current method has more than adequate SNR, and it does not care if some data gets lost. But, yes, the MLS would be a much more elegant way to do it! But, in this case, I am willing to do without some elegance in order to have something more robust that I think would be more likely to work on any computer. I want to try this on a cheap windows computer with a cheaper recording interface, and see how it does.

                    Comment


                    • #25
                      Originally posted by Mike Sulzer View Post
                      The current method has more than adequate SNR, and it does not care if some data gets lost.
                      Robust and simple is very very good, IMO.

                      ...but if you're curious, someone put a Pythonic MLS module on Github.

                      Thanks for the heavy lifting,
                      -drh
                      "Det var helt Texas" is written Nowegian meaning "that's totally Texas." When spoken, it means "that's crazy."

                      Comment


                      • #26
                        Originally posted by Mike Sulzer View Post
                        The maximal length sequence would offer better performance, both because the sidelobe level is very low, -1, and because you could "transmit" continuously, increasing the average power. However, the implementation would be somewhat more difficult since you would have to feed something that has a characteristic length of 2^n -1 to something that prefers to work in 2^m. It is doable of course, although I would worry about the possible loss of sync because of other things happening on the computer. The current method has more than adequate SNR, and it does not care if some data gets lost. But, yes, the MLS would be a much more elegant way to do it! But, in this case, I am willing to do without some elegance in order to have something more robust that I think would be more likely to work on any computer. I want to try this on a cheap windows computer with a cheaper recording interface, and see how it does.
                        As for the MLS sequence being one less than a power of two, there are two common approaches. On is to just pad it out with a zero. The other is to use the next largest sequence, and keep only a power-of-two length.

                        The biggest problem I see with Code105 is that it's so short, only 105 samples. This is why Code105 works much better than a random sequence of the same length.

                        MLS sequences generators are publicly known for generators up to 168 bits, the sequence length being two to the power of the size in bits of the generator. For example, a 32-bit generator provides a 2^32 bit sequence, a bit more than 4 billion bits.

                        All the random-pattern test equipment I know of uses MLS sequences. Maximum length sequence - Wikipedia, the free encyclopedia

                        A related issue when one is computing Fast Fourier Transforms of data sequences is to avoid errors cause by mismatch of start and end samples of the data sequence. The FFT implicitly computes a circular transform, so if the first and last sample values are not very close to one another, the step discontinuity will spatter "energy" into all FFT frequency bins. There are two common solutions.

                        One is to ensure that the FFT time window includes an integral number of test waveforms, so the first-last splice is smooth. This works perfectly, but can be hard to arrange with real-world signals.

                        The other is to use a window function: Window function - Wikipedia, the free encyclopedia

                        With a window function, the start and end points are always close to zero after windowing, so it doesn't matter if one pads a MLS sequence out by one bit to fit into a time window that is an exact power of two in length by samples, as desired for best FFT speed.

                        Comment


                        • #27
                          Originally posted by Joe Gwinn View Post
                          As for the MLS sequence being one less than a power of two, there are two common approaches. On is to just pad it out with a zero. The other is to use the next largest sequence, and keep only a power-of-two length.
                          I can see from your suggestions that some further explanation of how MLS sequences would be used here is necessary. A MLS has a circular autocorrelation function with the interesting property that the level is -1 except at 0 delay. To take advantage of this property, one repeats the code over and over: The autocorrelation function is a set of narrow spikes with side lobe level of -1 since the adjacent codes make the equivalent of the circular property. An example of such use is a continuous wave radar, such as the 2.38 GHz planetary radar here at Arecibo. A CW transmission is used for a length of time depending on the distance of the target; then receiving begins. Such coding is used for nearly all such targets. One exception is Mars, which is overspread. We use a random code technique that I developed 30 years ago, which flattens the spectral shape of the ambiguities introduced by the overspreading.

                          The MLS sequence would be used in the same way for the pickup impedance and frequency response measurement as in the planetary, that is, repeat the code over and over (no gaps). You have to use the whole code or the really good side lobe property is lost. I assume that the application that you were thinking of does not need the whole sequence.

                          Originally posted by Joe Gwinn View Post
                          The biggest problem I see with Code105 is that it's so short, only 105 samples. This is why Code105 works much better than a random sequence of the same length.
                          I do not see a problem with code105; it works just fine. If a code is of length n, then a random side lobe would have an expected value of sqrt(n). For the non repeating codes, yes, that gets good if you go long enough, but is it really better than the best code of that length, or just better than one you could find in a practical search? For the MLS codes using in a repeating mode, the random code can never be better no matter how large n is since the ratio of main to side lobes is n, that is, the first power.

                          Originally posted by Joe Gwinn View Post
                          MLS sequences generators are publicly known for generators up to 168 bits, the sequence length being two to the power of the size in bits of the generator. For example, a 32-bit generator provides a 2^32 bit sequence, a bit more than 4 billion bits.

                          All the random-pattern test equipment I know of uses MLS sequences. Maximum length sequence - Wikipedia, the free encyclopedia

                          A related issue when one is computing Fast Fourier Transforms of data sequences is to avoid errors cause by mismatch of start and end samples of the data sequence. The FFT implicitly computes a circular transform, so if the first and last sample values are not very close to one another, the step discontinuity will spatter "energy" into all FFT frequency bins. There are two common solutions.

                          One is to ensure that the FFT time window includes an integral number of test waveforms, so the first-last splice is smooth. This works perfectly, but can be hard to arrange with real-world signals.

                          The other is to use a window function: Window function - Wikipedia, the free encyclopedia

                          With a window function, the start and end points are always close to zero after windowing, so it doesn't matter if one pads a MLS sequence out by one bit to fit into a time window that is an exact power of two in length by samples, as desired for best FFT speed.
                          There are no narrow lines in the pickup impedance or response, and windowing is not really an issue here. By the way, the number of test waveforms per fft is just one. Incoherent integration is performed over the different "shots". There is no reason to compute over multiple wavforms since there are no narrow lilnes.

                          Comment


                          • #28
                            Originally posted by Mike Sulzer View Post
                            I can see from your suggestions that some further explanation of how MLS sequences would be used here is necessary. A MLS has a circular autocorrelation function with the interesting property that the level is -1 except at 0 delay. To take advantage of this property, one repeats the code over and over: The autocorrelation function is a set of narrow spikes with side lobe level of -1 since the adjacent codes make the equivalent of the circular property. An example of such use is a continuous wave radar, such as the 2.38 GHz planetary radar here at Arecibo. A CW transmission is used for a length of time depending on the distance of the target; then receiving begins. Such coding is used for nearly all such targets.
                            None of the radars I work on can reach past the Moon. There is war story to go with that: When the early warning radars (that look over the North Pole for the Soviet) were first turned on, there was this big target that didn't behave ballistically. Eventually, someone went outside and looked. There was the Moon. What was happening was that the search pulse came back many transmit pulses later, and so looked like a far closer target. Mission software soon learned some astronomy.

                            One exception is Mars, which is overspread. We use a random code technique that I developed 30 years ago, which flattens the spectral shape of the ambiguities introduced by the overspreading.
                            Curious. What is different about Mars? Is there a paper I should read?

                            The MLS sequence would be used in the same way for the pickup impedance and frequency response measurement as in the planetary, that is, repeat the code over and over (no gaps). You have to use the whole code or the really good side lobe property is lost. I assume that the application that you were thinking of does not need the whole sequence.
                            Typically not (because the sequences are not short); and the range to the target is initially unknown, so one cannot tolerate a picket fence of correlation peaks, at least not until firm track is established. Even after track is established, very few targets are as predictable as a planet.

                            I do not see a problem with code105; it works just fine. If a code is of length n, then a random side lobe would have an expected value of sqrt(n). For the non repeating codes, yes, that gets good if you go long enough, but is it really better than the best code of that length, or just better than one you could find in a practical search? For the MLS codes using in a repeating mode, the random code can never be better no matter how large n is since the ratio of main to side lobes is n, that is, the first power.
                            Of course Code105 works, but that wasn't the point. The point was that the difference in noise levels was due to the use of a very short sequence.

                            There are no narrow lines in the pickup impedance or response, and windowing is not really an issue here. By the way, the number of test waveforms per fft is just one. Incoherent integration is performed over the different "shots". There is no reason to compute over multiple waveforms since there are no narrow lines.
                            Windowing isn't just for narrow lines, it's also to prevent distortion due to spectral leakage via sin(x)/x sidelobes.

                            The advantage of coherent integration is that the SNR improves much faster than for incoherent integration, so long as things are stable enough that there isn't too much decorrelation. Testing a pickup on a lab bench ought to be stable enough. It should be possible to arrange things such that one can just add the complex ffts (one per shot) and divide by the number of ffts, all before finding the power spectrum. Or, better, average the (perhaps complex) waveforms from the shots before doing a fft.

                            Comment


                            • #29
                              Originally posted by Joe Gwinn View Post
                              None of the radars I work on can reach past the Moon. There is war story to go with that: When the early warning radars (that look over the North Pole for the Soviet) were first turned on, there was this big target that didn't behave ballistically. Eventually, someone went outside and looked. There was the Moon. What was happening was that the search pulse came back many transmit pulses later, and so looked like a far closer target. Mission software soon learned some astronomy.



                              Curious. What is different about Mars? Is there a paper I should read?



                              Typically not (because the sequences are not short); and the range to the target is initially unknown, so one cannot tolerate a picket fence of correlation peaks, at least not until firm track is established. Even after track is established, very few targets are as predictable as a planet.



                              Of course Code105 works, but that wasn't the point. The point was that the difference in noise levels was due to the use of a very short sequence.



                              Windowing isn't just for narrow lines, it's also to prevent distortion due to spectral leakage via sin(x)/x sidelobes.

                              The advantage of coherent integration is that the SNR improves much faster than for incoherent integration, so long as things are stable enough that there isn't too much decorrelation. Testing a pickup on a lab bench ought to be stable enough. It should be possible to arrange things such that one can just add the complex ffts (one per shot) and divide by the number of ffts, all before finding the power spectrum. Or, better, average the (perhaps complex) waveforms from the shots before doing a fft.
                              Also the DEW line radars also discovered the ionosphere (by accident, incoherent backscatter).

                              Mars is different because it rotates faster. That is what causes the overspreading. Venus, for example rotates much slower, as does Mercury.
                              You are ignoring what I said about codes in responding to your statement about code105.

                              Windowing: the six(x)/x is only a significant problem when there are narrow spectral lines.

                              coherent integration: The cross spectral analysis used here takes the product computed between the ffts of the two inputs. It might be possible to use a combination of coherent and incoherent integration, but I do not think that the added complexity is worth the trouble.

                              Comment


                              • #30
                                Measuring the frequency response using a coil

                                Measuring the frequency response of a pickup circuit using a coil to excite flux through the pickup is complementary to measuring the impedance. It is also useful for measuring the response of the entire guitar circuit; just plug it in using the usual cable.

                                The voltage induced in the pickup coil is proportional to the time rate of change of the current in the exciting coil. This tends to emphasize the high frequencies; since we want to measure the properties of the pickup, and not a fundmental property of electromagnetism, this increasing gain with frequency is removed in the software. The sensitivity of this measurement is low at low frequencies as a consequence of the small time derivative. The waveform for driving the coil is based on the same code described above, but it is passed through a digital filter to reduce the level of the high frequencies. This improves the low frequency measurements, but does not make them perfect.

                                The current in the coil is a function of the voltage applied and its impedance. Since the coil could be resistive at low frequencies and inductive at high frequencies, it is necessary to measure the current through the coil. This is accomplished by measuring the voltage across a resistor in series with the coil, and so, just as with the impedance measurement, it is necessary to use both inputs of a two input recording interface. The cross spectral analysis is nearly identical to that used in the impedance measurement; it is essential that a ratio is computed to remove the variations of current with frequency resulting from variations in the impedance of the coil and possibly other factors.

                                The frequency response of pickups is measured using the same test jig used for impedance measurements, but with some additions. A switching phone jack converts from one function to the other so that the same jig can be used. A guitar can be plugged into the jack as well. I will post the details of this in a later post.

                                The exciter coil is small, both 3/8" long and in diameter, wound with about a thousand turnsof #43; it has an inductance of 16.3 mH and a resistance of 317 ohms. It is air core, and can be placed over a single pole piece, between pole pieces, or wherever you want. 100 ohms is used in series for the current measurement, and it is fed from the head phone output on the recording interface. It is important that the level be adjusted correctly to avoid saturation or too low a signal to noise ratio. The steps in the setup will be discussed later.

                                The response of a Golden Age single coil bridge (overwound( pickup is shown here (scbr.pdf). It is shown with no load, except for the 110 picofarads of the duet cable harness, and with an additional 205 pf (the total being roughly equivalent to a short cable) in parallel with 125K, the parallel combination of the tone and volume pots. (The .022 mf capacitor has no significant contribution to the impedance when the tone pot is on 10.)

                                The response of an 11K humbucker is shown here (hb11K.pdf). Note that there is an interesting small effect at around 15 KHz, interesting, but well above the frequency where it matters. This is probably a result of coupling between the two coils in a frequency range near the coil self-resonance. Note that only one coil is excited in this measurement.

                                Comment

                                Working...
                                X