Author Topic: RGB to YPbPr Converter Project  (Read 17221 times)

0 Members and 1 Guest are viewing this topic.

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
RGB to YPbPr Converter Project
« on: October 30, 2015, 10:39:19 pm »
Hi everyone,
I am thinking about enhancing the quality of my retro gaming rig, connecting my old 240p consoles to a professional upscaler I have bought. Since that thing (DVDO Iscan Ultra) only has component/YPbPr input while the consoles outputs are all modded to RGB, I was looking for a RGB to YPbPr converter. Actualy that shouldn't be to hard to find, as the circuit is quite simple, meaning, it is mainly some math work done in analog hardware. But as you can imagine, it is a pain in the arse! It seems that nobody ever thought of converting RGB to YPbPr? I found just 2 (!) converters for that, one isn't sold anymore and the other one should cost around 200€ (which would be "an order of magnitude higher" ( :P ) than the total cost of the upscaler).
Since the actual curcuit shouldn't be that hard to figure out I looked for an example and found an old article at one of my elector archives which would fit perfectls. sadly, they used the two opamps mentioned in the topic, which seem to be obsolete by now, at least I couldn't manage to find any of them anymore.

So I read around the datasheets for a while and found, that the LT139x are 300MHz bandwith opamps with a 0.1 dB gain flatness until around 150 Mhz.

Looking for an adequate replacement I stumbled upon the AD8001 which seem to be quite nice.
But since I have never worked with video stuff at this level before I am not sure if the AD8001 are that good to use in that application. I guess they are, but I would love to hear a second (or third,...) oppinion about that. Maybe someone has also another idea for a suitable replacement? cheaper would be nice, but I am more concerned about the quality. since I have payd some bucks for the RGB Mods and scaling and linedoubling hardware I don't want to ruin my day with a bad quality of that converter, just to save 2 euro per opamp.

I attached the two datasheets of the LT1399 and the AD8001.

thanks!
« Last Edit: November 03, 2015, 06:12:46 pm by Ysjoelfir »
Greetings, Kai \ Ysjoelfir
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: Looking for high frequency OpAmp to use as replacement for LT1398/1399
« Reply #1 on: October 31, 2015, 04:37:03 pm »
Looks ok to me if your circuit doesn't have supply voltages that exceed that of the AD part.
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: Looking for high frequency OpAmp to use as replacement for LT1398/1399
« Reply #2 on: October 31, 2015, 05:21:13 pm »
Hi Paul and thanks for your answer!
The supply voltage will be symmetrical 5 volts, so that should be fine. I will post the circuit as soon as I put it from my hand drawn schematic to eagle, maybe there are some aspects I have missed. :)
Greetings, Kai \ Ysjoelfir
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: Looking for high frequency OpAmp to use as replacement for LT1398/1399
« Reply #3 on: November 01, 2015, 10:29:47 pm »
I attached the circuit I made of the elector article and my thoughts about alternative parts :) I also searched a bit more and found the AD8055, which should be useful as well. What do you think? I attached a datasheet of that, too.
« Last Edit: November 01, 2015, 10:43:30 pm by Ysjoelfir »
Greetings, Kai \ Ysjoelfir
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: Looking for high frequency OpAmp to use as replacement for LT1398/1399
« Reply #4 on: November 02, 2015, 06:38:32 pm »
Hi everyone,

I rebuild the circuit using the AD8056 (a dual version of the AD8055) which allowed me to shrink that thing down by  around 20mm so it is now 56x48mm in sice. I guess I will order the components used and try that thing out. If it works, I will order some nice PCBs and search for an adequate Box to place it in.  :-+
Greetings, Kai \ Ysjoelfir
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: RGB to YPbPr Converter Project
« Reply #5 on: November 04, 2015, 10:39:53 am »
So, after talking to my electronics professor at university yesterday, he also told me that the circuit should work, using either the AD8001 or the AD8055/56. But he wasn't really enthusiastic about my design, pointing out, that a ground plane is a nice thing to use, but on video circuits you should go double sided, even though the design is that simple, and give it a bit of separation of supply and signal tracks.
Looking at pcbshopper I noticed that there is no real difference in price concerning singlesided to doublesided PCBs, so I will redesign the whole thing and go doublesided. I went with singlesided at first because I thought about making a prototype board myself (aaah, like in the old days...  :-+) but since I neither have etchant nor developer at hand, I would have to buy that stuff.. and since a 5x5 cm board doesn't cost a fortune I will go with doublesided, made in china.

