Active Twin T Resonant Peak Filter output signal decay time - Page 1
Forum section: electronics / beginners

author: Laurz
author_rank: Newbie
timestamp: April 09, 2024, 06:35:28 am
content: Hi there. The enclosed schematic shows an 'Active Twin T Resonant Peak Filter.' The filter which is fed with a square wave, produces a sine wave output and peaks perfectly at the desired frequency of 250Hz. However being a resonant circuit with a rather high 'Q', the output is very slow to decay. This effect is even more pronounced if I choose a lower frequency (say 150Hz and changing the components accordingly). It can be up to about 1 second before the output collapses completely. The application that I'm using this circuit for requires a fast decay of the output signal. If I try to reduce the value of the feedback resistor, it starts to impact on the frequency that the filter peaks at. Is there a modification I can make to this circuit, or additional circuitry that I can add, to improve the decay of the output signal without impacting too much on the Q of the circuit or the resonant frequency it's tuned to? Thanks for any help.

author: Terry Bites
author_rank: Super Contributor
timestamp: April 09, 2024, 07:38:45 am
content: The higher the Q the longer the decay. Check for unwanted stimuli that are pinging your filter. Insufficient bypassing casuing unwanted feedback via the power supply?

author: Laurz
author_rank: Newbie
timestamp: April 09, 2024, 08:28:54 am
content: Thank you so much Terry! I will check those things. Cheers...

author: MrAl
author_rank: Super Contributor
timestamp: April 10, 2024, 10:59:20 am
content: Quote from: Laurz on April 09, 2024, 06:35:28 amHi,This is interesting because what you are seeing is probably the exponential part of the response which for AC circuits is usually ignored even though it could be important. The exponential part can build or die out fast or slow depending on component values, but also on the input drive signal.In some circuits you can get past this with just changing the phase of the start of the input AC sinusoidal wave. To do that though you have to have control over the phase of the input when it starts and when it stops. Unfortunately, this may be hard to implement, and the effectiveness has to be evaluated first anyway.Because of the nature of this problem the only way may be to add some active clamping circuit. That could be as simple as an analog switch or maybe just a transistor. That would kill the output when the input is turned off. If you do not have that option though then we'd have to look for other ways. This may mean it is not possible with this circuit.I'd like to analyze this circuit and see what comes out of it.

author: jonpaul
author_rank: Super Contributor
timestamp: April 10, 2024, 11:02:59 am
content: Study the basics of a 2 pole second order system.It is an inherent property, of ALL second oreder systems.Same for a simple L-C serires or parallel resonantj

author: MrAl
author_rank: Super Contributor
timestamp: April 10, 2024, 12:08:55 pm
content: Quote from: Laurz on April 09, 2024, 06:35:28 amHello again,I took a quick look at this circuit and it looks both interesting and unusual. It's unusual because it has R5 when a regular twin T has no R5.I would have to ask where you got this circuit from because of that extra resistor, R5.What it looks like so far is that R5 not only changes the gain and the frequency, it may also introduce a DC offset. How large that is would have to be measured to see if it is significant or even measurable. That would mean that the output would not be a pure sine but be a sine with a negative offset for a positive input and a positive offset for a negative input. You could check on this though with a scope. There is a chance that the input capacitor might help with this though.The other thing is that it looks like the exponential part is controlled by C2*R5, and the larger that product the longer the decay. This assumes that in order to keep the same relationships between the three main capacitors, if C2 changes then the other two main capacitors must also change in order to keep the center frequency the same, and of course the resistors would have to change also. Thus, making C2 as small as possible may help, but everything else has to be adjusted accordingly, except for R5. If R5 were to change to make up for the change in C2, then the change in C2 would not do anything.If R5 were infinite (not there at all) then there would be no exponential part, but it would be hard to believe that if you had a sine wave output that was at it's positive peak and you turned the input off, the sine wave would immediately fall to zero. The sine wave peak would have to decrease, and because of the reactance of the circuit, it would take time for that peak to settle out. At low frequencies like 100 or 200Hz, that's going to take some time even in an ideal case. This probably means it will required some active clamping.One way to get this would be to use a comparator to detect when the input is zero and then shunt the output to ground. Of course a smaller value resistor between the output and the following stage would act as some impedance between the output of the op amp and the shunt.One thing I don't think you mentioned yet. Just how fast do you need it to settle after the input is turned off, and does the input go to zero when it is turned off or assume some other value.

