Level shifting - Page 1
Forum section: electronics / projects

author: syntax333
author_rank: Regular Contributor
timestamp: December 23, 2018, 12:05:37 am
content: Hi, what is the best way to level shift an Composite signal which includes AC and DC signal? (Adding DC bias to CVBS signal)

author: Rerouter
author_rank: Super Contributor
timestamp: December 23, 2018, 01:38:35 am
content: If your just adding a DC bias to it, the simplest way is a resistor divider for the DC with an AC passthrough (capacitor) For more detailed information you can look at things like TV antenna amplifiers that require a DC supply to power to mast antenna, they just use a capacitor for the signal and feed in the DC voltage through a resistance.

author: vk6zgo
author_rank: Super Contributor
timestamp: December 23, 2018, 01:55:39 am
content: Quote from: syntax333 on December 23, 2018, 12:05:37 amBuild a keyed clamper circuit, but instead of clamping the blanking(or black level for NTSC) to zero volts,clamp it to whatever DC voltage you require.This was quite commonly done back in the day.PS:- Reading your other thread, it was suggested to clamp the sync pulse tips------- this is the alternative toclamping black level, but remember, with that method, if you are trying to restore your video signal tostandardlevels, you will need to clamp the sync tip to around -300 mV.

author: syntax333
author_rank: Regular Contributor
timestamp: December 23, 2018, 10:25:53 am
content: Problem is that when I use the circuits like Bias tee, they completely purifies the signal from DC. However, that is not what I want. I attached the signal that I am working with. I just want to shift the level of it. Bias tee circuit eliminates the DC components in the signal.

author: syntax333
author_rank: Regular Contributor
timestamp: December 23, 2018, 10:29:31 am
content: Thank you for your suggestion, I was trying to find easier solution but it seems I have to do it like you said. Is there any reference that I can use to build that circuit? It would be great.

author: vk6zgo
author_rank: Super Contributor
timestamp: December 23, 2018, 10:46:56 am
content: There is a simpler solution, a thing called a "DC Restorer" .It doesn't work as well as the keyed clamper, but was widely used in the video stages of BW TVs.From memory, it consists of a Coupling capacitor, a diode & a few other bits, but I haven't seen one for solong, I had forgotten about them.I will Google, but I'm not very hopeful.

author: syntax333
author_rank: Regular Contributor
timestamp: December 23, 2018, 10:55:24 am
content: I am familiar with DC restorer. However, isn't it shifting negative part of the signal to positive level? Best to my knowledge CVBS signals do not have negative part.

author: Benta
author_rank: Super Contributor
timestamp: December 23, 2018, 12:07:09 pm
content: Sync extraction (LM1881) and clamping is the way to go, like I said in your other thread. You can clamp to any DC voltage you like.As vk6zgo says, it's best to clamp to black/blanking, as sync amplitude may vary (although it shouldn't, it often does in practice).

author: vk6zgo
author_rank: Super Contributor
timestamp: December 23, 2018, 12:49:37 pm
content: Quote from: syntax333 on December 23, 2018, 10:55:24 amYes,they do!Unfortunately, from Googling, you wouldn't find that out, which is why I find the Internet a little underwhelming as a resource.As you have found, analog video signals need to maintain particular set levels for the interconnection of equipment.All the websites I've found that show video waveforms have them simply shown as a 1 volt peak to peak signal, starting at zero volts at the sync tips, & extending to 1 volt at peak white luma.It makes it easy to show the relevant levels, but it is equine faeces!In a standard PAL video signal, blanking is at zero volts, peak white luma is at +0.7volts & sync tips are at -0.3volts.With NTSC, they distinguish between black level & blanking, with zero level at black, so the positive & negative voltages are slightly different, but not really enough to worry about.DC restorers (which can shift signal DC components both ways) are normally shown on website descriptions with simple waveforms, but video waveforms arenotsimple.The CR time constant ends up being a compromise between what works best at line rate, & what works best at field rate.For this reason DC restorer use is mainly in TV receiver use, where its advantage is cheapness.The device of choice in Broadcast TV is the keyed clamper.Even with the use of ICs, a keyed clamper is a reasonably complex device.Why do you have to feed the DC down the coax?It is possible to buy cables which have audio & coax cables in the same sheath.They are a bit more unwieldy than normal coax, but the audio conductors are usually big enough use for a DC supply connection,& would allow you to dispense with both the "Bias T" & the need to reset the video DC reference level.