I also looked again at the datasheet and rethought about the decoupling caps at the opamps.
Since I want to produce a high quality signal I went with the schematic they used for testing conditions, because I guess that should be the best possible way to do it. So I replaced the 1nF ceramic caps I used at first with three caps (10µ, 100n, 1n) and placed them as close as possible at the pins.
That was, of course, a little bit more space consuming. So I thought, why not switching to SMD, at least for the passive components. The OpAmps will be socketed. That allowed me to shink that thing further down.

So my goals were:
- redesigning decoupling of V+ and V-
- using SMD
- shrinking to get under 5x5 cm
- moving to doublesided
- trying to use mostly one direction per layer (top -> horizontal, bottom -> vertical) to minimize coupling between tracks


By the way, even if my question from the beginning is cleared by now, I would love to hear your oppinions about the project! :) As I said, I never did anything concerning video equipment, so any advice is appreciated!

I attached the newest revision of the board and would love to hear what you think about it. I disabled most of the labels so that you can see more of the tracks. thanks!
By the way, since I read a comment on another thread like "why doesn't those small boards have mounting holes!? how do you expect the user to mount it anywhere?" -> I thought about that, the triple RCA connectors I would like to use have holes for screwing to a faceplate.  :-+
« Last Edit: November 04, 2015, 10:43:03 am by Ysjoelfir »
Greetings, Kai \ Ysjoelfir
 

Offline marshallh

  • Supporter
  • ****
  • Posts: 1462
  • Country: us
    • retroactive
Re: RGB to YPbPr Converter Project
« Reply #6 on: November 05, 2015, 10:22:19 pm »
Verilog tips
BGA soldering intro

11:37 <@ktemkin> c4757p: marshall has transcended communications media
11:37 <@ktemkin> He speaks protocols directly.
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: RGB to YPbPr Converter Project
« Reply #7 on: November 05, 2015, 10:37:23 pm »
Hi marshallh,

would you please explain that a little further? I actually don't understand what you're refering to. Even though I could connect my SNES via component with this, that wouldn't sort out the "problem" with the NES, N64, Gamecube, and all the Sega Consoles. Also, I love to tinker around and learn new stuff, which I wouldn't do just buying an active cable :(
Greetings, Kai \ Ysjoelfir
 

Offline marshallh

  • Supporter
  • ****
  • Posts: 1462
  • Country: us
    • retroactive
Re: RGB to YPbPr Converter Project
« Reply #8 on: November 05, 2015, 11:05:57 pm »
It is just a RGB to component cable. The plugg happens to be a Nintendo Multi-AV port which was used om SNES to Wii, and can be added to NES easily.
Whatever you want to do is up to you.
Verilog tips
BGA soldering intro

11:37 <@ktemkin> c4757p: marshall has transcended communications media
11:37 <@ktemkin> He speaks protocols directly.
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: RGB to YPbPr Converter Project
« Reply #9 on: November 06, 2015, 07:17:57 am »
Hi,
if it is just a passive cable, could you explain how to adapt RGB to component? Am I missing something?
As far as I understood, RGB contains an absolute signal ranging from lets say zero to one for every individual color, while Component has a combined Y = brightnes signal and two color diferencial signals (Pb and Pr) ranging from -0.5 to + 0.5, going from a neutral grey. So if you would just plug RGB into a component input you would get a completely wrong colored image. And since the old consoles doesn't output component, just RGB, that should happen.

Regarding the overall used multi AV out: Yes, it was used from SNES to Wii, but only the SNES, Gamecube and Wii outputs RGB without modification. The N64 only has RGB when you have a NTSC or a very early france PAL version. Component outputs none of them.

Even though the color coding for RGB and YPbPr is the same, the advertising is most of the time wrong and even the manufacturers don't understand the difference sometimes o.o So I would assume that this cable is also just a mislabled RGB cable.
Greetings, Kai \ Ysjoelfir
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: RGB to YPbPr Converter Project
« Reply #10 on: November 06, 2015, 07:23:54 am »
These google results may help ---

https://www.google.com.au/search?q=rgb+to+yuv+matrix&espv=2&biw=1230&bih=749&source=lnms&tbm=isch&sa=X&ved=0CAYQ_AUoAWoVChMI_cSuwqH7yAIVZK2mCh0JzwH8

What you're looking for is an RGB-YUV (or YPrPb) colourspace matrix
Don't ask a question if you aren't willing to listen to the answer.
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: RGB to YPbPr Converter Project
« Reply #11 on: November 06, 2015, 09:34:32 am »
THat is what i meant and based my circuit on, yes  :)
Greetings, Kai \ Ysjoelfir
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: RGB to YPbPr Converter Project
« Reply #12 on: November 06, 2015, 09:38:11 am »
if you follow those image links, you'll see schematics and complete devices to do what you want...
YPrPb and YUV are similar, with slightly different weighting in the colour channels.
Don't ask a question if you aren't willing to listen to the answer.
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: RGB to YPbPr Converter Project
« Reply #13 on: November 06, 2015, 09:55:22 am »
I followed the links, but I don't want to buy a device, I want to learn and build my own. Is my circuit somehow faulty and I just don't get it? I would love to hear about that, even though tips to alternatives are interesting, too, but my project is to actualy build that thing  :)
Greetings, Kai \ Ysjoelfir
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: ca
Re: RGB to YPbPr Converter Project
« Reply #14 on: November 06, 2015, 08:50:22 pm »
Do you need 150 MHz op-amps for a 240p video signal? I'd wager that 10 MHz is adequate and 20 MHz is overkill enough that any higher won't make any difference.
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: RGB to YPbPr Converter Project
« Reply #15 on: November 06, 2015, 09:21:09 pm »
Hi macboy and thank you for your opinion! I realy apreciate it :) I would love to know how you estimate the needed bandwith, as this is one of the points I didn't realy know how to get to. Can you tell me how to do this?
I personaly would assume that you don't necessary need a 150 MHz opamp, even with higher quality images. But that is just my guessing.
On the other hand: Is it somehow critical to use a higher bandwith opamp? I guess as far as it isn't to "big" there shouldn't be a problem. But maybe some signals, like radio frequency signals, could get into the circuit when there is a much to high bandwith?
« Last Edit: November 06, 2015, 09:26:02 pm by Ysjoelfir »
Greetings, Kai \ Ysjoelfir
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: ca
Re: RGB to YPbPr Converter Project
« Reply #16 on: November 07, 2015, 12:12:36 am »
NTSC encodes the color information at 3.58 MHz, so the bandwidth of the luminance (brightness) where you see all the detail is below that.
Another way to look at it is to examine the pixel rate. You have maybe <= 400 pixels horizontally. NTSC is 30 frames per second with 525 lines each (interlaced) so 400 * 525 * 30 = 6 300 000 pixels per second. If you have light/dark pixels alternating (worst case) then that's like a 3 150 000 Hz square wave. The more harmonics of that square wave that you can accommodate, the sharper the edges will be. 20 MHz will allow a good sharp transition between pixels. More than that is diminishing returns.

