Signal math with op-amps.

Discussion in 'The Projects Forum' started by plfx, Jan 18, 2013.

  1. plfx

    Thread Starter New Member

    Jan 18, 2013
    19
    0
    Hello AAC,

    I am trying to put together an all-analog circuit to take some RGB video signals and convert them to YPbPr. The thrust of it is that I have some signal voltages Y, B, and R, and i'm trying to obtain B-Y and R-Y.

    I have a fistful of AD8002 op-amps and so far none of the circuit's I've cobbled together have really worked like I expected them to.

    I'm wondering if the problem is that I'm trying to use single-supply power for the op-amp, when the signal voltage needs to be able to swing negative. If so, do I need to set up a virtual ground?

    What I need is a circuit that...
    • Has high impedance at the Y input (because the Y signal needs to be separately amped and passed as output)
    • Outputs the voltages B-Y and R-Y

    Thank you in advance for any help. I have a dozen more questions, but let's keep it to one thing at a time.

    JFYI, what I'm trying to do is get component video out of a Sega Genesis. This is something I've heard talked about but never seen anyone do.
     
  2. plfx

    Thread Starter New Member

    Jan 18, 2013
    19
    0
    Thought I'd add some more information about the behavior of the configurations I've tried so far.

    What I had tried was to simply use two op-amps (one AD8002 package) to perform the two subtractions in a different manner. Instead of performing B-Y and R-Y, I was trying B-(rR+gG) and R-(bB+gG), where lowercase r g and b are just ratios obtained by adjustable pots. Some setup like this should work because Y itself is just a weighted sum of R G and B. It kind of worked, but there were a bunch of problems.

    The first problem was that it was EXTREMELY touchy to adjust. A tiny turn of the potentiometer was enough to pass over the whole range in which the signal was at an appropriate level.

    Some background: Y is the brightness of the picture while B and R are the blue and red levels, respectively. The signals sent are Y, B-Y, and R-Y, from which the R G and B levels can be reconstructed by the TV. Anyhow...

    The Y signal is the one that carries the sync pulses that the set needs to lock the signal, so the setup is particularly touchy to problems on the Y amp. The Y signal needs to be amped up from the levels the system generates before it can drive the set. The conventional way of doing this is with a transistor: http://console5.com/wiki/CXA1145

    I performed "Luma" portion of the above mod and achieved a perfectly usable Y (luminance) signal, but I didn't like the results (contrast between mid and high tones was too large. Possibly because of non-linearity of my transistor???) so I re-worked it using an op-amp instead of a transistor. This is where the above-mentioned problem first showed itself. I used a standard non-inverting amplifier with one potentiometer to divide the feedback voltage. The range in which the signal was seen as valid by the set is extremely small. It is small enough that tiny movements of the pot's knob caused by tapping the breadboard are enough to jar the range to a different brightness level. As you approach the edges of the workable range on the pot, more and more noise becomes evident in the picture.

    I switched back to a transistor amp for the Y signal and moved on to trying to get the needed B-Y and R-Y. My first approach was actually the one I mentioned above, where instead of using the Y signal directly I was actually having the op-amps perform B-(rR+gG) and R-(bB+gG). For B-(rR+gG), I tried to do this by simply tying B to the non-inverting input and R and G to the inverting input through one potentiometer to specify the balance between R and G and another to divide the voltage coming out of the first. I repeated the process for R-(bB+gG) using the other side of my dual op-amp package. Each op-amp had another pot dividing the voltage of the negative feedback.

    In arranging the above circuit I tied the G input to both potentiomenters directly, which in retrospect was probably causing some of the signal from one pot to leak into the other, but I don't think that was the major issue causing my problems. Am I wrong?

    The result was close to what I wanted, but not close enough. First of all, the picture behaved VERY strangely as I adjusted the pots. The behavior is too strange to really describe here, but suffice it to say that adjusting the pots outside of a very small range resulted in colors becoming inverted or in some cases disappearing entirely.

    I gave up on the hope of getting away with only using two op-amps to perform B-Y and R-Y, and have also decided it really is best to just use Y directly rather than trying to calculate using R G and B.

    I tried last night to re-assemble my op-amp Y circuit and didn't really get anywhere.

    Any thoughts on what the circuit I want would look like?
     
  3. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    Perhaps this or this will help.

    It's best to use a plus and minus power supply to allow DC coupling of the signal. You can use one supply and AC coupling, but that tends to cause brightness level changes in the dark parts of the picture with varying scenes. That was a common artifact in the old, inexpensive B&W televisions which used AC coupling in the video chain.
     
    Last edited: Jan 18, 2013
  4. plfx

    Thread Starter New Member

    Jan 18, 2013
    19
    0
    Thanks for the reply!

    I've seen those circuits, and there are two things. One thing is that I want to save on op-amps by using the Y signal I already have (which is output directly from the console) rather than mixing it from RGB.

    Another issue is that I really do not understand how this circuit works:
    http://circuits.linear.com/159
    http://i.imgur.com/sDYzL.png

    I don't understand how it can work correctly when all the output signals are allowed to feedback into each other's negative feedback loops.
     
  5. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Does your Y signal already have composite sync on it? If it does, that can be an added complication, because i don't think R-Y and B-Y can have imbedded comp sync.
     
  6. plfx

    Thread Starter New Member

    Jan 18, 2013
    19
    0
    It does have embedded sync, but I don't think that's a problem (though admittedly I'm fuzzy on how component video signals are treated). If you read the circuit descriptions in the previous response (which are from this manual: http://cds.linear.com/docs/Application Note/an57fa.pdf) it specifically suggests that you can EITHER mix in composite sync on the final Y or else they have to be already-present on the RGB signals (which it then uses to get Pb and Pr).

    Thinking about it, it makes sense that it's acceptable for the Pb and Pr signals to have (useless) sync signals. Component video has no colorburst or anything like that to the best of my knowledge.
     
    Last edited: Jan 18, 2013
  7. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    I'm working on a design for you, but do you really need the bandwidth you can get from AD8002?
    I did a lot of video circuit processing circuit design using current feedback amps in the past, and they can be a real PITA to work with.
    The datasheet (p.10) recommends using SMD resistors, and NOT using through-hole resistors. Can you deal with that?

    EDIT:
    Not a problem if you don't intend to create composite video. R-Y and B-Y generally go into quadrature subcarrier modulators (in NTSC, anyhow).
    Why do you need R-Y and B-Y?
     
    Last edited: Jan 18, 2013
  8. plfx

    Thread Starter New Member

    Jan 18, 2013
    19
    0
    Thank you VERY much for your attention.

    I have a limited variety of op-amps on hand. The only other candidate I have is the TL082 (I think). I don't fully remember but I think the TL082 doesn't have enough bandwidth. I also remember it doesn't have very good gain flatness, but maybe that wouldn't matter.

    Also, I'm using the terms R-Y and B-Y to mean Pr and Pb, so that someone who knows their circuits but maybe not so much about video signals can help. I forget what the ratios Pb/(B-Y) and Pr/(R-Y) are, but I'm just waving them away for the purpose of making my question more accessible.

    I do not actually need to get exactly B-Y or R-Y, I really want Pb and Pr, which are scalar multiples of those differences.

    Am I going to be able to do this just tying the op-amp's negative supply to ground, or is it going to have to be bipolar?

    EDIT:
    What is the purpose of the SMD resistors? Why won't through hole resistors work? I have the soldering skills of a drowsy monkey.
     
  9. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    The problem with thru-hole resistors is that their parasitic inductance is higher than SMDs, and probably capacitance too. When you're working with op amps with 600MHz GBW product, the parasitics become significant, and can result in overshoot and ringing, or even oscillation.
    Another characteristic of current-feedback amplifiers (CFBs) is that absolute resistor values are important. With voltage-feedback amplifiers, you have a decade or two of flexibility (depending on the application). Ratios are important (as they are in CFB amps also), but the actual values can have some slop.
    Are you working with NTSC bandwidth (5MHz luminance)? Will the color signals ever modulate a color subcarrier?
     
  10. plfx

    Thread Starter New Member

    Jan 18, 2013
    19
    0
    I am working with NTSC. The color signals (75 Ohm load strength) do not get modulated onto a subcarrier or multiplexed in any way.

    Is there a different amp I should try to use? The AD8002 is just what was immediately available to me as a DIP, but I can order some more conventional op-amps if you can suggest one for these bandwidths.

    Also, each of the Pb and Pr signals is actually only half the bandwidth of the luminance, right? So if I nyquist filtered the inputs down to that bandwidth then I would be able to use a cheaper op-amp? I can always use a simple transistor amp for the luminance signal, so I don't need an op-amp capable of that bandwidth.
     
  11. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    Follow the signal path. Y is the primary signal that is a combination of R and G and B. That signal is then subtracted from the R and B signals to generate the Pr and Pb signals. The subtraction is generated by applying the Y signal to the negative input gain resistors.(You can see how it works if you view the plus input on the Pr and Pb amplifiers as an AC common. The amps then just look like inverting amplifiers.)

    So if you already have the Y signal then you just need to use the Pr and Pb amplifiers to generate those signals from the Y and R and B signals.

    Edit: You need high frequency amps for this since the high frequency Y signal must be subtracted form the R and B signals, which are also high frequency. And to maintain the proper DC black level you need to do DC coupling using plus and minus supplies on the op amps.
     
    Last edited: Jan 19, 2013
    plfx likes this.
  12. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    To understand the circuit, you have to understand superposition. When calculating the gain from any input to an output, you can assume that all other voltage source inputs (including other op amp outputs) are at zero volts. Do this for each input to an op amp, and then sum the individual gains to get the output voltage.

    I agree that wideband op amps are needed, but the GBW product can probably be 10 times the signal bandwidth and still be fine. In the circuit he needs, I don't see anticipate high closed loop gain paths. 600MHz GBW is definitely overkill, unless we are talking analog hi-def.
     
    Last edited: Jan 18, 2013
  13. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    Sounds good to me. :)
     
  14. plfx

    Thread Starter New Member

    Jan 18, 2013
    19
    0
    And we are most definitely not talking about hi-def. We're talking about an absolute max of 320 x 448, and usually only 320 x 224
     
  15. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    What do you want to do about op amps? Do you want me to pick one, or you?
    What supply voltages do you have? I would use dual supplies and direct coupling, unless your signals have already been AC-coupled before they get to this circuit.
    Speaking of that, where do the signals come from?
    Are they 75Ω sources?
    Will they be connected by coax?
     
  16. plfx

    Thread Starter New Member

    Jan 18, 2013
    19
    0
    I would be perfectly happy with you suggesting an op-amp (preferably in a DIP package).

    The signals are coming from a CXA1145 composite encoder chip. All basic circuits I have seen for the very common S-video mod use coupling caps on the luma and chrom signals, so I will assume none of the signals coming from the chip are AC-coupled. It's hard to tell because I think that would be dependent on whether they were AC-coupled when they were passed into the chip, which I cannot determine.

    The datasheet for this chip says that R G and B outputs are 75Ω sources. They will be connected by RCA coax.
     
  17. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Instead of audio opamps why don't you use video opamps?
     
  18. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    After rereading post #2, I am wondering if I have enough info to design what you need. You said that Y needs to be "amped up". Amped up by how much?
    What is the destination of these signals? A television set?
    Also - you didn't answer my question about supply voltages.
     
  19. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Many years ago I made a video amplifier for teleconferencing that displayed on an ordinary NTSC large screen (36") CRT TV. It used a video IC with 3 opamps made by Motorola (I can't remember the part number and it might be no longer made). The picture was clearer than NTSC TV shows.
     
  20. plfx

    Thread Starter New Member

    Jan 18, 2013
    19
    0
    I'm not sure what the gain needs to be for the Y signal to drive the set. Here's the common mod done on the Y signal: http://www.jamma-nation-x.com/jammax/genesismods.html
    The resistor on the emitter of the NPN transistor is 27 Ohms with 5v on the collector.

    Yes, the signals are going to a television. A digital LCD television, specifically.

    The available supply voltage in the system is single-supply 5v
     
Loading...