Line Interpolation.

Forum for discussion of narrow-bandwidth mechanical television

Moderators: Dave Moll, Andrew Davie, Steve Anderson

Postby Klaas Robers » Fri Apr 13, 2012 6:45 am

Steve, a CRT has inhaerently a gamma of 2. So if you make a CRT-monitor linear, you have to implement de-gamma before you steer the CRT. This has to do with the way the electron gun of a CRT works.

If you want to interplolate 32 lines into 64 then you coud do:
line 1 = line 1,
line 2 = (line 1 + line 2) / 2
line 3 = line 2,
line 4 = (line 2 + line 3) / 2
line 5 = line 3,
............
line 62 = (line 31 + line 32) / 2
line 63 = line 32
line 64 = (line 32 + 0) /2

But then the leading edge has a different appearence than the trailing edge. So better is:
line 1 = line 1 * 3/4
line 2 = line 1 * 3/4 + line 2 * 1/4
line 3 = line 1 * 1/4 + line 2 * 3/4
line 4 = line 2 * 3/4 + line 3 * 1/4
............
line 62 = line 31 * 3/4 + line 32 * 1/4
line 63 = line 32 * 3/4 + line 31 * 1/4
line 64 = line 32 * 3/4

This will as well eliminate the 32-line structure completely.

There is no objection to clamp on the sync pulses. You want to be able to adjust the black level any way.
User avatar
Klaas Robers
"Gomez!", "Oh Morticia."
 
Posts: 1656
Joined: Wed Jan 24, 2007 8:42 pm
Location: Valkenswaard, the Netherlands

Postby Steve Anderson » Fri Apr 13, 2012 1:02 pm

Klaas Robers wrote:This will as well eliminate the 32-line structure completely.


This is the beauty of programmable devices, so many variations on a theme may be tried...including your suggestions above.

Klaas Robers wrote:There is no objection to clamp on the sync pulses. You want to be able to adjust the black level any way.


Agreed, and this is currently what I do, however a 'proper' black reference would have been a nice inclusion in the original NBTV specification, even if most didn't use it. In the "Good old, bad old days" simplicity was the keyword, so that's 20/20 vision.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby Steve Anderson » Tue Apr 17, 2012 2:32 pm

Over the past couple of days I have been able to make some progress here. I've added an 8-bit A-D to the original SD Card 'development' board. I see the convergence of three NBTV-related projects, the SD Card-based NBTV recorder/player, the 625-NBTV standards converter and this Line-Interpolation display.

The A-D is the AD7822 I mentioned in the thread "Video to NBTV converter.", I was able to pick some up when I was in the UK last year, only now have I got around to using them!

They work as advertised and do convert an analogue voltage to eight bits in under 500ns, well under in fact. The maximum in the specification is 420ns, this batch seem to average around 380ns. The initial reason for using these was for use in the 625-NBTV converter where speed of this order is required, the venerable CA3306 is getting hard to find as it's been out of production for more than two decades. Other plus-points are that it's an 8-bit device as opposed to 6-bits, it's in current production and stocked by the usual suppliers, and it's under a tenner inc. VAT etc...AND it will work at 5.0V and 3.3V equally well.

Some may be wondering why I haven't used the internal A-D within the PIC? Well, certainly for the 625-NBTV converter they're way too slow but a glance at the short-form specifications for this PIC says, "100ks/sec", but like any other company Microchip are not immune to 'specmanship'. This is under ideal conditions, maximum clock speed, low source impedance, 25°C or less, and so on.. In this application they might just do it, but it is marginal. So I chose to stick with this external A-D and get to know it better.

Thus far I have been able with very simple code to convert a NBTV video signal to digital, store a line in the PICs RAM, delay it 2.5ms (one line) and via the PWM module in the PIC and a reconstruction filer recreate the original waveform delayed one line. Screen-scrapes below...a note on same, the yellow trace is the output of my PC's sound card which does not have a reconstruction filter, hence all the spikes etc. The cyan trace is cleaner due to the reconstruction filter on the output of the PIC, even so it's one I 'borrowed' from another project and isn't quite ideal. The filter also adds its own delay of about 25us.

Currently the sampling is done at 96kHz (240 samples/line) but this will be dropped to 48kHz in time, but 96kHz does make the filters somewhat easier to design. For the 625-NBTV converter I will have to add some external RAM, probably an 8-pin 23K256 (32k x 8-bit).

