Differentiator help..

Status
Not open for further replies.

huricaine

Member
I started a thread at another forum, but the community hasn't helped so I am going to paste one of my posts below, it is a differentiator circuit I need help on to detect harmonic distortion:

 

Attachments

  • proto.png
    5.1 KB · Views: 201
So, you have an opamp with a 20kHz input. Your very long post unfortunately doesn't say what output you expect to get from that circuit, or what the problem is with the circuit (which is probably why you got no help from the other forum). Also, why do you want to amplify an ultrasonic frequency if this is part of a car audio system? BTW, any signal detected could be said to be a harmonic of some lower frequency, so it's unclear what your aim is here.
 
There are Audiogurus here (which I am not) but you can't measure it that way. You need to know the fundamental frequency and amplitude then do a good Band pass filter at the 3rd harmonic frequency to even come close.
 
Music has harmonics that are not distortion so your differentiator will detect them and your idea WILL NOT WORK!
Usual distortion from a sub-woofer amplifier is 200Hz or 300Hz. There is almost no distortion at 20kHz so your idea WILL NOT WORK!
 
First, I will not consider comparing the output to the input at all
That's the only way (directly or indirectly) you can detect harmonic distortion introduced by an amplifier system. If you don't know what the input is then measuring the output may well detect harmonics but it won't measure distortion (which, by definition, is the difference between the input and output).
 
well I have tried using a passive filter lately but I am bad with filter calculations. With a passive filter I am trying to make sure 20khz and below(musical range) is rolled off pretty good compared to 100khz becuase I have noticed when I play a 20khz sine wave I get and around 100-600khz or so harmonic distortion when I push the amp over it's limits and into where harmonic distortion and clipping occur.

I want to create more then one input on the circuit for different frequency ranges like subwoofer, mid, and trebble amp so it isn't so hard to do. Won't this work? An example: For a subwoofer, it plays upto 80hz, say I create an HPF to null 80hz and below, If harmoinc distortion/clipping starts to occur, I can get an LED to emit if that cutoff allows 200-300hz for harmonics to initiate the LED or similar.

The idea came to me when my friend used piezo transdeucers with a high Low frequency cutoff and he applied to his amplifier and you could hear the harmonics only, not the fundamental because the piezos are essentially an HPF with their limited frequency extension. I figured I could use some sort of filter circuit to simply do this.
 
Last edited:
Most amplifiers have low distortion at 1kHz and lower but the distortion normally increases at higher frequencies. You cannot hear the harmonics of 20kHz anyway.
If a sub-woofer amplifier is playing an 80Hz sine-wave then the strongest harmonics of clipping are at 160Hz and 240Hz. A very complicated highpass filter might reduce the 80Hz fundamental frequency to 1%. A very sharp notch filter can eliminate 80Hz but it will need adjustment for a good null.
 
when I play a 20khz sine wave I get and around 100-600khz or so harmonic distortion when I push the amp over it's limits and into where harmonic distortion and clipping occur.
It doesn't matter a jot if there's distortion above 20kHz. No one could hear it, even if the tweeter could reproduce it!
 
The reason I mentioned 20khz is because it was the first thing I tried.

So 80hz would be too close to 160 and 240hz to null, even with a very sharp slope? I planned on attenuating the signal alot, would that change anything? What about the differentiator, isn't a differentiator more dependant on frequency then it amplitude?

Okay maybe i will break down and compare output to input because it has been a pain in the but...I had an issue with the idea in the past however, that the gain is variable and that's what this tool will help set. I was thinking about a solution a few months ago though, I came up with an idea to get opamps to perform a little math to match the output to the input. Something along the lines of, taking the output, subtracting the output from the input then subtracting the output from that. With this I could have the gain of an opamp set the output amplitude to the input's. What do you think? I will have to think more about it and I may need multiple opamps but it will work to match the output voltage to the input voltage while maintaing their waveshape right(the output beeing slight different due to distortion during over driving the amp)..This ovcoarse would run to a comparator or similar...


I am thinking...The phase of the waveshapes would maybe be off huh? So I would have to align them as perfectly as possible right?

oh....some say to rectify and compare DC voltage, with the idea above it wouldn't work because the clipped signal will still have a calculated gain away from the output. I thought about more math for this aswell before but I forgot what it was.

oIf I compared waveshapes would I have to use an HPF aswell? since the input will have everything else and it wil trigger? It seems like it would be pretty hard to match exact slope but maybe I can apply a simple series capcitor frst order to both of them, starting from a lowish frequency. Since the filter will be in paralell to the amp output channel it shouldn't effect the output to the speaker right?