author: Laurz
author_rank: Newbie
timestamp: April 10, 2024, 08:55:26 pm
content: Thanks so much for your thoughts there Jonpaul. Appreciate...

author: Laurz
author_rank: Newbie
timestamp: April 10, 2024, 10:03:15 pm
content: Thank you Mr AI for such an in depth analysis of the circuit. I'm lost for words. Hehe... Yes, R5 certainly presented its own challenges. I simply continued to increase its value until it ceased to have any influence over the frequency the filter peaks at. I'm sorry I cant remember where the circuit came from. I found it online many years ago. I would like the output signal to collapse as quickly as possible. An analogy which comes to mind is that of a toilet cistern. (forgive me) Once the pressure of water is insufficient to keep the rubber valve open, the water flow shuts off almost instantly. Yes, the input goes to zero when it is turned off. I love the idea of active clamping. How could this be done? Would the comparator circuit always be shunting the output to ground until it sensed the presence of an input signal? Thanks so much for your help.

author: MrAl
author_rank: Super Contributor
timestamp: April 11, 2024, 12:41:07 pm
content: Quote from: Laurz on April 10, 2024, 10:03:15 pmHello again,Yes that would be right. If there was no input then the output would be shunted to ground, but that could be altered also if needed.What we need here first is some guide specifications. For example:1. What is the minimum amplitude of the input square wave.2. What is the accepted frequency range of the center frequency.3. How fast does the output have to go to zero when the input goes to zero (like is 1ms good enough).4. What is the level of the input square wave, is it plus and minus say 5v or is it just 0v to 5v or something. We have to know what we are detecting exactly.5. What does the output of this have to drive. For example, high impedance or low impedance, 10k or 1k or 100 Ohms, etc.The more you can specify the better this will work.The idea is really quite simple. Use a comparator (or two) to detect the input square wave positive or negative transition or whatever is needed. Add a smallish value resistor to the output. After a short delay, clamp the output to zero volts if the input goes to zero. Since the output will most likely be dual polarity, it may require an analog switch.It looks like the center frequency is determined from:w=(sqrt(R5^2+4*R4*R5-4*R4^2))/(2*C2*R4*R5)when without R5 it should be (and w=2*pi*f):w=1/(2*C2*R4)However, when R5 is much larger than R4, the center frequency is still very close to that simpler form.This all assumes that C2 is the control parameter for the caps and R4 is the control parameter for all of the resistors (except R5) as is usual for a Twin T.One thing I almost forgot to mention is that this kind of filter can be done with regular inductors and capacitors, although I would think you would want to use precision inductors. You may wish to look at those methods also, or not

author: Laurz
author_rank: Newbie
timestamp: April 11, 2024, 10:41:49 pm
content: Hi once more,Again my thanks for helping me out with this project.This circuit is actually a tiny part of a very large project which I have been developing for about the last 8 years.Currently my 'project' (machine) is lying on its back on my work room floor because I am adding a little more hardware to it.I really need to stand it back up on its feet so that I can just scope out some of those waveforms you're talking about - specifically the input square wave - can't quite remember if it has a DC offset etc, etc.I should have the machine back up on its feet within about two days and then I'll be able to do those measurements that you're looking for.Talk again soon,Bye for now.

author: MrAl
author_rank: Super Contributor
timestamp: April 12, 2024, 11:35:11 am
content: Quote from: Laurz on April 11, 2024, 10:41:49 pmHi,That looks interesting, what is it supposed to do?I found that the extra resistor R5 is typical in order to keep the 'notch' from the Twin Tee from going to an actual zero. If it went all the way to zero the gain of the circuit would go too high and cause clipping. That resistor would be needed in this circuit because it uses an op amp and the Twin Tee network is in the feedback path. in a regular notch filter, R5 is not needed because we usually want an attenuation notch that is as deep as possible, and in theory it does go to zero when all parts are matched perfectly according to the Twin Tee component ratio requirements.I changed the first capacitor enumeration to "C4" because "C1" was already used in the Twin Tee network and I needed another number for an analysis.Here is the updated schematic.

