Multiple filters - How do you approach it?

Discussion in 'General Electronics Chat' started by Solar shock, Feb 24, 2015.

  1. Solar shock

    Thread Starter New Member

    Dec 4, 2014
    17
    1
    Hey Everyone,

    A little Background;
    I am working on an EEG project at uni with a few other people, the EEG has been broken down into the sections; Bio-amplifier, Filter and gain control, VCO. Where the output is an audio tone generated by a loudspeaker. The general rule is that we can't simply go buy say a nice really high CMRR, high gain amplifier that requires 1 resistor to set the gain. It has to be done using some lower spec IC's so that it has some challenge to it.

    I (if you haven't guessed) am doing the Filters and gain control section, now in general I have picked up a really great book (Active Filter Design - Allan Waters) and this has really helped me with understanding higher order filters and some general design principles and component selection.

    Where I am struggling is with the overall approach to the design;
    Requirements:
    • Bandwidths to be filtered; (4-7Hz) (8-12Hz) and (18-50Hz)
    • A 50Hz Band-stop filter - to minimise mains interferance
    What I would like to know is, when given a problem such as this, how do you guys start out? what is your general thought train?

    My initial thoughts;
    To me, my first thought was that I should split the original signal recieved from the bio-amplifier and then filter those bandwidths out indivdually in a parallel manner using some 2nd or maybe 3rd order band-pass filters. I thought this would be better than say; cascading some notch filters and therefore keeping all the filtering done on 1 signal, rather than filtering separately. I also think it would be useful to be able to measure the 3 bandwidths simultaneously, as we slightly increased the projects original specification to include the option to connect the output to a computers sound card for some data collection.

    Any other questions please ask :)
     
  2. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
  3. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,518
    1,247
    Because the ratios of the three frequency bands (f-high / f-low) are not equal, having one filter circuit with switched components probably is too cumbersome. Plus, parts are cheap. You don't need much gain or bandwidth, but a high quality opamp will get you lower crossover distortion, something not often indicated on datasheets. If common mode rejection and preamp gain have been done already, then what's left is to select a filter topology with the characteristics you need and grow three of them. Put the gain control section after the filters to limit system noise and give you a consistant output impedance.

    ak
     
  4. PeterCoxSmith

    Member

    Feb 23, 2015
    148
    38
    Hi, your plan to use 3 channels, one for each bandwidth is sound especially if you want the three channels to be available simultaneously. One thing I would advise is making the filter unity gain and put your gain and level shifting in a separate unfiltered amplifier.

    If you wanted to use a single channel with switched bandwidth I would start with the lowest band, calculate the caps and resistors using resistors no more than 100k. Whatever caps came out of that calculation I would keep for the other bands and only change the resistors. That way you could switch only the resistors to achieve the different bands. You could use this calculation approach even for the 3 channel solution as you would minimise the number of values of cap in the design.

    I would advise keeping your resistors below 100k if you are building the circuit by hand with surface mount parts. Flux under resistors cannot be removed by manual methods and high value resistors have their value altered too much by the flux that gets stuck under them (it is like having a 10meg resistor in parallel).

    All the best, Peter
     
  5. Solar shock

    Thread Starter New Member

    Dec 4, 2014
    17
    1
    Hi thanks Mike, it certainly was useful :) I used it in conjunction with some other great TI literature.
    www.ti.com/lit/pdf/SLOA049
    Thats just a document about filter tables and their uses, originally I had calculated it by hand (didn't realise tables existed until after.... but was worth it for getting my head around some of the math involved anyway). I've also been using some software called FilterLab thats free from Microchip, but I've had a few issues with it, predominantly when trying to do some band-pass filters to the third order its cascading two op-amps, I was under the impression a 3rd order is a 2nd order cascaded with a first order; but can't this be achieved by simply putting a capacitor and resistor filter on the Output side, rather than adding another second order (in fact I just checked, its actually forcibly changing the filter to a 4th order band-pass). It also only allows a maximum filter gain of 1 - 10. So seems very limited in what it can achieve.

    Can anyone explain why it is forcibly setting the band-pass from 3rd order to 4th order, the only details I am giving it at the bandwidth (4-7Hz) and the passband attenuation. Its in the MFB configuration. Is this something to do with the fact that a pass-band has to consist of a low and high pass filter; thus you can't actually achieve a 3rd order band-pass filter? - the more I think about it the more this seems to make sense.

    It's also giving me some huge resistor values - some in the MOhm range, so I think I will just calculate them myself.


    Hey Ak, Thank you for the advice, I selected a topology (butterworth for its maximal flatness seems perfect) and am working through my values as we speak; can you give any advice, or anyone else for that matter, on selecting an Op-amp? GBP and slew rate typically seem to be pretty defining, but i've got really small gains and really small bandwidths, so GBP doesn't seem to be like something I am going to need to worry about. Slew rate I will have to look into a little more.

    But how would you select a op-amp, I can find loads that im sure would work fine, but I want to assume i'm trying to find the best, what other characteristics should I be looking at? Temperature co-efficient and drift? Low cross over distortion? - as you have already mentioned.


    This is my initial circuit design (without values at present), I've effectively done; a Low-pass filter at the start that will be set to 50Hz, I will also provide all the gain required through this op-amp. Reasons being that it ensures the gain is consistent for all three of the band-pass filters and it also provides the 50Hz band-stop that is specified in the design criteria.
    Thus my MFB band-pass filters can be unity gain and simply deal with the filtering required.

    AnalogKid, you've mentioned putting the gain control afterwards, any further advice here? It seems less advantageous to do it that way, as i'd need 3 more Op-amps and it would mean the gain for each bandwidth is adjustable; wouldn't that leave your data a bit skewed if you had each channel at different gain levels?, but i'd love for some external input here.

    WIN_20150305_113954.JPG

    Also final question; If I add a de-coupling capacitor where I have circled in red; for helping block any DC, this value is going to affect the feedback on the first Low-pass filter right? Should I attempt to make its Xc negligible?
     
  6. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Dont need one. Input filter is already dc. blocked. Assuming it has negligible dc offset, the three other filters are already referenced very close to 0V

    Almost any modern opamp will work in this application. A complication might be trying to run it on a single supply, or low voltage supply.
     
  7. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,518
    1,247
    Usually I'd say to put the lowpass filter last in the signal chain to attenuate noise contributed by everything else, but your bandpass stages already do that. And they are AC coupled, so as long as any DC on the output of the LPF doesn't drive them into clipping, you should be ok. Not that AC coupling in the BPFs means there will be low frequency shifting of the signal as it's average value changes. In other words, it won't have a steady baseline.

    Most designers have favorite parts that they've used over years, and that's what they use if there is no explicit requirement for a particular component characteristic. Of course, that raises the question of how they picked those parts the first time, which is where you are. Consider other factors: Do you need very low power, or small size (one quad amp instead of 4 single amps), or the robust input of a bipolar part, or the high input impedance of a CMOS part, or compatibility with existing inventory, or rail-to-rail input or output, high common mode range, high power supply rejection, low operating voltage, low cost, multiple licensed second sources... Picking the "right" part involves lots of non-circuit things, but even with all of that factored in you might be down to only a zillion parts to choose from instead of a gazillion.

    National Semi (now part of TI) makes the parts everybody knows, but their reputation is for general purpose stuff. Analog Devices and Burr-Brown (now another part of TI) are the long-time kings of precision and performance (instrumentation people love AD, audio people love BB, etc.), but many of their parts are sole-sourced. Linear Tech is somewhere in the middle. What country are you in and who can you buy?

    ak
     
  8. Solar shock

    Thread Starter New Member

    Dec 4, 2014
    17
    1
    Thanks for the info :) I will hopefully have a breadboard version up sometime next week so I can do some testing anyway and check I am not getting any DC offset. We are using a dual rail supply fed from mains (someone in the group has been assigned the PSU design. We simply agreed that we wanted a 0-5V output level with a little head room. So I think she's going with +/- 9V, I'll see her design hopefully Monday.)

    Ahaha this made me chuckle, too true. I was doing a search around RS the other day and selected a couple variables and as you said, you're simply trimming it down from a number you've never seen, to a slightly smaller number you've never seen :p

    But Thanks for the list of other things to perhaps consider, I will definitely be having a good nosey around. I live in the UK and luckily because my degree is funded by my company I get the perks of being able to order through work. So I have access to RS, Farnell and a whole heap of other suppliers. I will definitely be looking at Analog Devices, never heard of Burr-Brown but I will have a read up :)

    Thanks for all the help guys, its definitely been daunting looking at an almost infinite list of components and being completely bamboozled by how to select something appropriate. My biggest concern was always; 'If I selected this component how would I know if there was another that was simply far more effective and cheaper.' But I think as long as I can find something that satisfies the circuit design; So im thinking a quad package op-amp - to try and keep temperature co-efficients the same, save space etc... Then I can justify that. If I happen to come across a superior IC then I can always potentially switch it up later and explain why my design had changed.
     
  9. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,518
    1,247
    It is rare to be in a design situation where some combination of the requirements narrows down the component selection to only a few, or just one "best" part. Much more often you have a pool of parts to choose from, and in the specific application they all are so much better than what's needed that they are effectively equivalent. At that point, just pick one and move on, because there is no "best" part. And sleep soundly knowing that no matter which one you pick, someone will think their favorite part is better.

    ak
     
  10. Solar shock

    Thread Starter New Member

    Dec 4, 2014
    17
    1
    Hey guys,
    I ended up picking an OPA4277PA, finished the design. Although i've ran into some issues. I'm simulating it with multisim which I haven't used in a few years since college, but im gona be working on it most of the evening so hopefully i'll remove any user error :p

    However I was hoping you guys wouldn't mind having a quick glance over my circuit while I explain my issues?
    This was my overall design;
    upload_2015-3-18_19-3-29.png


    Stage 1 - Butterworth LPF - gain of 50.

    upload_2015-3-18_19-5-30.png

    So; I designed this using a document called 'Active Low-Pass Filter Design' by Texas Instruments, I used the calculations on page 11 - the example circuits and adjusted it for my design. I also used the Sallen-Key Design simplifications in Appendix A.
    http://www.ti.com/lit/an/sloa049b/sloa049b.pdf

    The problems i've run in to; when I simulate it and input a sinewave from a function generator I get the op-amp going to infinity in the positive direction. Now this could be user error and i'll be re-attempting to test this part of the circuit shortly. But can you see any glaring issues? currently a little stumped.

    upload_2015-3-18_19-22-39.png

    Stage 2 - Unity gain 4th order butterworth BPF

    I did a bode plot and I got an extremely odd response, although I think its hard to give it merit, as the bandwidths are so tight, i've never had to look at something so tight, I am going to fiddle with the scaling and see if I can't make it look more as I would expect and have another look at the results. But again anything wrong with it standing out? I used Op-amps for Everyone, section 16.5.2 - Fourth Order Band-Pass filter (Staggered tuning).

    Any thoughts? or Comments most definitely appreciated.
     
  11. BR-549

    Well-Known Member

    Sep 22, 2013
    1,981
    388
    With the price and availability of microprocessor boards with adcs and free software....I would sample a buffer behind 1 amp.
    Output to a audio card on a computer. Then you can filter, study or record any signals you wanted.
     
  12. Solar shock

    Thread Starter New Member

    Dec 4, 2014
    17
    1
    Completely agree with you, but sadly for my Degree that would be too easy and most definitely not Analog enough ;D
     
  13. alfacliff

    Well-Known Member

    Dec 13, 2013
    2,449
    428
    why not use the software filters in a sound board? if you have to raise the frequency a bit with an up convertor, posssably around 1 khz due to the frequency response of the sound board. most computers now days have a built in sound board capable of much more than playing music. analog to digital, do anything you want, then display in what ever way you want. could even build in software alarms if values get to whatever you want them to not be.
     
  14. Solar shock

    Thread Starter New Member

    Dec 4, 2014
    17
    1
    Yeh Alfacliff, Im currently working on a little side EEG project for myself; that ones using a sound card. But this uni project has to be analog, as in reality its not about whether or not I get a perfect EEG and more about me learning more about analog electronics and Opamps.

    However a little update;
    I've managed to get my LPF to Low pass, I can get the 50Hz cut off I aimed for (or there abouts), but I cant get the gain portion of the circuit to work? Gain is R3+R4/R3 right?
     
Loading...