author: vk6zgo
author_rank: Super Contributor
timestamp: December 23, 2018, 12:55:56 pm
content: Quote from: Benta on December 23, 2018, 12:07:09 pmYes, but it must be "soft" clamping,so it doesn't mangle the colour burst.Many years ago, we spent a lot of time modifying the clamping on our originally BW transmitter so we could run it with PAL.Ultimately, a simple 4.433mHz trap in series with the clamp diode was the best.Those "clamp diodes" were 6AL5s, if my memory doesn't deceive me!

author: syntax333
author_rank: Regular Contributor
timestamp: December 23, 2018, 01:51:52 pm
content: Correct me if I am wrong , Clamper circuits are for limiting voltage right? how does it help me to DC shift the signal? I didn't get that part. The waveform that I am trying to achieve is in attachment.Edit: Okay I get the point. You mean "keyedclamping.png" circuit.

author: Benta
author_rank: Super Contributor
timestamp: December 23, 2018, 03:39:12 pm
content: Exactly. This is how it's done in all the video circuits I've seen, except it's usually deeply embedded in the video processors. The LM1881 is an exception as stand-alone IC.The simplest is clamping on the sync tips, where the switch is controlled by the CSOUT signal, a bit more complicated is using the BPOUT for clamping on black/blank.

author: syntax333
author_rank: Regular Contributor
timestamp: December 23, 2018, 03:58:08 pm
content: What is the main difference between clamping using CSOUT and BPOUT? Is there any specific reason to use BPOUT to clamp since it is more complicated?

author: Benta
author_rank: Super Contributor
timestamp: December 23, 2018, 04:29:16 pm
content: Sync tips are not always correct in amplitude. Black/blank is the reference level in a CVBS signal and preferable. It's a question of signal integrity and precision.That being said, you probably won't notice any visual difference when looking at the video.As vk6zgo said, you need to be careful not to mess with the colour burst when choosing black/blank clamping.

author: syntax333
author_rank: Regular Contributor
timestamp: December 23, 2018, 04:59:03 pm
content: I think safest option for me to go is sync tips since I am not experienced about CVBS. So I have two final questions?1. Is it enough to simply connect the lm1881 CSOUT pin to key to achieve DC biasing? or do I need any additional circuitry?2. Can you recommend Analog Switch alternatives to DG419B?

author: Benta
author_rank: Super Contributor
timestamp: December 23, 2018, 05:59:26 pm
content: Here's a quick little sketch.If you need to drive your output into a 75 ohm load over longer distances, you need a x2 amplification somewhere.Concerning DG419B, there are lots of analog switches out there. It's just that I've used them successfully in several CVBS projects. You might even consider just a transistor or MOSFET.

author: syntax333
author_rank: Regular Contributor
timestamp: December 23, 2018, 06:43:48 pm
content: Thank you for the circuit diagram I will definitely try it out.I just wanted to learn that is there any specific parameter that I need to look while choosing Analog switches for using for my application.

author: Benta
author_rank: Super Contributor
timestamp: December 23, 2018, 06:53:40 pm
content: I'd say below 100 ohms and as little feed through when off as possible. But that's just an approximation, in this application it's not really critical.My use of analog switches (DG419B) was directly in the CVBS line, which is much more demanding.

author: syntax333
author_rank: Regular Contributor
timestamp: December 26, 2018, 07:12:27 pm
content: I am assuming the circuit with bjts are for Zout << Zin condition. However, I am worried that bjt switching speed won't keep up with the 4.3Mhz PAL color carrier. I am asking that will the bjts create a problem about switching speed, should I use MOSFET instead of bjt since they have faster switching characteristics?