author: Laurz
author_rank: Newbie
timestamp: April 12, 2024, 01:15:43 pm
content: Hello there,Thanks re C4 - slight mistake in my component labelling there.Thanks also for your further analysis on R5 - very interesting. Hopefully I've chosen the optimal value for it - a little bit past the point where it starts to interfere with the actual tuning of the peak.Although it may sound a little bit 'way out there', the machine itself is for converting human voice (hum) to midi. Sorry I'll try to be brief here.I love music and I have always had melodies and harmonies going round in my head, but I simply cannot play a musical instrument by ear. And so even as far as 20 years back, I have been looking for a machine where I can either sing, hum or whistle and it would automatically generate a computerized musical instrument for me making use of the now very well known VST technology. To my surprise, I've found such a machine simply can't be bought. There are software systems out there and I have evaluated a few, but as much as I greatly admire the developers, they all seem to have latency issues or they don't track very well. (With software systems, short, low frequency notes are the 'enemy' due to sampling issues, with long, high frequency notes being more favourable) Typically a s/w system may exhibit latencies between around 30mS at the low end of the audio spectrum reducing down to about 5mS at the high end.My system is purely hardware. To be honest, the project has presented enormous challenges. To build a system making use of very sharp filter technology to isolate the individual semitones of the musical spectrum has been absolutely daunting to say the least. Perhaps unsurprisingly the biggest challenge has been to develop filters that are stable enough, which has meant a temperature controlled tower to house the PCBs, also a temperature controlled calibration chamber, because the PCBs cant be calibrated on the bench and then put in the tower - they must be calibrated at the same temperature. Power supplies for the system have meant 'regulated supplies feeding regulated supplies' and in some parts of the system, regulated supplies are dedicated to just two IC's on each board. The last biggie has been actual component choice in terms of stability. (Crystal filters would have been ideal but not possible in the audio spectrum. Mica caps would have been great also, but again an issue because of the frequencies involved) However....(at last - sorry getting there)....I really have had remarkable success with my 'note modules' as I call them - they really are very stable and incredibly I've managed to tune them to within about 0.3Hz of the required frequency on each board. Latency is only about 2.5mS across the whole humming spectrum. Each semitone requires its own dedicated PCB. (hence the tower) Having now already proved that I can indeed trigger individual musical notes on my PC, while humming gently using a throat transducer, I'm now confident to continue building the system and manufacturing the multiple note modules that will be needed. When finished, the system should have two modes of operation - manual and automatic. It's also able to generate chords automatically if required. Manual mode will cause red and yellow leds, which I've actually embedded into my midi-controller's black and white keys, to illuminate when the correct note is hummed. I'm hoping to sit my little daughter on my lap and say, "press that key love - the one that's illuminated" as I hum. Time will tell as to just how successful auto mode will be - I'm dealing with a system which has perfectly tuned filters listening to an imperfect human hum. Hmmm...And this brings me (finally) to where I'm so grateful for your help. There is no question that the filters tend to 'linger' as it were at the conclusion of a long note. This could possibly affect operation in auto mode where one note might still be playing while another note is being hummed causing a possible discord. This effect is much more apparent when testing the system using a signal generator and particularly at the lower end of the humming spectrum. When actually humming, the delay is much less noticeable, I guess due to the nature of the human hum not causing the filter to peak to the same degree as it does when using a signal generator.Well, forgive me that this has been rather drawn out, but I felt if I gave you the full picture of what's happening, you would be better able to see what I'm trying to achieve.As I was saying, I should have the system on its feet again very soon and will perform those measurements you require.Thanks again,Bye for now...