edit:typo in number
« Last Edit: November 13, 2015, 01:34:11 pm by macboy »
 

Offline Ste

  • Newbie
  • Posts: 4
  • Country: us
Re: RGB to YPbPr Converter Project
« Reply #17 on: November 08, 2015, 08:02:01 am »
The main issue you're having is that you're not considering the synchronization signal at all.  For consumer applications, the sync needs to be embedded on the Y channel as per CEA-770.2-D.  The EBU also has a very similar YPbPr standard, which is available on the website that is offering those "mislabeled RGB cables":  http://www.hdretrovision.com/s/EBU_N10-1998.pdf
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: RGB to YPbPr Converter Project
« Reply #18 on: November 10, 2015, 09:57:46 am »
NTSC encodes the color information at 3.58 MHz, so the bandwidth of the luminance (brightness) where you see all the detail is below that.
Another way to look at it is to examine the pixel rate. You have maybe <= 400 pixels horizontally. NTSC is 30 frames per second with 525 lines each (interlaced) so 400 * 525 * 30 = 63000000 pixels per second. If you have light/dark pixels alternating (worst case) then that's like a 3150000 Hz square wave. The more harmonics of that square wave that you can accommodate, the sharper the edges will be. 20 MHz will allow a good sharp transition between pixels. More than that is diminishing returns.

Thanks, that clears it up for me and enlarges the field of usable parts, nice!

The main issue you're having is that you're not considering the synchronization signal at all.  For consumer applications, the sync needs to be embedded on the Y channel as per CEA-770.2-D.  The EBU also has a very similar YPbPr standard, which is available on the website that is offering those "mislabeled RGB cables":  http://www.hdretrovision.com/s/EBU_N10-1998.pdf