EDIT: I just realized opamps cannot perform subtraction..

I am thinking of creative ways rightnow for this, does anyone know how to design an AGC amplifier that would work?
 
Last edited:
How about converting to binary to use gates to do the math to find the gain, then re converting back, then using that gain figure to set the gain of the output(is that possible?). This would need to compare wave shapes...

another idea on my mind is, when the volume is changed both input and output will change together, if they don't both change at the same time then it will be due to reaching rail limits of the amp and thus it must be in the clipping region. What circuitry could be used to monitor both input and output to tell if the output dosnt change while the input does? To where if they do not both change together then it triggers? This way, the in/out do not have to match in exact amplitude to compare. It is a simple idea but i don't know what circuit would do that??
 
Last edited:
You can use complicated circuitry to compare the input to the attenuated and phase-corrected output or use a complicated distortion measuring circuit to determine when an audio amp.

I have made a few clipping detectors with a comparator that compared the output peak voltage to a reference voltage. But usually I use my ears to detect clipping unless it is horrible acid rock that distorts all the time.
 
Since your hearing's sensitivity to loudness is logarithmic (so you can hear a pin drop and hear a very loud jet airplane) then a simple comparator can compare the peak rectified output to a reference voltage that is near but a little less than when the amp clips. You probably need a peak detector since our vision is very slow.

I simply use my ears to detect clipping.
 
A "null' is a bandpass circuit. A "cut-the-lows" is a highpass circuit.
They are completely different.
 
oh...I was confused then I wasn't meaning bandpass when I said null I meant a highpass. Since we were on a different page when I was talking about "nulling" 80hz...I meant rolling off 80hz and below...Do you think a highpass at 80 and below is far enough from the harmonics created near/at clipping to allow the harmonics to come out with plenty more amplitude to use as a trigger? If I can keep 80 and below under .7v(LED Fwd voltage drop) while allowing the harmonics to to be above .7V, this would work.

Maybe with a 4th order HPF?

I would use a peak detector in the above method to light an LED with DC voltage..
 
A 4th-order Butterworth highpass filter at 160Hz reduces 80Hz only 24dB which is 6.25% distortion which is a lot.
A clipping detector usually shows when the distortion reaches 0.1% or less.
 
How about a really high order like a 7th order or so? All I need is close to 1%(less is def nice though)...Btw if something sharp like a 7th order will work and someone is into active HPFs I def don't mind going active. With active are inductors not needed?

It isn't so much a matter of me having to build up a large complicated circuit I just want to get the job done. I am considering making it an SMD circuit so If I have to use a bunch of capacitors or inductors it should fit okay. No matter how high the order is, if it can be designed and my goal achieved I am willing to do it.

When I was toying with the 20khz sinewave, I noticed that when using the 4th order HPF I used, I could see the harmonic distortion on my oscilloscope. I cannot see harmonic distortion just by attenuating the voltage to millivolts but when I used the HPF I could see it. It shows that the expirimenting I did actually worked I think because if you can see the harmonic distortion it means that the fundamental is beeing scaled closer to the harmonic distortion...or that is my theory. With my HPF I was able to keep my fundamental before clipping tamed down to around 6-11mV, when I turned up the volume a notch into clipping it would raise to about 24mV and I put my scope on peak voltage mode and compared the amplitudes aswell and I was able to get the harmonic distortion amplitude a bit higher then the fundamental. I forgot the exact numbers but I re-did the circuit and allowed the harmonic distortion content to reach .8V or so and used a peak detector and basically the LED did light when pushed the amp into the distortion region but this is too tight of a constraint to have. If I can utilize a very sharp rolloff then I think it will work... I just need that relative amplitude between the distortion and the fundamental to be a big difference so I don't have to worry about compatability for other equipment If I use it on something else.

BTW: I do not need the device to detect distortion I can tell when it starts to clip myself, I just want to build a numer of these devices for some people.
 
Last edited:
A passive LC filter usually has only one inductor and one capacitor. The inductor is pretty big for audio frequencies.

A 7th-order active lowpass filter uses many opamps, resistors and capacitors, no inductors.

If your generator is accurate then a good notch filter is made with only one opamp.
 
What do you mean by generator and why do you mention notch filter, do you suggest one? As far as alot of opamps go I can use quad opamp packages.
 
An audio generator is a low distortion sinewave oscillator.
A simple notch filter can remove the fundamental frequency leaving the distortion harmonics at full level.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…