author: MrAl
author_rank: Super Contributor
timestamp: April 13, 2024, 01:32:39 pm
content: Quote from: Laurz on April 12, 2024, 01:15:43 pmHello again,That's pretty amazing. For one, it's amazing to build something that complex, but also because I wanted something like that too. I play jazz guitar and took lessons from a very famous guitarist a long time ago and since then I've written various pieces that I still love today but do not have them written down on paper. Due to my experience in music I can write (hum) music on the fly, no problem, but it often takes a lot of time to write it down. That means I would be humming out a tune also but don't feel like writing it down right then and there or pulling out the guitar and going over the notes and chords one by one. if I could turn humming into both sound notes on the computer AND have it write out "on paper" (in a graphic editor) that would be really great. I'm sure other composers would be interested in this too.I would wonder how to get chords to fit into the picture too though. On the guitar you can have up to six notes played at once, and of course on the piano more. I guess with humming we can't do that though unless we feed it in as an arpeggio.I guess what else I am saying is that maybe you can market this thing. For me though I may be able to put up with more of a delay because I would not have to have written out in real time.Now back to the circuit.If you notice back a few posts I presented a formula for dealing with R5 in relation to the tuning frequency. You can in fact change R5 and have the center frequency stay constant, but that means you also have to change some of the other component values. You can review the formula for 'w' with the 'R5' parameter in it. It won't be that easy, but you could see if when you change R5 and the other components, even just two times, it gives you better results. That would mean probably trying a lower R5 (and change of other component values) and trying a higher value for R5 (and changing other components again according to the formula). That would tell you if increasing or decreasing R5 actually helps or not.BTW I also found that the values given on that schematic are slightly off. The values I calculated brought the value of the control capacitor to 318.97nf for a center frequency of 250Hz, but I am not sure how much difference that makes in the real-life circuit especially with the ever-present parasitics.Now a question regarding the circuit.First, if you do the circuit using DSP or pure analog (as you have been doing) you can not make a decision on what note is being played or hummed until at least 1/4 cycle has completed (or maybe 1/2 cycle). That means there will be a minimum delay regardless if you do it with DSP or analog.So the question of the day is, why not do it with DSP instead of pure analog?I ask because that's the modern way to do these things, and also amazing I have a card cage just like the one pictured in your image and so I know how big it is, and I have created board for it in the past, and they are big PC boards. This tells me that the SIZE factor comes into play for marketing purposes, or even for just building a few for friends. The size would go from a big card cage like that to a single PC board maybe the size of a cell phone.So the question is, can you see doing this using Digital Signal Processing (DSP) or no? It would save a lot of space and also power consumption it could run on a single or double battery or small battery pack.Now you got me wondering if I should try doing this using the PC sound card. First recording, then doing a Fourier Analysis of the resulting wave file. That would not fit your needs I know, but since a delay, even a long one, would be ok for my purposes, maybe I'll look into this too.Also, did you find software that actually does this already?