...the drift towards 3.3V? More and more devices are appearing which do not have a 5V version, and here with the interface to SD Cards which are only 3.3V it makes sense. So for this device and probably the others, 5V is but a memory.

More anon...

Steve A.

P.S. If the filter on the output of a D-A is called a 'Reconstruction Filter', why isn't the filter on the input to an A-D called a 'Deconstruction Filter'?
Attachments
Delay 1.gif
Delay 1.gif (7.61 KiB) Viewed 12976 times
Delay 2.gif
Delay 2.gif (6.23 KiB) Viewed 12976 times
PIC & A-D 1.jpg
PIC & A-D 1.jpg (85.06 KiB) Viewed 12976 times
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby M3DVQ » Wed Apr 18, 2012 3:10 am

Glad to see I'm not the only one mad enough to solder an SD socket to veroboard! :lol:
M3DVQ
Just nod and pretend you understand me
 
Posts: 338
Joined: Sat Feb 10, 2007 10:52 am
Location: Lincolnshire

Postby Steve Anderson » Wed Apr 18, 2012 3:03 pm

M3DVQ wrote:Glad to see I'm not the only one mad enough to solder an SD socket to veroboard! :lol:


They're actually quite easy...once you find the correct user-friendly version. The pin spacing isn't that far off 0.1" and in the example above the Card Detect and Locked switches are the only two that are way off the 0.1" grid. I don't use either of these so it doesn't matter.

In the photo below one of the switch connections is 'behind' the forth pin from the left, hence the large solder blob! The other is on the extreme right.

Steve A.
Attachments
pc143015.jpg
pc143015.jpg (189.9 KiB) Viewed 12943 times
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby M3DVQ » Wed Apr 18, 2012 10:28 pm

Aaaah... I wired all the switches and grounds up on mine iirc :!:

:)
M3DVQ
Just nod and pretend you understand me
 
Posts: 338
Joined: Sat Feb 10, 2007 10:52 am
Location: Lincolnshire

Postby Steve Anderson » Wed Apr 18, 2012 11:07 pm

All grounds/0V etc. are catered for, all the major nine pins. If a card fails to initialize 'cos it ain't there then a prompt to that effect will do. As for the Lock 'Switch', does anyone actually use them or even know they exist? A similar thing to the Write Protect 'switch' on 3½" floppies...

Remember the crappy Write Protect arrangement on 5¼" floppies? A piece of sticky tape if I remember correct! But don't ask me about 8"...that IS before even my time...

Steve A,.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby M3DVQ » Wed Apr 18, 2012 11:38 pm

I use the write protect switch on the SD card in my camera... However that's because it's part of a hack to boot a custom firmware image, not to write protect the card :D
M3DVQ
Just nod and pretend you understand me
 
Posts: 338
Joined: Sat Feb 10, 2007 10:52 am
Location: Lincolnshire

Postby Dave Moll » Fri Apr 20, 2012 5:46 am

At the risk of going off-topic, Steve is quite right about write protect on a 5¼" floppy disc being to cover up the notch shown on the right-hand side.

I'm not sure about the 8" one (I don't currently have a working computer in which to try it), but I assume that the notch shown at the bottom works in the same way.
Attachments
5¼in floppy disc.jpg
(52.12 KiB) Downloaded 210 times
8in floppy disc.jpg
(108.12 KiB) Downloaded 206 times
User avatar
Dave Moll
Anyone have a spare straightjacket?
 
Posts: 460
Joined: Tue Feb 27, 2007 9:11 am

Postby Steve Anderson » Sat Apr 21, 2012 2:02 pm

Dave, thanks for the memories...

More progress. Two boards complete for this display, photos below. As ever this thing is going to be a real hybrid with two ECC91s/6J6s for the deflection amplifiers yet one of the most recent PICs for the number-crunching.

Shown is the low-voltage rectification and regulation. On the same board is the plug-in anti-aliasing filter, the one shown is a six-pole Bessel filter with a cut-off frequency of 17kHz, nicely lower than the sample rate of 96kHz...I've decided not to bother with 48kHz sampling. Being a plug-in arrangement other configurations of filters can be evaluated, potentially including a digital FIR version.

As mentioned before my PC does not have a reconstruction filter on its output which is clearly evident in the waveforms below (Clean A.gif & Ragged A.gif). So this filter is doing double-duty, acting as a reconstruction filter and an anti-aliasing filter at the same time.

Sync-detection and DC restoration is to be done in software rather than a hardware arrangement. Thus far I have only got the sync-detection operational, the DC restoration will come later. (Sync Detect 1.gif).