author: Benta
author_rank: Super Contributor
timestamp: December 26, 2018, 07:32:37 pm
content: Quote from: syntax333 on December 26, 2018, 07:12:27 pmDon't worry, in-your-drawer BC547/557 or BC 847/857 will work perfectly. They're 250 MHz fTtransistors and operating as emitter followers will give you zero problems.MOSFETs would be a nightmare. Why are you so down on BJTs?You'll find this buffer configuration in all kinds of commercial video equipment, it preserves the DC level of your signal. Simple, easy and cheap.

author: syntax333
author_rank: Regular Contributor
timestamp: January 01, 2019, 05:52:52 pm
content: Hi, the circuit that you suggested worked perfectly thanks for the suggestion. However, I got two issues, this could be due to my low knowledge about the buffer circuits.1) You can see the output of the clamp circuit (indicated by White) + output of the buffer circuit ( indicated by Yellow). Output of the buffer seems to have degraded compared to output of the clamp circuit. Also there is no load connected to output of buffer at the moment.Is this due to wrong chosen values of follower configuration parameters such as voltage and resistor values or something else?The values that are chosen is shown in attachment.2) I want to drive a 200mA load with this configuration. Probably due to wrong values of resistors and supplied voltage, resistors and transistors are heating up pretty quickly. The load is approximately 17.5-20 ohms.How do I get rid of the heating problem? Should I buy high power resistors like 5W? Or cooling down transistors with heat sink etc.(NOTE: currently I am using BC327 and BC337 as bjts)

author: Benta
author_rank: Super Contributor
timestamp: January 01, 2019, 07:00:26 pm
content: I see several issues.It looks as if you're clamping on sync, which is fine. But it's very obvious that your Vref is not able to deliver the current needed when clamping occurs. It needs to clamp a 75 ohm signal and is not able to do it, otherwise the sync tips wouldn't be angled, but horizontal.You might be able to cure this by using a larger decoupling cap for Vref, if not you'll need to buffer Vref.For the first emitter follower, I'd try using 1 kohm as emitter resistor, this will bring down power consumption and gain demand.For the second, with a 100 ohm emitter resistor, you're burning around 0.6 W of power in the transistor and resistor (I'm assuming 12 V supply) and yes, this will get hot.Let's know how you get on.

author: syntax333
author_rank: Regular Contributor
timestamp: January 01, 2019, 08:01:58 pm
content: sync tips being angled is probably due to the ac coupling cap at input I changed the value with 10uF. However, this time there are spikes at certain times as shown in attachment.I have changed the value of resistor on first follower with 1kohm. Besides that is there anything you can suggest for the heating problem?

author: Benta
author_rank: Super Contributor
timestamp: January 01, 2019, 08:45:41 pm
content: This is getting interesting. To move on, I have a few questions:What exactly is your CVBS source? is it 1 Vpp, 75 ohms or something else?Did you follow the LM1881 component recommendations 100%?What is your Vref?Is the input cap polarized correctly (positive side to the emitter followers)?Have you decoupled everything correctly (mix of 10n and 100n caps?Are the wires too long (everything should be close together)? If you're using a plug-in breadboard, I'll find you and kill you.The spikes are not important, we can take of them along the way. But what I see in your second trace is, that the CSOUT is only present on the second video line. So the LM1881 is not operating correctly.I also see a level shift, so I suggest increasing the input cap to 47...100 uF

author: syntax333
author_rank: Regular Contributor
timestamp: January 01, 2019, 09:21:18 pm
content: 1) Yes I just checked again and it is exacly 74.4ohms and 2.76Vpp (is this normal?).2) Well, I don't have the 680kohm resistor so I made it with using other resistor values parallel and series combination to get the desired value. Besides that everything is according to datasheet.3) I give 6V as reference voltage. Also supply voltage to the lm1881.4) Yeah it polarized correctly.5) If you mean supply voltages and reference voltage yes I did.6) Wires are not too long. Unfortunately, I am using breadboard while experimentingI increased input cap to 100uf.You are probably right about the lm1881 working not correctly as we can see from the attachment..I will create a schematic of the circuit that I build and post here to make things clear.

