distortion and Twin-T filters

Started by samhay, October 24, 2013, 06:22:39 AM

Previous topic - Next topic

samhay

I have had a couple of designs on the breadboard lately that have used de-tuned Twin-T(ee) filters to generate wide notches.
(Twin-T filter: http://www.radio-electronics.com/info/circuits/rc_notch_filter/rc_twin_t.gif)

I have used passive filters, which are buffered with op-amps (and are part of larger circuits). The circuits have worked predictably until a clipped signal is fed into them, at which point the distortion becomes very non-musical. I have also tried active filters, but these don't seem to be immune to this rather horrible distortion either.

I am pretty sure it is the filter that is causing the distortion, but I just wanted to see whether this is a known issue (I guess it must be), and/or if anybody has any experience with this problem, and/or can suggestion alternatives. The origin of the distortion is also a little intriguing, but googling is not very helpful in this regard as this topology is also used for distortion analysis.


Edit - Title changed from 'distortion in Twin-T filters'
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

PRR

The R-C network can't distort.

Show your whole implementation.
  • SUPPORTER

samhay

#2
Perhaps I should re-phrase. If I feed a clipped signal into these, the harmonic content changes in a most displeasing way.

This is probably fairly representative of how it sounds. The input waveform is a 400 Hz sine wave.
(Edit - updated)





I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

samhay

I'm guessing that this is an issue with the time constant associated with each cap in the filter - they can't keep up with the sharp voltage changes.
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

R.G.

It's an issue with the frequency content of the original signal and the phase response of the filter as well as the magnitude response.

Your original signal in that simulation is a clipped sine, I think. It looks like it's about symmetrically clipped, so the frequency content for frequency F0 clipped that way is F0* (A + B*3 +C*5 +D*7 + E*9 +...) where A, B, C... are the relative magnitudes of the harmonics and the 3, 5, 7,... are the harmonic number in number of times the original frequency.

Your filter is causing a broad-ish loss of signal centered on some filter frequency. The magnitude response is that same notch pattern times the individual frequencies applied to it. But the phase response is NOT invariant with frequency.

The way a Twin-T works is to phase shift the signal ahead on one side and back on the other, then add the two so they cancel at the filter center frequency.  Using this method, it is one of the very rare R-C filters that can cause an infinitely deep notch when everything is tweaked just right and the two sides cancel properly. But there is a phase shift on both sides. So harmonics above the center of the filter are shifted one direction, below the center the other. When they're added back together, the magnitude dip is there, but the phase shifted harmonics no longer add to a smooth waveform. Since time domain and frequency domain are equivalent ways to see signals for non-time varying signal content, the glitches you see in the simulation are the time response that the magnitude notch and phase shifting in the filter produce.

The filter is not distorting - it can't do so, as noted earlier, in any significant way. What you see is the harmonically rich signal fed through the filter.

Try running an FFT on the signal from before and after the filter and compare them. Look at both magnitude and phase.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

samhay

#5
Thanks R.G.
I guess I wasn't ever claiming the filter caused distortion per se - sorry for the poorly-worded first post; I've tweaked the thread title as a result.

The FFT analysis is quite informative. I have updated the image in the earler thread, and there is now a frequency and FFT plot. If I have this right, we loose the fundamental (and depending on how wide the notch is, perhaps the first few harmonics), but keep the higher order harmonics. This is not good thing, as it makes it sound very fizzy.

This problem arose when I ran out of headroom and had op-amp clipping before the filter. I tried to fix it by making the op-amp clip more gracefully, but I guess I need to either work on this, and/or find some more headroom.
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

Seljer

Your average marshall tonestack tends to make most things sound pretty bad when you set the controls to 10 - 0 - 10 and get a notch even bigger than that one

samhay

Thanks - I was hoping to hear from others real-world experiences, as I was starting to wonder whether I was hearing things.
The notch filter above is part of a cab sim I have been playing with. Even with a couple of 2-pole LP filters after it, it still sounds pretty bad when you feed it a heavily distorted signal.
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

R.G.

Most guitar speakers have heavy losses above 7kHz or so. Does your cab sim have a similar high frequency cut?
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

samhay

Quote from: R.G. on October 25, 2013, 10:28:44 AM
Most guitar speakers have heavy losses above 7kHz or so. Does your cab sim have a similar high frequency cut?

It does indeed. Assuming minimal pilot error on the breadboard, it should have a 4-pole LP from ~4 kHz. It  certainly sounds like this is the case.
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

PRR

> the phase shifted harmonics no longer add to a smooth waveform

Thanks for that explanation.
  • SUPPORTER

jblack547

Your filter took out a good portion of the original sine wave. All that is left is the harmonic content. A clipped sine wave can be expressed as the sum of the fundamental frequency plus a couple odd harmonics (at the right amplitude and phase as RG points out)---maybe only two or three harmonics is required. If the fundamental frequency is 400hz, add 3(400)hz and a 5(400)hz signals together you get a nice approximation of a square wave at 400hz. When you clip a sine wave, that is essentially what you get. 

Looks like the twin t is working great and all that is left are the harmonics!

Another approach might be to add a parametric filter at the low end and one at the high end. That way you can control gain, bandwidth and center frequency to get the curve you want instead of cutting gain in one spot. You have seen these filters on mixing consoles.

Cool analysis tool. What is it?


samhay

#12
^Cool analysis tool. What is it?

It's just an LTSpice simulation. Was away from the breadboard, so had to cheat. If I can get some quiet time today, I will see how close it looks in the real world.

Edit: Real world agrees (400 Hz squared-off sine wave into a similar fiter; top, no filter; middle, shallow notch; bottom, deep notch):

I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com