The grid-drive for the CRT is also done, I just haven't got around to taking a photo yet. Mechanical drawings sent off to metal-basher...I'll just have to be patient with that. High voltage PSU also complete.

More to come...

Steve A.
Attachments
Clean A.gif
Clean A.gif (9.17 KiB) Viewed 12866 times
Ragged A.gif
Ragged A.gif (10.5 KiB) Viewed 12866 times
Sync Detect 1.gif
Sync Detect 1.gif (7.91 KiB) Viewed 12866 times
PSU & Filter 1.jpg
PSU & Filter 1.jpg (291.16 KiB) Viewed 12866 times
Deflection 1.jpg
Deflection 1.jpg (285.18 KiB) Viewed 12866 times
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby Steve Anderson » Fri Apr 27, 2012 5:54 pm

In the process of considering DC restoration performed in software it became apparent that I'll be needing some test signals to evaluate the performance. Traditionally in 525/625 this involves a 'Bounce Test' where the test signal is a number of black frames (say for NBTV 16) followed by an equal amount of full-white frames, repeated without end. This really does test the ability of a DC restorer.

It would seem intuitive that this is the worst case signal, perhaps with the equally difficult change of black to white or white to black part-way through a frame.followed by full frames at either level and then the reverse.

Apart from errant pulses, noise and glitches is this the worst case?

