Filter signal before or after amplification? - Page 1
Forum section: electronics / beginners

author: Emil
author_rank: Regular Contributor
timestamp: November 01, 2014, 05:34:09 pm
content: I'm have a 0-20mV signal from a load cell. I use an instrumentation amplifier to amplify the signal to 0-4096mV before it's sampled by the ADC in a PIC.I'm planning to add an RC filter to remove any part of the signal with a frequency above half the sampling frequency.Should I filter the signal before it's amplified or after?Emil

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 01, 2014, 07:00:55 pm
content: What kind of electrical environment is this in, and what kind of length, shielding, etc.?Definitely filter first, since that avoids possible offset errors from RFI. Bipolar op-amps in particular are sensitive to RF, which gets rectified by the input transistors or other internal structures, causing offset.Tim

author: German_EE
author_rank: Super Contributor
timestamp: November 01, 2014, 07:08:50 pm
content: Filter first. If you filter first then the amplifier will only amplify the wanted product. If you amplify first then the amplifier will amplify all the crud and any IP3 problem will only make things worse. Filtering will not remove IP3 products because they are too close to the wanted signal.

author: Emil
author_rank: Regular Contributor
timestamp: November 01, 2014, 07:56:07 pm
content: Quote from: T3sl4co1l on November 01, 2014, 07:00:55 pmIt wouldn't normally be used in a very noisy electrical environment, but it's a USB device, so there will be a computer less than 5 meters away, there might be fluorecent lights etc.There are two potential sources of noise in the circuit, both higher frequency than the signal I'm interested in sampling, the MCU and a step-up converter. If I remember correctly the converter switches at ~100KHz.There is about 7mm of PCB trace from the screw terminal where the load cell connects to the input of the intamp and about 5mm trace from the output of the intamp to the ADC. There is a gound plane on the other side of the board. It could be used with different load cells, but typically the load cell would have a shielded cable 200-500mm long. The board will be in a shielded case connected to the shielded cable.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 01, 2014, 10:38:22 pm
content: Ok, so if this were going to be a commercial product (or is?), presumably it'll want to pass something like IEC 61000-4, so you'll want ESD protection on the screw terminals, at least a little filtering, and make sure the USB cable shield goes straight to circuit ground.Even though the load cell cable is grounded, there's voltage drop across the ground connections (in comparison, USB works as long as the shield is 100% solid down to the PCB), so you'll still get some noise there. Plus if there's noise picked up from whatever the cell is attached to, or something.And if you have to worry about voltage drop from the load cell wires (e.g., opamp input bias current), keep the series resistors small, and/or use ferrite beads. That's just fine. Should be fine with clamp diodes or zener/TVS type things for ESD, but probably avoid schottky clamp diodes as they have a lot of leakage. Go ahead and use as much capacitance as you can afford, excess bandwidth is generally undesirable! (If this is going into an ADC or something, you can filter the output too.)Tim

author: tggzzz
author_rank: Super Contributor
timestamp: November 01, 2014, 11:11:37 pm
content: Quote from: Emil on November 01, 2014, 05:34:09 pmThis can be an interesting question since, while the other answers are probably correct in this case, in other cases it can be better to amplify before filtering, or to have multiple filtering and amplification stages. That's exactly what I did when I built an optical receiver that had a noise equivalent to a 1pW optical input signal (and a 180dB electrical, 90dB optical dynamic range).The key point is do define what type of noise you are aiming to remove, and how much noise there is. Strong interfering signals are best removed by front-end filters. Thermal noise is minimised by amplifing before filtering.If you have a filter in front of the amplifier then it is necessary to ensure that the filter itself does not introduce significant noise within the passband.If you have a filter after the amplifier it is necessary to ensure that noise does not overload any part of the circuit before filtering occurs.With RF circuits where this issue is highly important, the normal arrangement is:a relatively crude antenna filter that removes strong adjacent band signals (thus preventing interference overloading the rest of the receiver), but neither attenuates in the passband nor introduces noise in the passband (thus maximising the receivers sensitivity)low-noise RF amplifier that essentially defines the noise level (i.e sensitivity) of the entire receiverother, tighter filters which may be noisier in the passband

author: David Hess
author_rank: Super Contributor
timestamp: November 02, 2014, 06:02:49 pm
content: Quote from: Emil on November 01, 2014, 05:34:09 pmWhen dealing with load cells, I use both.RFI filtering is needed before the instrumentation amplifier to prevent RF rectification from showing up as weird offset changes and low frequency noise. Some instrumentation amplifiers have this built in. Be careful when doing common mode filtering because mismatch can change common mode signals into differential mode signals.Low frequency filtering to limit noise should be after the instrumentation amplifier to avoid the common to differential mode issue.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 02, 2014, 07:14:34 pm
content: Speaking of common mode, the biggest mistake made in designing such a filter is to make it common mode, when really the signals are comparable impedance, either mode. Or when single ended is dominant. It's very often better to filter the signals individually, then take the difference much later.Example of a filter design: shielded twisted pair coming in from an  sensor. Its output is differential, but after the cable (picking up various EMI), we don't know what the common mode looks like. A naive filter might use an LC ladder filter, with the rungs between +/-, and twice the inductor count (assuming lowpass), followed by a single  termination resistor before the signal path or whatever. But common mode runs right over this filter, and doesn't get terminated either. So, the common mode voltage runs wherever it wants to. And if it starts banging into input range limits, your signal is toast.A better way to think of STP is as a pair of coax wires mated together. If you treat each signal separately, you'll get the best results.Of course, UTP has a higher common mode impedance, which can make it difficult to filter because the common mode noise has such a high impedance. And you may not have much capacitance to spare to build a filter, because that capacitance loads down your signal as well (you have to use C/2 to GND on each signal, so the differential signal sees a loading of C/4), unless it's AC coupled (in which case you can use a CT choke across the line to make a virtual ground point, and load that with as much capacitance as you need).Ethernet, which uses UTP, goes one step further and isolates the signal altogether.Tim