author: Laurz
author_rank: Newbie
timestamp: April 14, 2024, 10:26:25 am
content: Wow, you've packed a lot of interesting stuff in there...Yes, I can see the value of humming a tune, the end result of which would be processed on the computer followed by a 'printout' as well - very useful for composing.Re the chords - in my case with a hardware system, it's relatively easy to generate both major or minor chords derived from the primary (root) note in the form of control signals which are passed onto the midi controller together with the primary note control signal itself. (Hence the intervals are purely an electronic function associated with the primary note that is being hummed at the time.) But only a maximum of up to 4 notes can be played simultaneously - the primary note, a major or minor third, the fifth, and octave. (See enclosed pic showing the note module 'interval enable' SSR and 2nd pic showing primary note and interval note leds.) A separate control panel called the 'interval select module' permits selection of either major or minor thirds, the fifth and the octave as required. These additional notes may be selected and played while the primary note is being hummed and may be disabled at any time by de-selecting them on the interval select module. I particularly love the idea of using this feature with the 'SWAM' violin VST software - double stopping on a violin can sound so melodic. Normally such software (particularly SWAM) does not permit string instruments to play in excess of 2 notes simultaneously when using a midi keyboard unless the notes are struck at exactly the same time. However with my system, I can 'cheat a little' because the control signals all arrive at the midi controller simultaneously and hence all notes will be played. (I have actually introduced a slight delay on the note module between the primary note and any selected intervals to ensure precise synchronization.)Now coming back to 'Mr R5' - yes, I've observed R5's influence over the filter tuning - I hear what you're saying by including R5 in the equation - thanks for that. I'm pondering on that one - maybe I'm hoping not to disturb the high Q and hence retain the very sharp selectivity when it comes to preventing unwanted adjacent semitone breakthrough. I'm dealing with filters which have a cut-off point of only +/-3Hz either side of centre. It's not much to come and go on. Hence the clamping idea is still a favourite in my mind.You also raise a very good point when it comes to the actual calculated values for C & 2C. I have also found in practice that the calculated values don't quite correspond to the actual measured centre frequency on the board when sweeping the input with an online signal generator. (I use this program with an accuracy of 0.001Hzhttps://www.szynalski.com/tone-generator/)I find the capacitance values need to be lowered by about 1.5Hz which involves rather miniscule changes to the capacitor banks - normally I end up adjusting them to within about +/-0.5nF (about the maximum accuracy my capacitance meter will allow.) I've enclosed another pic of the capacitor banks.Sometimes I wonder if the filters will retain their accuracy with such very fine tolerances. But after switching the system on and off many times, and retesting the centre frequencies multiple times after the system has reached normal operating temperature, I find they still seem to be perfectly in spec. Quite amazing really...DSP versus analog? Well, for me, the answer to that one is fairly easy - I simply don't have the skills to work with DSP. I greatly admire people such as yourself, who have a very in-depth knowledge of electronic componentry. But for me, I just kinda stumble along with my rather limited design knowledge. There is another thing - I have already spent nearly 8 years designing and building this system up until now. I just dont think I have the heart to start pretty much all over again. It would also mean redesigning the PCBs which I have made in China.I was very interested to hear that you also have a very large card cage like my one, and that you also made some PCBs for it. Were you also starting to build some form of voice to midi system? Or something else? I actually made this card cage myself and even that took me nearly 18 months to build. When it's back on its feet, I'll send you some more pictures of it. The whole affair looks a bit 'prototype-ish' but I guess I'm only trying to prove a point really.Like the idea of you doing a Fourier analysis on your PC sound card. Hehe, good plan...You asked if I found some software - were you meaning VST instrument software? This is the one I want to use:https://www.google.com/search?q=swam+violin+demo&oq=swam+violin+demo&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTINCAEQABiGAxiABBiKBdIBCDQ4MzhqMGo3qAIAsAIA&sourceid=chrome&ie=UTF-8#fpstate=ive&vld=cid:af71f394,vid:H8Wu0Jr75VI,st:0Finally, if it's ok with you, I need to share with you why I feel 'so driven' to complete this project and how I see myself using it. Going back to 2015, I became seriously ill with abdominal cancer and needed major surgery. I became like a skeleton (the walking dead as it were) and very nearly died about 3 times. I couldn't help but feel (sorry, I'm not preaching here) that is was God himself who brought me through the cancer and 'Humming Burd' as I now call it, (or 'The Burd' for short) was a bit like a gift for God after bringing me through the cancer. Ever so slowly I began to recover, and with the recovery I found my mind was suddenly filled with all sorts of new innovations and ideas that I'd never really thought of before. And so really out of the cancer, 'Humming Burd' was born. I think when it is finished, my dream has always been to perhaps have a youtube channel with gentle worship music and love songs where people could come and relax. Humming Burd would be the centre-piece with the camera panning from my neck transducer to the PCB tower with its white PCBs & flashing leds, to the led-illuminated midi-controller and finally resting on the Swam violin graphics on the PC screen. What I'm really saying is, I'm hoping the burd itself would act as a draw-card to my channel because of its uniqueness and people would be able to rest because of the gentle music. I can't help but feel the burd would lose its uniqueness if I were to put it in the public domain. I spose also after coming so close to death, money doesn't have much of a hold over me. I think I just want to try and use the machine to encourage others. It's because of what I've come through. Gotta dream big dreams...Well on that 'note' so to speak I'd better leave off here,Thanks again for all your help,I really appreciate,Chat again when the burd is on its feet again.