One problem is our lack of control at the LF end of our base-band signal. Whereas broadcasters have/had (it is analogue we're referring to) to adhere to tight specifications. It was up to the receiver manufacturers to ensure their products performed.

If your system is DC-coupled then DC restoration can be forgotten about...but you've got an open-reel recording from the 70s or a cassette from the 80s which you record on your PC via the sound-card to preserve on a permanent basis. That's at least four RC hi-pass filters of generally unknown performance the signal has passed through. No wonder NBTV DC restoration is such a headache!

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby Klaas Robers » Fri Apr 27, 2012 9:35 pm

Steve, I found out that the grey bars test signal, as recorded on NBTV CD number 1, with 8 vertical bars does already a lot. This signal contains a lot of 12.5 Hz and that is already very difficult for taped signals.

To be correct the frequency span should go as far as 2 Hz for -3 dB. There is another effect that you don't like to see: even if your DC restoration, from line to line, is perfect, then still you don't like that the video signal of an even brightness line should be unchanged during the line. That is for black lines as well as for white lines. This effect is called "sag". The sag defines that for NBTV the fall-off should be -3dB at a frequency of 2 Hz.

And of course there should be no phase distortion. But if you manage to record the vertical grey bars such that you can recognise them at play back on you oscilloscope, then you did a great job.

Very difficult to obtain for a magnetic tape.
User avatar
Klaas Robers
"Gomez!", "Oh Morticia."
 
Posts: 1656
Joined: Wed Jan 24, 2007 8:42 pm
Location: Valkenswaard, the Netherlands

Postby Steve Anderson » Sun Apr 29, 2012 4:46 pm

During the course of further pondering regarding how to do sync-detection/extraction and DC-restoration in software it seemed research was required as to how this was performed in the past using hardware.

Scanning through back-issues of the newsletter from today to about the mid-90s revealed that the most common arrangement is based on the sketch below (Restore 1.gif), sometimes referred to as a "Perfect Diode". In essence this inhibits the most negative element in the signal sinking below Vref. This 'sinking' is a result of the combination of C1 and R3. These two components have a time-constant which in the newsletter examples varied between 150ms to well over one second. Sometimes you'll see a transistor used instead of a diode, it makes no difference to the circuits action, it just boosts the op-amps output current to charge C1, whether it is worthwhile depends on the circuitry to the left of C1 (not shown). Whatever, it makes no difference here.

How do these DC-restorers perform? So that I didn't upset anyone I performed some tests on one of my own designs which is based on the same arrangement, the "Eureka" frame-sync extractor (Vol. 35 No. 4). The equivalent combination of C1/R3 yields a time-constant towards the shorter end of around 190ms.

The test signal is a 'Club Standard' NBTV signal comprised of four frames of white followed by four frames of black complete with missing syncs continuously repeated. This DC-coupled signal was then passed through a single CR hi-pass filter with a -3db cut-off of 10Hz to simulate the output of an audio source. Now -3db at 10Hz is not a shabby performance of any audio gear, and here only one hi-pass stage is employed. Two waveforms of the test signal are below, (Blk2Whi 1.gif and Whi2Blk 1.gif) the yellow trace being the TSG output, the cyan being after the hi-pass filter. One shows the black-to-white transition, the other white-to black.

Now I'll be the first to admit this is an extreme waveform, but it is legit, and although unlikely to happen on real progam material, it could and the system should cope with it.

In most cases there's another CR hi-pass filter interposed, some form of buffer amplifier, here is no exception, but I did set it at a very long time-constant of one second, -3db at 0.16Hz.

The results shown in (Wht2Blk 2.gif) are woefully inadequate...which is not surprising. You can twiddle the sync-slice pot nut you end up slicing genuine video and missing the otherwise valid sync pulses. The result for black-to-white is not that bad, but could be better (Blk2Whi 2.gif).

This may have been hinted at in the past where large changes in average picture level (APL) occurred. Not having copies of the Club CDs I can only guess that this is what Peter Smith is referring to in Vol. 26 No. 2, "Sync Separator Improvement". The fact is that this topology generally works, it must do otherwise it would have been binned years ago, and I agree, generally it does work, otherwise I wouldn't have included it in one of my own designs.

OK, this is an extreme signal, but somewhere between this and normal video the system starts to misbehave, just the odd pulse missing could upset things.

With a mechanical monitor and it's inertia a few missing sync pulses are quite likely not to be missed and as it presumably was already in-sync before the event it will pick up the rhythm quickly afterward to the extent that it may not be noticeable.

When digitizing a signal you do need every sync pulse unless clever software is employed which may be beyond the capabilities of a simple PIC and definitely myself too.

At this point I have no fix for the hardware based version but it's been added to my NBTV 'To Do' list.

Comments welcome, but please no flames.

Steve A.

P.S. The rather rough looking waveforms are in part due to the scopes screen resolution which is only 320x240 pixels for the entire display, somewhat less for the black waveform area. In future I'll check the screen resolution before purchase, although this scope is a vast improvement on my old analogue one, this is one area where it's lacking. There are a few others too.
Attachments
Restore 1.gif
Restore 1.gif (2.94 KiB) Viewed 12778 times
Blk2Whi 1.gif
Blk2Whi 1.gif (6.83 KiB) Viewed 12778 times
Whi2Blk 1.gif
Whi2Blk 1.gif (6.29 KiB) Viewed 12778 times
Blk2Whi 2.gif
Blk2Whi 2.gif (7.67 KiB) Viewed 12778 times
Whi2Blk 2.gif
Whi2Blk 2.gif (6.58 KiB) Viewed 12778 times
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby Steve Anderson » Sun Apr 29, 2012 7:56 pm

A few lines of code later and here's the result. The frame sync detect is operational but I have yet to get it into the correct position. That'll be done as per the 'Eureka' method.

This still needs a few tweaks but in principle it appears to work. This is using exactly the same source and CR network as before.

Next, DC restoration...

Steve A.
Attachments
Blk2Whi 3.gif
Blk2Whi 3.gif (6.59 KiB) Viewed 12770 times
Whi2Blk 3.gif
Whi2Blk 3.gif (6.42 KiB) Viewed 12770 times
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby gary » Sun Apr 29, 2012 8:35 pm

Steve, being a natural born contrarian your appeal for "no flames" incites me to do just that, alas having read your dissertation I can only report that it mirrors my own findings associated with the problem of processing "live" NBTV through a sound card into my software.

Once the low frequencies are lost to the extent that there is programme-on-sync there appears to be little one can do except to "fly-wheel" (if possible) and recover once that situation abates.

The one saving grace is that common programme material generally ends up being random enough for such large swings to be relatively unusual.

None-the-less even under those circumstances determining a best-placed sync slice is problematic.

I have thought in the past whether a form of lowpass pre-emphasis and/or an inverse frequency response post-emphasis??? :-/ arrangement might improve things but whether it would improve things enough to warrant the additional complexity is debatable.

But if you can think of anything I can flame you about please let me know... :twisted:

Wikipedia:

Flaming (Internet), the act of posting deliberately hostile messages on the Internet used mainly by a troll.

In Internet slang, a troll is someone who posts inflammatory,[2] extraneous, or off-topic messages in an online community

A contrarian is a person who takes up a position opposed to that of the majority, no matter how unpopular.
gary
 

PreviousNext

Return to Mechanical NBTV

Who is online

Users browsing this forum: No registered users and 27 guests