I thought about the synchronization, but I have to admit that I totaly forgot about it after fiddling around with the actual converter circuit...
How would you get the sync where it has to be?
I would think about it like this:
When the incoming sync signal is a RGsB signal there shouldn't be a problem at all as the sync on green will be available at the Y output, but acording to the EBU document you linked, i would have to get the sync information out of the Pb and Pr channels, so adding a sync stripper at the G input would be needed. For RGBHV I could just use two caps to get the sync into the Y and for C-Sync I would need a sync stripper and also get the outcoming signal into the Y somehow. If combining one input for either C-Sync or HV Sync I should get around using only one sync stripper.

If I figure it corectly, I should be okay with something like the image in the attachment?
Greetings, Kai \ Ysjoelfir
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: RGB to YPbPr Converter Project
« Reply #19 on: November 12, 2015, 10:27:35 am »
I looked around the net some more and found that it is quite easy to get the sync out of the composite signal using a LM 1881 but it seems quite hard to kill the sync signal out a potential RGsB Signal. Hmm... I assume that there shouldn't be a big problem having that in the output signal, but I would love to know if there is a easy solution to get the sync out of the green channel, because then I would just use the LM1881 to get a sync out of a composite signal and connect the output straight to the H/V Sync inputs, again connecting those via coupling caps to the Y output, so I could get rid of the switch and stay conform with the specifications.
Has anyone an idea or any more advice?
Greetings, Kai \ Ysjoelfir
 

Offline Ste

  • Newbie
  • Posts: 4
  • Country: us
Re: RGB to YPbPr Converter Project
« Reply #20 on: November 13, 2015, 04:30:02 am »
NTSC encodes the color information at 3.58 MHz, so the bandwidth of the luminance (brightness) where you see all the detail is below that.
Another way to look at it is to examine the pixel rate. You have maybe <= 400 pixels horizontally. NTSC is 30 frames per second with 525 lines each (interlaced) so 400 * 525 * 30 = 63000000 pixels per second. If you have light/dark pixels alternating (worst case) then that's like a 3150000 Hz square wave. The more harmonics of that square wave that you can accommodate, the sharper the edges will be. 20 MHz will allow a good sharp transition between pixels. More than that is diminishing returns.

Thanks, that clears it up for me and enlarges the field of usable parts, nice!
Whoa.  Hang on.  Although the 20MHz actually ends up being close, I don't believe this derivation is accurate for your particular situation, as you are not dealing with NTSC at all.  Although it's still SDTV, Analog RGB from retro consoles can have high frequency information beyond 8MHz.  Even though the graphics processors generate a limited number of pixels per line, the higher frequency content gives you the sharp and crisp pixel edges that are usually desired for this format.  However, most sink devices (modern TVs and your iScan) will sample these signals at 13.5MHz and therefore have anti-aliasing filters with cutoff of 6.75MHz.  So around 7MHz is what you should consider as your maximum desired signal content.  You need to understand that the front page frequency rating of the opamp is simply its gain-bandwidth product (GBP), which is dependent on your closed loop gain.  Also, it is a simplified single-pole model and means you will still get decent attenuation well before that listed frequency number.  Ideally, you would want to pick a "video opamp" because they have specs listed in their datasheets for particular video applications.  The situation you are in, and it's the most common, is usually denoted with Gain = +2 & R_L = 150.  You would want to look for 0.1dB flatness throughout your desired signal content.  You can get away with less, but it's up to you in the end how you want to balance your circuit between cost, features, and quality.

The main "danger" of using an opamp with a much higher speed than needed is that it's easier to lose phase margin (especially with low closed-loop gains), which can give you excessive ringing on fast transitions.  But if that even becomes an issue, it can be solved by adding a small feedback capacitor.


When the incoming sync signal is a RGsB signal there shouldn't be a problem at all as the sync on green will be available at the Y output, but acording to the EBU document you linked, i would have to get the sync information out of the Pb and Pr channels, so adding a sync stripper at the G input would be needed.
It depends how you want to approach the situation and how much money you want to throw at it.  With RGsB run in directly, it's possible you might get away with having remnants of sync linger in the Pb and Pr channels with no ill effects.....or it's also possible you might confuse the DC restoration circuit on your sink's input video processor and get incorrect color saturation & hues.  If you're just developing this for yourself, and you know your iScan has no issues with this, then you can probably get away with doing it.