author: Benta
author_rank: Super Contributor
timestamp: January 01, 2019, 09:35:35 pm
content: OK, look forward to your schematic.But honestly a lot of your problems relate to the breadboard. Those things are not usable for anything over 60 Hz, andcertainly notfor CVBS. Get a stripboard or something like that instead.2.76 Vpp CVBS is high, but once it's loaded with 75 ohms it will drop to half. With the color burst on top, it's ballpark.

author: syntax333
author_rank: Regular Contributor
timestamp: January 01, 2019, 10:52:34 pm
content: I will try to build it to a stripboard as you said. Until then, I uploaded the schematics. Please inform me about the problems that you see on it.

author: BrianHG
author_rank: Super Contributor
timestamp: January 01, 2019, 11:12:40 pm
content: Quote from: syntax333 on January 01, 2019, 10:52:34 pmIn a circuit I once done, instead of your mosfet (Q1), I used a 4066 cmos analog switch, the enable control input tied to the sync separator, and a trim-pot at 1 input, adjusting the voltage from 0-5v, and the other side tied to the video source after a 1uf cap, or 0.1uf cap, not 100uf (C3). (Not if you want a true black level adjuster, tie the 4066's enable to the 'burst' output on the sync separator)At that video point, I used a 2n7000 mosfet in a source-follower configured amp. (video after 1uf cap tied directly to Gate of mosfet, 1k pulldown on Source which was video out) (No Q2/Q3/R3) I was then able to adjust the voltage output of the video to any level using the trimpot.

author: Benta
author_rank: Super Contributor
timestamp: January 02, 2019, 10:46:33 am
content: Several points stand out:C3 is in the wrong direction.CSOUT is active low, so your switch logic is wrong.The MOSFET is HUGE! No wonder you get spikes when the puny LM1881 output has to drive all that gate capacitance. I strongly recommend a DG417 or DG419.Your decoupling is somewhat lacking. At least you'll need 100 nF directly at the LM1881. 12V should also be decoupled.Then let's see.

author: BrianHG
author_rank: Super Contributor
timestamp: January 02, 2019, 11:38:10 am
content: Quote from: Benta on January 02, 2019, 10:46:33 amOoops, It's been so long. In the case of my example circuit, you would need to invert the CSOUT before feeding the 4066's analog switch enable.

author: syntax333
author_rank: Regular Contributor
timestamp: January 02, 2019, 12:11:46 pm
content: I couldn't find any information about CSOUT being active low (athttp://www.ti.com/lit/ds/symlink/lm1881.pdfsection 7.3.1) are you sure about that?

author: Benta
author_rank: Super Contributor
timestamp: January 02, 2019, 12:31:54 pm
content: Page 3. Look at the timing graph.

author: syntax333
author_rank: Regular Contributor
timestamp: January 06, 2019, 10:49:02 pm
content: Finally I found time to build the circuit according to your recommendations. The problem was probably due to wrong switch logic and MOSFET as you stated.After I changed the two of them, most of my problems are solved.You can see the final circuit in attachments.I have couple of problems.1) As you can see from DS1Z_QuickPrint2 and DS1Z_QuickPrint3 signal is degraded. Shouldn't yellow signal and blue signal be the same? Is this due to low resistor value at follower circuit?2) I get weird random spikes at output of the follower circuits (as seen in DS1Z_QuickPrint1 ) are those little spikes acceptable to an video display device? or should it be as clean as the input signal to follower circuits (blue signal)?(I couldn't find any supplier that sells DG417 in my country however, according to BrianHG's suggestion, I tried to build the circuit with 4066.)Also do you see any other problem at the circuit schematic?

author: syntax333
author_rank: Regular Contributor
timestamp: January 07, 2019, 09:13:22 pm
content: I have been able to solve the problem by changing 10kohm at input of the emitter follower with 1k and changing npn emitter follower resistor with 10k instead of 1k.(Yellow signal is AV input signal and blue is output of the buffer)

