Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

For Loop Circuit - calculate the nth derivative of the signal

  1. Aug 27, 2012 #1
    For Loop Circuit -- calculate the nth derivative of the signal

    I'm trying to design a circuit that differentiate a signal using a differentiating amplifier. What I want to do is to calculate the nth derivative of the signal based on a count I specify. How can I apply the same amplifier to the signal several times?

    Thanks.
     
  2. jcsd
  3. Aug 27, 2012 #2

    rbj

    User Avatar

    Re: For Loop Circuit -- calculate the nth derivative of the signal

    i think you need n stages of differentiator to get the nth derivative.
     
  4. Aug 27, 2012 #3
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    But this is not dynamic at all. I need to control the n parameter at run-time using one differentiator.

    Any engineer from Sony? :D
     
  5. Aug 27, 2012 #4

    uart

    User Avatar
    Science Advisor

    Re: For Loop Circuit -- calculate the nth derivative of the signal

    There's no easy way to do that with a continuous time signal. I know that in your other thread a sample and hold was mentioned, but that wont work.

    You've really got two choices.

    1. Sample and use a DPS to do it. OR

    2. Use multiple differentiating amplifier's and analog switches to select "n" (and then after you build it, and find that all you are getting out is noise, then use the DSP).
     
  6. Aug 27, 2012 #5
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    Is this a real time application or not? If not, perhaps you could store the output from the first differentiation in memory and after the first differentiation is complete, apply the stored output to the input and repeat this procedure n times. A warning, repeated differentiation of a signal tends to make the signal noisy.

    It seems to me this approach is overkill because it could be done a lot easier in software. Even having a number of sequential differentiators and selecting the output of the nth differentiator using an analog switch would be preferable.
     
  7. Aug 27, 2012 #6
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    It's supposed to be real-time system. And pure analog no software or any DSP.

    I'm trying to think of an analog memory circuit that stores an analog signal in a fixed period from t0 to t1. This way I can buffer part of the signal while one part is being processed.
     
  8. Aug 27, 2012 #7

    rbj

    User Avatar

    Re: For Loop Circuit -- calculate the nth derivative of the signal

    you realize the contradiction in spec's you're making here.

    what is an "analog memory circuit"? CCD? if so, then you're sampling. if you're sampling what's the problem with DSP?
     
  9. Aug 27, 2012 #8

    uart

    User Avatar
    Science Advisor

    Re: For Loop Circuit -- calculate the nth derivative of the signal

    Ok. So what is the output of this "continuous time" system doing while you're looping your "analog memory" though it "n" times?

    You need to start with the basics and get a better understanding of how real time systems work before starting on what ever this project is.
     
  10. Aug 27, 2012 #9
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    I see where the problem is...I'm not sure though whether it's a physical limitation or the way analog electronics is developed. The latter is more possible.
     
  11. Aug 27, 2012 #10
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    No project yet. I'm studying the basics, so now I'm trying to find equivalent circuit/components to algorithmic constructs, such as loops, conditional statements, variables, ...etc. It may sound a stupid idea but are not ICs the object-oriented counterpart in circuits?
    An IC is actually a class/object and the pins are the interfaces.
     
  12. Aug 27, 2012 #11

    Integral

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Re: For Loop Circuit -- calculate the nth derivative of the signal

    In circuitry there are no loops, no function calls no regression. It is more like raw machine code. Straight through every time. Of course with circuitry every component runs continuously, unlike code where it only functions when its turn comes around.

    I have been somewhat amused by your efforts to treat circuitry like code, been waiting for your Ah-Ah moment. Circuits are different from code, most anybody can learn to write simple code that will do something. It takes a bit more knowledge to design a meaningful circuit. I personally think you would be better off to totally forget everything you know about coding and learn electronics from the ground up. Then you may be able to do something along the lines of what your are thinking, or more likely come to understand why it will not work.

    As every hardware guy knows a soldering iron in the hands of a software guy is scary.
     
  13. Aug 27, 2012 #12
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    Yeah I think the way I'm approaching it is unrealistic and wrong, trying to unify the concepts...however I thinking there's a problem with the way analog is developed. It's based on limited-functionality components that have been around for decades and they stuck to the old school not willing to change. There are a very quite few pioneers in analog. I'm really surprised that there's no well established way to apply the same circuit multiple times on a signal and it has to use either DSP or hard-wire a fixed number of probably expensive cascaded circuits. Another shock is there's no analog buffer. Cannot we store the signal temporarily for a specific short period and restore it? I believe nothing impossible but
    old-schoolers need to think out of the box a little bit.
     
  14. Aug 28, 2012 #13

    Integral

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Re: For Loop Circuit -- calculate the nth derivative of the signal

    So why do you think processors and software were developed? Because of the limitations imposed by the hardware. So yes ICs can be used as building blocks, one of those blocks can now be a microprocessor, which gives all of those things you are looking for. To attempt to do it in circuitry what can easily be done in a processor and a bit of software just does not make much sense.

    I suppose you could wire up a discrete component processor if you wanted, remember that is how computers first got started.
     
  15. Aug 28, 2012 #14
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    You cannot design a complex analog circuit from a software perspective. Either do it in software with some kind of digital hardware, or think outside your software box and get new perspectives for the analog continuous world. This "I know better than the old-schoolers analog guys" chip on your shoulder mentality has got to be modified. Most of the old-schooler analog guys also know a lot of digital hardware and software as well. Its not enough to know how to do something in analog or digital; its also about knowing when to use which technique for a given application that is more important. If you are working for someone or want to be taken seriously, you should choose the best technique for the application.

    Derivatives in analog circuitry are continuous and that seems like a fundamental misunderstanding with your post because, again, you only see it in the way it is done in software. There is no reason to iteratively "loop" as you would in software, the differentiation is instantaneous. Your signal will have history in it because it is continuous and the system is causal, and so simply feeding the same signal back into the differentiator is not that simple since your past output and new input will be indistinguishable.

    You need to think more about what a continuous signal means, the signal timing, and the response of your circuit. There are not indispensable generic "buffers", but there are time delays, phase shifts, switching, modulations, and other continuous time signal manipulation tricks that people use. Also, I agree with UART that repeated derivations will amplify your noise and ruin your SNR without really careful and well thought out design. I doubt an undergrad computer science curriculum even teaches many tools of DSP (although some courses may have overlap with EE counterparts), and so I think you need a better survey of the landscape before you try to evaluate the merit of techniques (but that doesn't mean you shouldn't try them for learning/fun).
     
    Last edited: Aug 28, 2012
  16. Aug 28, 2012 #15
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    I've never said I know better than the masters. I'm just saying I'm thinking of it differently.

    :approve:
     
  17. Aug 28, 2012 #16
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    There is so much misinformation in this thread it is hard to read. Gee whiz.

    Like I said in the previous thread where you asked, you need to do it in a discrete-time way. Sampling theory says you can convert back and forth from continuous to discrete without loss of information. Discrete-time circuits are an advanced topic not generally covered until graduate school. Stick with single-stage transistor amplifiers and opamp circuits right now for goodness sake!

    I said use a sample-and-hold and of course it will work. The vast majority of commercial and industrial analog signal processing is done using discrete-time circuits. So a third option would be to design a discrete-time signal processor. And the low SNR thing doesn't matter in discrete time since the noise is filtered out using the continuous-time reconstruction filter on the back end of the circuit.

    What dijkarte is asking for is a high-order differentiator circuit. This is one of the key functions of delta-sigma modulation which is used in EVERY cell phone. The vast majority of modulators use discrete-time signal processing. The whole point of delta-sigma (besides the oversampling) is to exploit the noise enhancement out-of-band by using differentiators and filtering.

    Like I said before, use a sample-and-hold and do your processing in the discrete-time domain.

    What contradiction? I think dijkarte is going about things the wrong way but you're not helping. Of course dijkarte has to sample (otherwise his/her request makes no sense) but sampling does not imply DSP. People were sampling long before DSP was available.

    People haven't used CCDs as filters since the mid-70s. I don't think they were ever popular for that application. Switched-cap circuits killed them, just like DRAM killed them for memory applications and active pixels have mostly killed them for imaging.

    You might do with a bit of a refresher yourself. Wow, such hostility in this thread. Before the world was digitized in the 90s there were a lot of discrete-time circuits doing "continuous-time" processing without DSP. As long as they satisfy the Nyquist Criterion they're golden. Even today they are all over the place.

    There is an extremeley well-established way to do this. Discrete-time signal processing based on switched-capacitor circuits. These were invented in the 1970s and are EVERYWHERE in modern electronics.

    I told you how to store a signal in a previous thread... use a sample-and-hold. You are sooooo far in over your head, my friend. This is advanced stuff... you're not going to understand until you learn some basics.

    I don't think many people on this board know much about discrete-time processing of continuous-time signals. But certainly a CS undergrad will lack the tools to understand it without a lot of remedial reading.

    But you need to be more careful about how you write. You are coming across like an uninformed jerk in some of the things you say. It may not be intentional but that is how you look. So much innovation has been done in analog circuits in the last 100 years. Did you know that the Battle of Britain was won in large part because of radar-directed artillery? Guns controlled by linear predictive ANALOG circuits were able to take the integral of velocity in real time and predict the location of German planes and buzz bombs. Did you know that the original nuclear power plants and jet aircraft were designed using ANALOG computers?

    Anyway, here is how you would build a circuit to do an arbitrary number of derivatives.

    discrete_time_differentiator.png

    Here's how it works. On the left is a continuous-time anti-alias filter to make sure there isn't any aliasing when you sample.

    In the middle is the switched-capacitor differentiator circuit. It is driven by a two-phase non-overlapping clock. On Phi 2 it either samples the input or the fed-back signal (the drawing should have a AND gate driving the first Phi 2 switch. The output of the anti-aliasing filter should only be sampled on the first loop... sorry!) Then the first difference of the input is taken by the sampling of the signal onto C1 and then transferring it to C2. (when you map the real number line into the unit circle by sampling, the first derivative collapses into the first difference). The counter counts each clock period the recirculates the signal until you are done. You can take the second difference, third difference, whatever. The increased noise is rejected by the reconstruction filter on the right which converts the signal back to continuous-time.

    You have to follow Nyquist here and make sure the highest frequency in the input signal is significantly less that twice the sampling rate.

    I'm almost positive you have no idea what I'm talking about. I'm begging you to learn basics. If you must jump years ahead, here is a good writeup on switched-capacitor techniques:

    http://www.aicdesign.org/scnotes/2001notes/Chapter09(6=4=01)-2UP.pdf
     
  18. Aug 28, 2012 #17
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    The circuit I posted *is* the analog circuit whose algorithm I described in the quote you posted. It is not DSP.

    Now, to clarify this, here is the OP's original quote:

    The OP wants an analog circuit that reuses a single differentiating amplifier. That is exactly what I posted. Where in that quote did the OP specify that the differentiating amplifier had to be implemented using an RC-opamp structure?

    To reiterate, the circuit I posted implements the algorithm you quoted. The counter is the loop counter. The first switch (I omitted the AND gate on the switch driver) implements the sampling function. You can read the explanation I already put for how the switched-capacitor amplifier works.

    This kind of thing *can* probably be done using opamp-RC differentiators but it would be really tricky (continuous-time delta-sigma modulators use a similar type of circuit). In that case I would imagine there would be severe noise problems. But maybe not (depending on filtering).

    So, are you misunderstanding the circuit I posted, are you misunderstanding the definition of DSP, or something else?

    The OP asked for an analog circuit that provides n derivatives using the same amplifier. That is what I posted.

    At any rate, the best solution is almost certainly ADC -> DSP -> DAC.
     
  19. Aug 28, 2012 #18

    uart

    User Avatar
    Science Advisor

    Re: For Loop Circuit -- calculate the nth derivative of the signal

    No Carl. I posted that before I noticed that you had attached the switched capacitor solution. I'm just viewing it now.

    Yes, in the other thread I did assume that when the OP mentioned differentiating amplifier that he was considering a simple RC-Opamp circuit.
     
    Last edited: Aug 28, 2012
  20. Aug 28, 2012 #19
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    OK, no worries. I thought that the switched-cap solution would automatically show up in the post. I guess you had to click it or something? My mistake.

    I think we're all in agreement that the OP is totally putting the cart before the horse though.
     
  21. Aug 29, 2012 #20
    Re: For Loop Circuit -- calculate the nth derivative of the signal

    I just wish we could shed this software/computer science perspective in these discussions. This thread is a thinly veiled reintroduction of the software perspective motivation (For Loop Circuit..). I think hubris and impatience are getting in the way of understanding the basics. In a way, it is understandable: if someone already knows the math and general concepts from somewhere else, why would he want to relearn it and apply it to things that might seem trivial on the surface, like boring resistor networks just to learn the basic circuit theory or an opamp circuit that seems to have been dreamed up by the authors. The problem is that we can only talk about these things in a general and superficial way from that outside perspective, and it almost paralyzes us from learning or making anything real/new. Instead of trying to find an example of a "for loop circuit" to validate his computer science intuition, he should work his way up (try building a 1st derivative design before you worry about nth derivative) and see how such an nth derivative circuit could occur naturally.

    Computer science and software design is irrelevant to almost everything that has been in these last 2 threads, but it keeps popping up as if it has some relation to circuit design so that the OP thinks he can replace the basic circuit/signal theory horse (the one he doesn't have yet) and pull the analog design cart with the computer science horse instead. I have met EE educated software engineers who don't pretend to know anything about analog design, even though they have had a good exposure to both the software and electronics fields, because they know the details are where it counts in any technical field (which is why so many people read The Elegant Universe and then post their revolutionary ideas in the general physics forum without understanding why physicists here might get annoyed at them). What is being done with this computer science approach (for loop = feedback?) is like a mechanical engineer coming here and asking us to talk about resistors in terms of friction, capacitance in terms of mass/inertia, and inductors in terms of springs and then asking us to build/explain a circuit design with the same approach they use to build a car, or like a thermodynamics engineer coming here and wishing us to revolutionize analog designs by applying the concepts of heat transfer with enthalpy, pressure, temperature, and volume analogs to circuit design.

    If the OP thinks there is a better way of analog design that can draw from principles or techniques of the computer science field, he may have some valid ideas, but he can't get those ideas without understanding circuit design first or without closely collaborating with someone who does know circuit design inside and out. So it makes more sense to learn circuit design for what it is without a biased slant, and then when it is at a solid understanding, then go back and see what can be applied between the 2 fields. So, OP, if you want to do the computer science approach, stop asking us questions about it and start showing us examples/proof of how this approach actually works, because no one else uses that approach as far as I know. Until then, it is best just to forget this speculative link between the 2 fields and learn electronics with unbiased questions (NO FOR LOOPS). I hope we aren't discouraging you from learning analog design, because I think you will be good at it once you learn it :DDD I still think the best advice is to start building/designing circuits at a bench and explore that way with your textbook references. My apologies again for sounding like a pompous jerk, but my intentions are good :P
     
    Last edited: Aug 29, 2012
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: For Loop Circuit - calculate the nth derivative of the signal
Loading...