For RGBHV I could just use two caps to get the sync into the Y and for C-Sync I would need a sync stripper and also get the outcoming signal into the Y somehow. If combining one input for either C-Sync or HV Sync I should get around using only one sync stripper.
If you want to approach it like this, you need to do more research on your intended input signals and determine their voltage swings and source impedances.
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: RGB to YPbPr Converter Project
« Reply #21 on: November 18, 2015, 06:08:47 pm »
Hi Ste and again thanks for your reply!
I took my time to read through your words carefuly, trying to understand everything.
As far as I got it, you say that using the opamps I suggested wouldn't necessyrily be bad and basically everything with a flat curve to around 10 MHz could be used in this particular circuit. I hope I got that right?
I actualy ordered a set of the 200 MHz Opamps before and will try them out as soon as my PCBs arrive. The pinout seems quite standard, so I will try using other OPs, too, assuming the circuit works as intended.

For the sync problematic:
I actually will first try feeding the signal straight into the circuit to get to know how the iscan reacts. If it works as intended, I will take a look at the video quality and maybe work at that. If everything is great regarding the quality I will try to get the sync out of the signal before it enters the converter.
As far as I saw it there is nearly everytime at least a composite signal present if there is also RGB. So I should get away using only a sync stripping circuit to seperate sync from composite. that would make it a bit more easy.

To answer your thoughts about whether I develop it just for myself: Actualy yes, I first thought about only developing it for myself. But as I told about it in university I already got some people who were interested in it. So if it reaches a working state I will at least give away a few other devices. So I should take care that it works nearly everywhere.
Have you some more advice about this?
Greetings, Kai \ Ysjoelfir
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: ca
Re: RGB to YPbPr Converter Project
« Reply #22 on: November 24, 2015, 04:52:53 pm »
Have you considered AD725 RGB-to-NTSC IC?
 

Offline YsjoelfirTopic starter

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: de
Re: RGB to YPbPr Converter Project
« Reply #23 on: November 24, 2015, 09:51:33 pm »
Hi all,
there are some news! My PCBs arrived and I build a sample up yesterday. Tested it and noticed, that there was no synchronisation as you all already expected! So I used a protoboard to build a sync stripper with the LM1881 for the proviced composite signal and fed the sync via a cap to the Y-output. The picture stabilized, but was suddenly way to bright but the picture itself looked quite nice. I guess there was some DC offset on the output of the LM1881.
Since I don't have a (working) scope with trigger holdoff I couldn't get a standing picture of the output, it was just oscillating all over the place and appeared two times stacked, but at thursday I can use a Rigol DS1104z at university to probe around, so I will take a look at it.
I attached some pictures of the done and populated converter. The quality elecrow provided for the PCBs is actualy pretty nice! And yes, I know, the soldering work I did on the SMDs isn't really that great - but I have to admit that I last made SMDs was some years ago and the findest (!) solder I had was 1mm... So please show mercy!  :scared:


macboy,

actually no, I haven't. But I took a look at it now and as far as I didn't miss anything, I couldn't use it anyway, since I would like to convert the RGB to component, not composite  ;D But never the less, thanks for your effort!
I actually took a look at it again. I guess I get now what you were thinking of - even though the AD725 is designed to convert to NTSC composite video (and also PAL as the datasheet says) it outputs a s-video signal with a filtered Y (with doubled voltage level as i read somewhere at the datasheet). Since this Y already carries the sync I could use it for my needings, even though that means redesigning (at least a little :) ) the  design. It actualy looks like a pretty neat solution for my sync problem. But one thing I don't like at all - the price! Man, that sucker is expensive!


I will rework the layout to get the LM1881 (and the AD752 or another solution someone maybe suggests or I work out by myself) into the converter circuit and look for a way to get the sync into the Y. Any other ideas to get there in an easy and maybe cheaper way are welcome!
Greetings, Kai \ Ysjoelfir
 

Offline Gortu

  • Newbie
  • Posts: 1
  • Country: pl
Re: RGB to YPbPr Converter Project
« Reply #24 on: January 10, 2017, 11:54:45 am »
The picture stabilized, but was suddenly way to bright but the picture itself looked quite nice. I guess there was some DC offset on the output of the LM1881.

Since this Y already carries the sync I could use it for my needings, even though that means redesigning (at least a little :) ) the  design. It actualy looks like a pretty neat solution for my sync problem. But one thing I don't like at all - the price! Man, that sucker is expensive!

I will rework the layout to get the LM1881 (and the AD752 or another solution someone maybe suggests or I work out by myself) into the converter circuit and look for a way to get the sync into the Y. Any other ideas to get there in an easy and maybe cheaper way are welcome!

Hello
Did you obtain some new results related or not to above quotes? I'm facing RGB to YPbPr conversion with http://www.linear.com/solutions/1311, it says there that sync should be in all R, G, B signals, or else added manually to output Y signal. Wonder how SCART sockets work, where do they put sync signal, is it only Composite pin hmm

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf