Announcement

Collapse
No announcement yet.

I'm designing a distortion circuit :)

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

  • I'm designing a distortion circuit :)

    Hi everyone, i've come here from the diyguitarist forum to get a few more opinions on a seemingly crazy problem i'm having with my distortion design.

    Basically, I've thrown out the old diode soft clipping altogether cos i'm a crazy metalhead and I want to try my own version of hard clipping which is kinda like what i've drawn in this diagram.....



    Up the top i've got 2 signals... a square wave and a triangle wave with the top clipped off, and when you add the 2 together u get a nice (variable.... refer to bottom of diagram for 2 extremes) corner clipping thing happening. I don't know exactly how this will sound but I want to give it a try, however I've got a problem actually aligning the 2 waves in order to add them correctly. The triangle wave is lagging 1/4 of the period so I need either a 90 degree phase shift or a time shift. The problem with phase shifts is that they are frequency dependant, so that's looking really hard, and time shifts or delay circuits possibly wont achieve a delay small enough.... or possibly won't be as accurate as a phase shift.

    I've searched the net for MANY hours trying to figure this out, but its reaaaaaly difficult to find anything that will actually help. I don't know if anyone here could help at all, but if you can then that'd be awesome .

    Thx everyone .

  • #2
    You should easily be able to make that waveform out of a guitar signal using a diode waveshaper type of circuit, as shown on page 4 of this PDF:

    http://www.ee.sc.edu/classes/Fall06/...lgenerator.pdf

    I'll warn you in advance though: Diode clipping is about as hard and nasty sounding as it gets, there's nothing "soft" about it, unless you use wussy "Vintage" germanium diodes or something.

    I expect your waveform to sound much the same as ordinary diode clipping, since the sharp corners in your approximation will give it lots of high frequency harmonics. It maybe will have less HF content due to having some triangle wave (whose harmonics fall off at 12dB/oct) mixed in with square wave (which falls off at 6dB/oct)
    "Enzo, I see that you replied parasitic oscillations. Is that a hypothesis? Or is that your amazing metal band I should check out?"

    Comment


    • #3
      Diodes are like the easy way out. I would just give up and use them, but the way i'm doing it (adding the 2 waves together) could be used for other waveshaping circuits that aren't so easily shaped by simple components such as diodes. Like maybe I wanted to make some random squiggle, then that could be broken up into amplitudes that u add together.

      So basically I'm thinking ahead, and worrying more about what I can learn rather than the easiest way I can do things. I don't mind if nobody can help cos it seems like a hard thing to do, but either way i'll keep at it .

      Comment


      • #4
        Since the square wave is integrated to get the triangle it will always be 90 degrees out of phase. To get the waveform you want you will have to run the triangle through a zero crossing detector to "reverse engineer" a square wave in phase with the triangle. However, these circuits produce a constant amplitude output totally non-responsive to amplitude of input signal from the guitar. As the input signal decays the output waveform will just abruptly die.

        You might still use this scheme if you run combined waveform through a VCA controlled by an envelope follower to reconstruct the dynamics of original input signal and achieve required sustain and nice decay.

        Remember also that guitar signal is far from a steady sine wave so that square-to-traingle-to-square scheme in its basic form will tend to produce unwanted garbage at the output.
        Aleksander Niemand
        Zagray! amp- PG review Aug 2011
        Without the freedom to criticize, there is no true praise. -Pierre Beaumarchais, playwright (1732-1799)

        Comment


        • #5
          Have you tried using a slew rate limiter to generate the triangle wave?

          Comment


          • #6
            Given that your ear isn't sensitive to phase, I bet it would sound pretty much the same if you just added the two waveforms without worrying about aligning them.

            Like a previous poster said, 99% of the sonic characteristics and playing feel of this thing will come from the circuit that you put before it to synthesize the guitar signal into square and triangle waves anyway. You can use phase-locked loops to lock any waveform to any other with any phase shift you like, at the cost of sounding like John McLaughlin on a bad day.

            If you have really far-out ideas that you're struggling to implement in ordinary electronics, you might enjoy playing with a DSP board or something.
            Last edited by Steve Conner; 10-17-2006, 09:58 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


            • #7
              Ok, I came to a point where I had to just go back to basics, and like 95% of the time the answer was actually (i think) a lot simpler than I thought.

              If I have 2 stages..... one that turns the input into a square wave, and another that 1) Integrates the input signal (90 phase shift as the integral of sin is -cos) 2) turns that into a square wave, and 3) turns that into a triange wave...... THEN the triangle will be ahead 90 degrees and I can add it with the square from stage 1 .



              Thanks for all the input btw .

              So, is there anything at this stage that anyone knows that could be beneficial in what i'm doing?? I really want to learn as much as I can from this project cos its my first design attempt.

              Comment


              • #8
                all-pass filter

                Hey,
                Going back to your original idea of using just a phase shifter and mixing the two, I didn't quite understand why the frequency dependant phase shift was that big a problem. Can you design an all-pass filter with a (near) constant phase shift for the frequency spectrum you're interested in?

                You might be interested in this pedal I designed several years back...let's hope it still works
                http://krustykorp.tripod.com/dcbiasfuzz.htm

                with a compressor in front to get rid of the ugly gating sounds, it's an interesting fuzz.

                Comment


                • #9
                  I thought all-pass had constant unchanged amplitude but not phase. Thats how I see it, but I could be wrong.

                  Comment


                  • #10
                    allpass filter

                    Originally posted by Eternal Dragon View Post
                    I thought all-pass had constant unchanged amplitude but not phase. Thats how I see it, but I could be wrong.
                    Well you're right in that allpass filters should have unity magnitude response and that they don't always have a constant delay (linear phase) response. However you can design a higher order filter in such a way that for the required bandwidth, the response might approximate what you're looking for.

                    In certain circumstances, say when a lowpass filter is implemented, it may be required to account for the phase effects of that filter by cascading it with an allpass filter that equalizes the phase response to provide a (near-constant) group delay.

                    This is useful when you have say a triangular wave on top of which is superimposed some very high frequency noise (w.r.t the higher harmonics of the triangular wave). If you just lowpass filter the signal to rid yourself of the HF noise, the relative phases of the harmonics that you are interested in may not be "aligned" properly and your triangular waveform will now be dispersed and no longer triangular. You would then put the low-pass filtered signal through an allpass filter to account for the phase discrepancy and you'll reconstruct your signal without the HF noise.

                    Good luck!

                    Comment


                    • #11
                      Originally posted by Steve Conner View Post
                      Given that your ear isn't sensitive to phase, I bet it would sound pretty much the same if you just added the two waveforms without worrying about aligning them.
                      Note that our ears aren't sensitive to initial phase, but I do believe we are sensitive to the relative phases of partials. Specifically in the attack of a sound IIRC.

                      Comment


                      • #12
                        Originally posted by Steve Conner View Post
                        Given that your ear isn't sensitive to phase, I bet it would sound pretty much the same if you just added the two waveforms without worrying about aligning them.
                        Actually the human ear is sensitive to phase. However, the sensitivity varies with frequency.

                        Originally posted by Eternal Dragon View Post
                        Ok, I came to a point where I had to just go back to basics, and like 95% of the time the answer was actually (i think) a lot simpler than I thought.

                        If I have 2 stages..... one that turns the input into a square wave, and another that 1) Integrates the input signal (90 phase shift as the integral of sin is -cos) 2) turns that into a square wave, and 3) turns that into a triange wave...... THEN the triangle will be ahead 90 degrees and I can add it with the square from stage 1 .



                        Thanks for all the input btw .

                        So, is there anything at this stage that anyone knows that could be beneficial in what i'm doing?? I really want to learn as much as I can from this project cos its my first design attempt.
                        The circuit as is will subtract the triangle wave from the square wave, as they are of opposite polarity. I would ditch the whole mixing arrangement and simply run the square waver into both integrators in series.

                        Comment


                        • #13
                          In my own mind, I make a distinction between the concepts of a scheme and a plan. A plan is an outline of what to do, where the materials come from, what time and labor is needed, the actual work steps to do, and so on to accomplish some goal.

                          A scheme is the idea that you ought to accomplish thus-and-such a goal without having any clue how to do it. Schemes only become plans when you can fill in the middle.

                          You say:
                          I've thrown out the old diode soft clipping altogether cos i'm a crazy metalhead and I want to try my own version of hard clipping which is kinda like what i've drawn in this diagram.....
                          Can you tell us what this new waveform sounds like and why it's better for a crazy metalhead kind of sound?

                          Do you know how to do the waveshaping to get either one of the two waveforms you're going to add?

                          It's simple to get a rectangle wave - just infinitely amplify and clip. However, getting from there to something else is hard. You can integrate a rectangle wave to a sawtooth, which is the more general case of a triangle but with variable up to down ramping times, matching a non-square rectangle wave.

                          I mention this because guitar is NOT a sine wave, and does not in general give clean square waves unless you do massive, and usually intelligent tracking filtering to get the fundamental out of it. Getting clean sine out of a guitar is modestly more complex than a 31 channel graphic EQ.

                          Then there's the fact that a variable frequency rectangle wave being integrated does not give a constant-amplitude sawtooth. The size of the triangle goes down linearly with frequency - which increases exponentially with notes, so the size of the triangle decreases exponentially with musical notes.

                          A guitar not being a sine wave, integrating it does not give a cosine shifted 90 degrees from the sine, and squaring that integrated sine doesn't necessarily give a rectangle wave at the same frequency. Guitar signals may and often do have more than one zero crossing per cycle of the fundamental frequency.

                          Diode waveshapers won't do what you want because a diode waveshaper is most predictable with triangle waves, and you can't get to a simple triangle wave easily as I just discussed.

                          As a side note, doing all this processing loses the note dynamics - attack, decay, sustain, release - as well as volume entirely. You'd have to extract the envelope in a side chain, work at constant volume for waveshaping, then re-impress the ADSR envelope on what you got a the end of the shaping. And then the timbre would not change as the note decayed, so you'd need some envelope sensitive filtering to reimpress that effect on the result to get a more natural (i.e. non-synthesizer) sound on the result.

                          There is one technology that can do something like what you want. Filter your incoming guitar down to a point where there is one zero crossing per fundamental cycle, square that up into a rectangle wave, then phase-lock multiply that up by about 16x. Using that higher frequency, divide down to the fundamental and use weighted resistors to shape the result into a suitable wave. This is analogous to the diode waveshaper, but it uses time steps along the wave rather than some hypothesized triangle wave to trigger changes with voltage levels. The output(-s; there may be several different waveshapes made by this technique, all at the same time) of this PLL multiply scheme can then be filtered, and have the original envelope impressed on them.

                          As a side note, the PLL multiplier can also generate octaves up and down as well as just-intonation harmony notes for you if you like. All you have to do is to do the math to make one or more PLLs lock and generate the extra notes.

                          One reason you can't find suitable circuits for you waiting on the net is that things don't work the way you are supposing they do. How do I know this?

                          I started down the same path in about 1971. It's been a long journey, with lots of twists.

                          Keep the motivation and the drive, but learn more, lots more. Dig in, you'll enjoy the ride.
                          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


                          • #14
                            Wow thx mate, you seem to know heaps .

                            I guess the main thing I wanted to do was add certain waves together, which would give more control over certain aspects of the shape. Thats all it really comes down to. Would you recommend that I try my way then work on ironing out all the problems once I have it prototyped?? I just reaaaaly don't want to be one of those ppl who just grab a schematic off the net and put it together without thinking of the design.

                            Comment


                            • #15
                              In spite of what R.G. says (and I know he was tinkering with music electronics well before I was even born) I think it should be possible to use the diode waveshaper in the feedback path of an op-amp to make something vaguely like what the original poster wanted.

                              By just hooking the thing into the feedback path, the gain will be:

                              Infinity for small signals when no diodes conduct (sounds about right for crazy metalhead, in practice would have to be reduced by a high value shunt resistor)

                              Zero for large signals when the dual series diode strings conduct (to give the flat top to the waveform)

                              Some value of your choice for signals between one and two diode drops, when the single diode pair with resistor conducts (to get the sort of triangle-y looking parts)

                              By replacing the dual diode strings with that transistor/pot "Rubber diode" circuit, you could make the flat top adjustable in a similar way to what the OP wanted. Or split the waveshaper across two op-amps with a gain control in between to do the adjustment.

                              FWIW, my favourite solid-state clipping circuit so far is a rubber diode made with a MOSFET instead of a regular transistor. It ends up giving a smooth squashing of the waveform that's almost more compression than clipping.
                              "Enzo, I see that you replied parasitic oscillations. Is that a hypothesis? Or is that your amazing metal band I should check out?"

                              Comment

                              Working...
                              X