author: Benta
author_rank: Super Contributor
timestamp: January 07, 2019, 09:35:21 pm
content: Congratulations, very impressive results!After your getting the switch logic fixed, I also see that the LM1881 is now triggering reliably, probably due to better decoupling.The sync/black/blanking levels are just as they should be, great!The attenuation of the color carrier puzzles me. The emitter followers would normally not be able to cause this, they should be fast enough.I'll put my thinking hat on. But thanks for coming back with your results.

author: Benta
author_rank: Super Contributor
timestamp: January 07, 2019, 09:44:15 pm
content: Scratch my reply above, you've solved itThe only thing that might be necessary is a capacitor to ground from the 74HC4066 lower switch end. Try 1 uF.The spikes will probably go away with a better analog switch. But if you can't find DG417/419, oh well. What you've achieved here is good enough.

author: syntax333
author_rank: Regular Contributor
timestamp: January 07, 2019, 09:51:16 pm
content: Thank you very much for your answers and guidance along this journey of mine.There are still to much to learn about electronics for me so without the proper guidance I wouldn't be able to achieve this results.OK I will place 1uF across "R6".Also is the 10k enough for "Re" value of emitter follower (npn) or should I increase it more? What is the limit here? Why can't I just put 10M?I will probably order some DG417 from foreign companies while waiting I just wanted to do some experiment with this circuit.

author: Benta
author_rank: Super Contributor
timestamp: January 07, 2019, 10:03:28 pm
content: You're welcome.There's no reason to increase Re further, in fact it's already a bit high. 4.7k might be closer to the mark.You're not at the end of the journey yet. The next point is to see how the circuit works when a load is connected.But the basic function is there, and it works excellently.

author: syntax333
author_rank: Regular Contributor
timestamp: January 08, 2019, 12:37:01 pm
content: I will load the circuit and share the results as soon as possible.Besides that I have couple of questions.What is downside of large Re? You said that it is bit high, how did you decide that? I am familiar with regular emitter follower circuit however I have never used them in this configuration.While I was researching I found that this configuration is used mainly to get rid of the dc offset, however I couldn't find any source that shows design procedure.Can you explain or give reference for this circuit so I can learn more about this configuration?

author: Benta
author_rank: Super Contributor
timestamp: January 08, 2019, 03:51:08 pm
content: Quote from: syntax333 on January 08, 2019, 12:37:01 pmThe first Re supplies base current to the PNP emitter follower. If you make it 1 Mohm you'll starve the transistor completely of base current.The complementary emitter follower quite correctly conserves the DC level of the signal. A simple emitter follower shifts the signal by Vbe (~0.65 V). By having and NPN and a PNP stage, this is eliminated.It's not my inventionI first noticed the circuit many years ago while repairing VCRs and shamelessly copied it for my own designs.

author: Zero999
author_rank: Super Contributor
timestamp: January 08, 2019, 04:29:23 pm
content: Quote from: Benta on January 08, 2019, 03:51:08 pmIt's a fairly common circuit. A push-pull variant is often used for audio amplifier output stages, which will probably work well. It can be improved by adding current sources/sinks.Refer to (b)https://www.researchgate.net/figure/Different-kinds-of-class-AB-output-stages-a-Push-pull-network-and-b-improved_fig1_3139443

author: Benta
author_rank: Super Contributor
timestamp: January 08, 2019, 05:06:04 pm
content: Zero999, my apologies. I used an incorrect term for the buffer stage.It's not a "complementary emitter follower" which your pictures correctly show, but an "NPN - PNP emitter follower cascade".Very often found in CVBS applications where no voltage gain, but DC-level conservation and current gain is needed.

author: Zero999
author_rank: Super Contributor
timestamp: January 08, 2019, 05:13:48 pm
content: Quote from: Benta on January 08, 2019, 05:06:04 pmYes, but it works on the same principle. Remove Q1, Q4 and IQ1and replace IQ2with a resistor and it's the same circuit as yours.The complementary version will be better, but it's more complex.

