Announcement

Collapse
No announcement yet.

I need help with impedance matching for PC test rig

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

  • I need help with impedance matching for PC test rig

    Hi all,

    I recently had an idea (I'm sure someone has probably thought of this before...) for how to use my computer as an all in one test rig for my DIY guitar amps. The general idea is this:

    1) Record a short sample from my guitar straight into the PC. I want this sound to be completely raw...no effects...no preamp...only the signal that my guitar amp would see if I plugged the guitar straight in to the amp input.

    2) Connect the line-out from the PC to the input of the guitar amp being tested, and play the recorded sound sample from step 1.

    3) Use a probe to record the signal from different points in the amp circuit (after 1st preamp stage, 2nd stage, each side of the phase inverter, after the output tubes, etc...) and send this signal back to my PC (if it's capable of playing and recording at the same time??) or to a second PC if necessary.

    4) Analyze the waveforms of the signals from step 3 and tweak the amp circuit as desired.


    The reason I want to do all this from a recorded guitar signal is because I can compare the before and after of any tweak that I perform and see EXACTLY what change it caused by simply subtracting one waveform from the other, and doing Fourier transforms, etc.

    I know how to do all that waveform analysis, but what I'm not very sure about is how to match all the impedances from the various inputs and outputs so that this will record and playback "realistically". For example, I know that connecting my guitar straight to the PC microphone input is an impedance mismatch and will not record the same signal that the amp would see. Also, I'm sure I'll need to match the impedances on steps 2 and 3.

    So can anyone help me figure out how to build the 3 DI boxes I would need for this setup? I'm ashamed to say that I'm not even sure how to measure the impedances of these inputs and outputs...I understand the technical definition of impedance but that's about it. Tried to find some specs for my sound card impedances but it's a cheapo so the manual doesn't go into that level of detail.

    Any help or ideas would be appreciated.

  • #2
    Originally posted by CloroxCowboy View Post
    Hi all,

    I recently had an idea (I'm sure someone has probably thought of this before...) for how to use my computer as an all in one test rig for my DIY guitar amps. The general idea is this:

    1) Record a short sample from my guitar straight into the PC. I want this sound to be completely raw...no effects...no preamp...only the signal that my guitar amp would see if I plugged the guitar straight in to the amp input.

    2) Connect the line-out from the PC to the input of the guitar amp being tested, and play the recorded sound sample from step 1...
    There are many differences between the guitar signal and the line output from your computer. Guitars have a low level signal and a high impedance. The output from a computer sound card is low impedance and of a much higher voltage (that is called "line level"). Connecting a digital recording will not be the same as connecting a guitar since it line level. FWIW I used to use microphone matching transformers for the inputs on my 4 track recorder 25 years ago- only I was using them to convert the low level/high impedance signal from my guitar to a line level input. With those transformers the recordings sounded a lot better.

    To record and playback at the same time is called something like "duplex". I don't believe that the cheaper sound cards support that feature and even with the more expensive ones it can be a hassle to get it to work right. And if you are going to subtract one waveform from the other they will have to be synced exactly (something that might not be humanly possible). You would be better off using a separate digital recorder to play the signal and the computer to record the signal from the amp along with the signal from the recorder. (The mini-recorders keep getting cheaper and cheaper.)

    One other point: with your idea you are just looking at or listening to the waveform. It isn't just the sound but IMO the response is what makes or breaks an amp. Like how it responds to your playing technique and dynamics. Some amps have an almost magical response- it is like the amp is playing all by itself.

    Good luck with your project!

    Steve Ahola

    P.S. I'm sure that someone will jump in and suggest that you just try out your mods with your guitar plugged into your amp. But what the heck- if you want to go the Fourier route that is fine with me (I'm up to Five-ier myself).
    Last edited by Steve A.; 01-12-2010, 09:56 AM.
    The Blue Guitar
    www.blueguitar.org
    Some recordings:
    https://soundcloud.com/sssteeve/sets...e-blue-guitar/
    .

    Comment


    • #3
      Thanks for the response, Steve.

      Originally posted by Steve A. View Post
      There are many differences between the guitar signal and the line output from your computer. Guitars have a low level signal and a high impedance. The output from a computer sound card is low impedance and of a much higher voltage (that is called "line level"). Connecting a digital recording will not be the same as connecting a guitar since it line level. FWIW I used to use microphone matching transformers for the inputs on my 4 track recorder 25 years ago- only I was using them to convert the low level/high impedance signal from my guitar to a line level input. With those transformers the recordings sounded a lot better.
      So what I'm hearing is that I'd need to use a similar matching transformer for step 1 (guitar to PC), then use the same transformer in reverse (and maybe a voltage divider?) to go from PC to guitar amp input. Does that sound right?

      To record and playback at the same time is called something like "duplex". I don't believe that the cheaper sound cards support that feature and even with the more expensive ones it can be a hassle to get it to work right. And if you are going to subtract one waveform from the other they will have to be synced exactly (something that might not be humanly possible). You would be better off using a separate digital recorder to play the signal and the computer to record the signal from the amp along with the signal from the recorder. (The mini-recorders keep getting cheaper and cheaper.)
      That was my initial thought too. I'll plan to use a dedicated player and a dedicated recorder rather than doing both on the PC.

      One other point: with your idea you are just looking at or listening to the waveform. It isn't just the sound but IMO the response is what makes or breaks an amp. Like how it responds to your playing technique and dynamics. Some amps have an almost magical response- it is like the amp is playing all by itself.
      I understand what you mean, but I also don't believe in magic. Every part of an amp's sound SHOULD be able to be broken down to its fundamental attributes: pitch, amplitude, timbre, etc... Using the Fourier transform is just one part of the analysis, but after a FULL analysis of the waveforms any differences from one sound to the other SHOULD be crystal clear using this method. That's why it's so important to compare identical guitar signals.

      Comment


      • #4
        Originally posted by CloroxCowboy View Post

        So what I'm hearing is that I'd need to use a similar matching transformer for step 1 (guitar to PC), then use the same transformer in reverse (and maybe a voltage divider?) to go from PC to guitar amp input. Does that sound right?
        In my experience a matching transformer works better than a voltage divider. Perhaps someone can recommend something from Mouser (I never knew the specs of the transformers I had been using).


        I understand what you mean, but I also don't believe in magic. Every part of an amp's sound SHOULD be able to be broken down to its fundamental attributes: pitch, amplitude, timbre, etc... Using the Fourier transform is just one part of the analysis, but after a FULL analysis of the waveforms any differences from one sound to the other SHOULD be crystal clear using this method. That's why it's so important to compare identical guitar signals.
        The fundamental attributes you list (pitch, amplitude, timbre, etc.) all relate to the tone of the amp. I am not sure how you would quantify and measure the attributes of the response. I think that most guitarists would agree that response is almost as important as tone. "Touch response" is one quality that many guitarists look for- like when you can get radically different tones from the amp just by the dynamics of your playing. A related quality is how the amp cleans up when you back off the volume control on your guitar; it usually will clean up but are getting a good clean sound that you can work with?

        Good luck with your project!

        Steve Ahola
        The Blue Guitar
        www.blueguitar.org
        Some recordings:
        https://soundcloud.com/sssteeve/sets...e-blue-guitar/
        .

        Comment


        • #5
          I understand what you mean, but I also don't believe in magic. Every part of an amp's sound SHOULD be able to be broken down to its fundamental attributes
          That is quite true. To address Steve A's example, touch response is a kind of non-linearity. The harder you hit the strings, the more and higher-order harmonics the amp generates, and that changes the timbre.

          I always thought that a program that drew a FFT waterfall plot, like the freeware Spectrum Lab, should be able to quantify touch response by showing how all of the various distortion harmonics evolve throughout the envelope of a guitar note. Sonograms like these have been used to identify bird calls, but an amp hit by a standard test signal should produce a fingerprint just as distinctive.

          However, using an actual guitar note would complicate matters because it contains harmonics of its own, on account of the physics of the instrument, which itself has a similar kind of touch response. It might make the interpretation easier if you used a damped sine wave burst as the standard test signal.

          You're getting into quite ambitious goals here. I'm fairly sure that DSP modelling houses like Line6 must use techniques like this to extract the mojo from vintage amps. Well, the jargon word in nonlinear math is "system identification", not mojo extraction, but either way, identification of non-linear systems is fairly tricky and involves a lot of nasty mathematics with names like Volterra and Wiener. Really, the matching transformers are the least of your worries.
          Last edited by Steve Conner; 01-12-2010, 09:11 PM.
          "Enzo, I see that you replied parasitic oscillations. Is that a hypothesis? Or is that your amazing metal band I should check out?"

          Comment


          • #6
            Originally posted by Steve Conner View Post
            That is quite true. To address Steve A's example, touch response is a kind of non-linearity. The harder you hit the strings, the more and higher-order harmonics the amp generates, and that changes the timbre...
            Steve:

            Thanks for joining the discussion because you know much more about this stuff than I do.

            I do agree that everything about a guitar amp could be quantified, but I don't see that happening right away. There are so many mysteries in there that we do not even see, let alone understand. (I know that must sound like a religious tract handed out in front of the grocery store.)

            I do think that touch response has a lot more than just distortion and higher-order harmonics. I think that the results might depend on the style of guitar you are playing. Like blues vs. hard rock.

            Just my آ

            Steve A.

            Steve Conner said: "...either way, identification of non-linear systems is fairly tricky and involves a lot of nasty mathematics with names like Volterra and Wiener."

            Hey, I think I went to college with Wiener's grandson, Oscar Meyer!
            The Blue Guitar
            www.blueguitar.org
            Some recordings:
            https://soundcloud.com/sssteeve/sets...e-blue-guitar/
            .

            Comment


            • #7
              Originally posted by Steve A. View Post
              The fundamental attributes you list (pitch, amplitude, timbre, etc.) all relate to the tone of the amp. I am not sure how you would quantify and measure the attributes of the response. I think that most guitarists would agree that response is almost as important as tone. "Touch response" is one quality that many guitarists look for- like when you can get radically different tones from the amp just by the dynamics of your playing. A related quality is how the amp cleans up when you back off the volume control on your guitar; it usually will clean up but are getting a good clean sound that you can work with?

              Good luck with your project!

              Steve Ahola
              Thanks again, Steve A. One of the goals of this project is to quantify everything that can be quantified about my amps, and there are really only 2 fundamental "yardsticks" I can use to measure that sound: time and energy. Even the attributes I listed previously are derived from the 2 building blocks of time and energy. Pitch is obviously just a function of energy (sine function for a pure pitch) against the time dimension, instantaneous amplitude is just the amount of energy transferred at any one point in time, and timbre is the combination of pitches (often related in a harmonic manner) heard at different relative amplitudes. So there's the makeup of "Tone".

              Responsiveness or touch-sensitivity would just be the interaction of those 3 first-order derivatives (pitch, amplitude, timbre), the way they affect each other over time. As Steve Conner mentioned in his reply, these interactions are non-linear and would be very difficult, if not mathematically impossible, to perfectly represent with a formula. Which is exactly why modelling amps don't sound quite as natural as real tube gear. Fortunately, I'm not trying to build a better modelling amp, so I don't need a perfect formula, just one that's close enough to show me what's going on in general.

              Originally posted by Steve Conner View Post
              I always thought that a program that drew a FFT waterfall plot, like the freeware Spectrum Lab, should be able to quantify touch response by showing how all of the various distortion harmonics evolve throughout the envelope of a guitar note. Sonograms like these have been used to identify bird calls, but an amp hit by a standard test signal should produce a fingerprint just as distinctive.

              However, using an actual guitar note would complicate matters because it contains harmonics of its own, on account of the physics of the instrument, which itself has a similar kind of touch response. It might make the interpretation easier if you used a damped sine wave burst as the standard test signal.
              You're right, Steve C. Any sound can be analyzed with the FFT, and we'll know exactly which frequencies are present and at what amplitudes. Modelling a guitar note doesn't have to be more complicated though, since the harmonic overtones generated by the unique characteristics of each guitar will not change...unless of course you change the pickups, string gauge, PLAYER, etc.

              For example, the open D string on my stock '59 strat in mint condition (in my dreams ) will produce a slightly different harmonic signature from someone else's stock '59 strat, but those two signatures should be closer than a '99 squire strat, and much closer than a les paul with extra hot humbuckers. Two different players will also generate different harmonic signatures on the same guitar, but fortunately I only care about my own touch response for this project.

              That's where the recordings come in handy also. By recording my raw guitar signal I will have perfectly controlled all the variables other than the amplifier. So the procedure for testing would be:

              1) Play the recorded sample through the amp and run a FFT on the result. I should mention that this sample will include single notes, chords, hitting the strings hard and soft, changing the volume and tone controls, etc. So I'll be trying to capture on the recording as much of the unique range of my sample guitar as possible.

              2) Tweak only ONE component in the amp circuit.

              3) Play the same recorded sample through the amp and run a FFT on that result.

              4) Subtract result 2 from result 1 and you will have a crystal clear picture of how the tweak has affected the sound.

              Again, I don't care about coming up with a nonlinear formula to perfectly describe this change. What I'll be doing is running tons of these tweak tests and making note of the changes that produce pleasing results to MY ear. Then by looking at the waveform differences for the samples I like best, I can figure out mathematically WHY I like them best and hopefully move closer to my own personal Holy Grail tone in a very scientific way. Hope I explained that well...

              But unfortunately to me the confusing part was the impedance matching. I think based on what I'm hearing from you guys, as long as I make sure all my load impedances are a good bit larger than my source impedances I should be ok. That would be "impedance bridging" if I'm not mistaken, preserving all the voltage characteristics, but sacrificing some power in the transfer. Since tubes are voltage control devices, that would make sense.

              Comment


              • #8
                Originally posted by Steve A. View Post
                Steve:

                Thanks for joining the discussion because you know much more about this stuff than I do.

                I do agree that everything about a guitar amp could be quantified, but I don't see that happening right away. There are so many mysteries in there that we do not even see, let alone understand. (I know that must sound like a religious tract handed out in front of the grocery store.)

                I do think that touch response has a lot more than just distortion and higher-order harmonics. I think that the results might depend on the style of guitar you are playing. Like blues vs. hard rock.

                Just my آ

                Steve A.

                Steve Conner said: "...either way, identification of non-linear systems is fairly tricky and involves a lot of nasty mathematics with names like Volterra and Wiener."

                Hey, I think I went to college with Wiener's grandson, Oscar Meyer!
                Yeah, I agree. Way too much going on in a guitar amp to model it perfectly. And style of playing should definitely affect the sound, but I think some of that COULD be quantified because it's dependent on real world variables like how hard the strings are being hit, finger pressure on the fretting hand, levels of the volume and tone controls etc...

                Comment


                • #9
                  Originally posted by CloroxCowboy View Post
                  Two different players will also generate different harmonic signatures on the same guitar, but fortunately I only care about my own touch response for this project.
                  I beg to differ. I think the same player, playing the same note on the same guitar will get a slightly different harmonic signature every time. There are so many variables, like where the pick hits the string along its length, what angle it hits at, where the left hand finger is resting in relation to the fret, and so on. That's what makes a guitar so much more fun to play than a guitar synth, a good guitarist will exploit all of these effects to make the instrument sing.

                  ...
                  4) Subtract result 2 from result 1 and you will have a crystal clear picture of how the tweak has affected the sound.
                  Crystal clear maybe, in that all the information you want is theoretically contained in it. But possibly quite hard for you to interpret. You still need to relate changes in the appearance of the plot to changes in tone, and that doesn't always seem too obvious to me.

                  Except for trivial things, like making a coupling capacitor smaller would make the bass end of the FFT plot sink down. That's a simple, linear, first-order effect that you should have been able to visualize already.

                  But changing the coupling cap also has a non-linear effect. A smaller coupling capacitor lets the following stage recover quicker from overdrive, because it doesn't store the DC charge due to grid current for so long. To my mind at least, that is a very important coefficient in an amp's touch response. Not only does the harmonic mix depend on how loud the signal is "right now", it also depends on how loud it's been, like a compressor with a release time. How can you see your method measuring that?

                  Wiener's method was to use white noise as the test stimulus, on the premise that it can be seen as a (linear) combination of all possible signals. This is how those new digital EQs for PA systems identify the frequency response of a room. But I don't really see how this would work any better. (Not sure if he's related to Oscar Meyer )

                  as long as I make sure all my load impedances are a good bit larger than my source impedances I should be ok.
                  Yes. But be aware that matching transformers, especially cheap ones, are notoriously bad at this. They have self-capacitance that causes them to load the signal down heavily at high frequencies, and the higher the design impedance, the worse it gets. Cheap ones have a big resonant peak like a hot humbucker. You won't get an audio transformer with a 1 Meg design impedance anywhere. Much better (IMO) to use an active buffer as I explained in a previous post.
                  Last edited by Steve Conner; 01-13-2010, 09:41 AM.
                  "Enzo, I see that you replied parasitic oscillations. Is that a hypothesis? Or is that your amazing metal band I should check out?"

                  Comment


                  • #10
                    Originally posted by Steve Conner View Post
                    I beg to differ. I think the same player, playing the same note on the same guitar will get a slightly different harmonic signature every time. There are so many variables, like where the pick hits the string along its length, what angle it hits at, where the left hand finger is resting in relation to the fret, and so on. That's what makes a guitar so much more fun to play than a guitar synth, a good guitarist will exploit all of these effects to make the instrument sing.
                    I don't think I ever said otherwise. In fact, that's the whole reason I'm talking about using a recorded guitar sample. Trying to compare two different source signals, even the same notes from the same guitar and the same player, would not work at all for my method, for exactly the reason you mention above. It needs to be EXACTLY the same signal to be a good scientific test. The only other way I can imagine would be to build a robot to play the notes with identical pick force, angle, position, etc every time...and I'm definitely no robotics engineer.

                    Crystal clear maybe, in that all the information you want is theoretically contained in it. But possibly quite hard for you to interpret. You still need to relate changes in the appearance of the plot to changes in tone, and that doesn't always seem too obvious to me.
                    I won't be interpreting the results visually. I'll be using a custom program I'm writing as part of this project to analyse the actual 1s and 0s of the .wav files. And I'm not trying to craft a perfect formula that would allow me to model the amps completely. But I think I can get a bit further than seeing a bass roll-off for sure.

                    Yes. But be aware that matching transformers, especially cheap ones, are notoriously bad at this. They have self-capacitance that causes them to load the signal down heavily at high frequencies, and the higher the design impedance, the worse it gets. Cheap ones have a big resonant peak like a hot humbucker. You won't get an audio transformer with a 1 Meg design impedance anywhere. Much better (IMO) to use an active buffer as I explained in a previous post.
                    Thanks, I wasn't aware of that. Two questions:
                    1) Are there any better-designed transformers that would not exhibit this problem, or to a negligible extent? Like maybe an oversized Hammond with 20Hz-20kHz response? 2) If not, can you recommend any good off the shelf buffers (hopefully inexpensive since I don't need any features other than the impedance bridging and signal attenuation)?

                    Thanks again.

                    Comment


                    • #11
                      This is really close to an idea I've always had rumbling around in my mind, at least as regards recorded test signals. I had a friend that had a guitar shop and through it passed any number of bona fide vintage high value guitars. I thought it would be fun to do a very accurate digital recording of test sounds from the vintage instruments, then make up a test CD to be able to reproduce how an effect pedal (my use for this) would respond to the instrument.

                      The problem is, of course, that what plays back is not the instrument but a CD player or other source of digital audio, and that does not have the impedance characteristics of the guitar, so any interaction of the guitar pickup with the input of the effect (or amp).

                      There is a fairly well known trick in effects circles to fake the impedance of a pickup. This came about because buffers preserve treble, but fuzz face derived distortions depend on the pickup impedance for their sound. It's no great mystery - pickups act like a signal voltage source in series with a big inductor and its included self-capacitance. So buffer your signal, but then insert an inductor which is similar to the pickup's to add in the impedance nature. It does seem to work OK.

                      I'd say that the thing to do here is not to match impedances, but to provide a reasonable facsimile of the actual impedances. Audio work almost always needs not matched impedances, but correctly mismatched impedances - that is, the receiving end does not load down the sending end. Matched impedances inherently mean that you lose half your signal voltage in the sending end impedance, and that's not generally what we do. The exception to this is low-impedance balanced audio work, which is different from what we're talking about here.

                      So I'd say what you need to do is
                      - for the send to the amp, use the PC output and run this through a resistive divider to match levels, but insert an inductor which is chosen to fake the pickup response. Cheap audio transformers *do* have an reasonable primary inductance for this, at least for effects work. You may even want to go to some lengths for creating an accurate impedance circuit. This will correct the impedance of the guitar signal to closer to what a guitar would do.
                      - for feeding the PC inputs, you're not so interested in matching impedance as you are in not loading down - and changing! - the signal being monitored. So you need a quite high input impedance buffer there which can withstand the signal levels and possibly possibly high DC voltages you might accidentally connect it to, without any loading on the circuit being monitored. A very high impedance buffer fits that need well. A tube or high voltage MOSFET buffer would be appropriate if you get the impedance into the buffer more than 10x the impedance of any point you want to monitor.
                      Amazing!! Who would ever have guessed that someone who villified the evil rich people would begin happily accepting their millions in speaking fees!

                      Oh, wait! That sounds familiar, somehow.

                      Comment

                      Working...
                      X