author: Benta
author_rank: Super Contributor
timestamp: January 08, 2019, 05:40:59 pm
content: Quote from: Zero999 on January 08, 2019, 05:13:48 pmI'm not certain about that. A video buffer should have a GBW of at least 100 MHz to avoid colour carrier phase shift. The simple emitter followers will do this, but with the more complex types you posted I have my doubts (parasitics).

author: Zero999
author_rank: Super Contributor
timestamp: January 08, 2019, 08:17:48 pm
content: Quote from: Benta on January 08, 2019, 05:40:59 pmWhy do you believe the complementary version will have a lower bandwidth, than the single ended one? It should have a lower output impedance. The main issue I see is crossover distortion.The input impedance goes down of both circuits, with increasing frequency, so the bandwidth will be limited by the source and load impedances. The 10k resistor will limit the bandwidth in your circuit. What does it do? If it's removed, the bandwidth will increase.

author: Benta
author_rank: Super Contributor
timestamp: January 08, 2019, 09:06:30 pm
content: I will not go into a nitty-gritty discussion on this. Your complementary circuits are excellent for audio, but CVBS is extremely sensitive to phase distortion.The simple emitter followers work well in CVBS applications, there is probably a reason that professional video equipment use them.My 10k resistor was ill chosen, but for a first design suggestion on a paper napkin not too bad.Note my comment in brackets: "parasitics". The more transistors you throw at an application, the more problems you can expect.

author: Zero999
author_rank: Super Contributor
timestamp: January 09, 2019, 09:07:01 am
content: Quote from: Benta on January 08, 2019, 09:06:30 pmI'm sure you know it's not as simple as more components, more parasitics, more phase shift and less bandwidth. Using that logic know might thing the push-pull circuit I posted will use more power, but it doesn't. Indeed it will use less power, than the single ended class A two transistor amplifier.I suspect the main reason for choosing the two transistor circuit is simplicity and I wasn't seriously suggesting the complementary circuit for this application. In fact I wouldn't recommend the discrete complimentary circuit for any video application. I'd opt for a video amplifier IC or high speed op-amp instead.

author: syntax333
author_rank: Regular Contributor
timestamp: January 11, 2019, 06:41:10 pm
content: I connected my load to circuit which worked fine there is no change in signal shape however as I showed my circuit schematics I connected 300ohm resistor as a PNP follower resistor.Problem is that the load only draws approximately 10mA but I want it to be able to draw more current (100mA). If I lower the resistor value I get higher current but there is heating problem.Is there a way to solve that problem with additional circuitry or do I need to use higher W resistors and heat-sink on transistor?

author: Benta
author_rank: Super Contributor
timestamp: January 11, 2019, 11:03:10 pm
content: Do you really need to deliver 100 mW video power, or do you need to deliver 100 mA DC current? I'm confused...

author: syntax333
author_rank: Regular Contributor
timestamp: January 12, 2019, 08:44:21 am
content: I need to deliver 100 mA DC current to my load.

author: xavier60
author_rank: Super Contributor
timestamp: January 12, 2019, 09:59:23 am
content: Quote from: syntax333 on January 12, 2019, 08:44:21 amYou could try a constant current source from the 5V rail.

author: Zero999
author_rank: Super Contributor
timestamp: January 12, 2019, 03:25:43 pm
content: Using a constant current instead of the emitter resistor will improve the performance, but it won't reduce the power dissipation. I'd recommend using a video amplifier IC, which will use much less power.http://www.ti.com.cn/cn/lit/ds/symlink/opa832.pdfEDIT:How can it deliver 100mA DC to the load? It's AC coupled, so there will be no DC in the load.

author: Benta
author_rank: Super Contributor
timestamp: January 12, 2019, 09:08:49 pm
content: Quote from: syntax333 on January 12, 2019, 08:44:21 amI'm getting a somewhat fed up with your way of providing information bit-by-bit. If it's super secret, don't ask here, but go your own way. If not, don't make us waste our time, we're doing this for free.Why don't you just what you're trying to do, then we can really help?!How far away is your load?What kind of cable?And so on...