"Ringing"?

A "new fashioned" televisor, using an Arduino to drive the motor and display.

Moderators: Dave Moll, Andrew Davie, Steve Anderson

Re: "Ringing"?

Postby Andrew Davie » Thu Jun 08, 2017 9:53 pm

gary wrote:That seems to have both syncs (albeit not negative going but that makes no difference) and the ringing bars:

Image1.jpg


Did you give me the right file?

Or maybe it just isn't very obvious when viewed via a disk.



It's the right file. Let's agree on some definitions - I do not consider the black horizontal line a "synch" - its an arbitrary inter-frame gap that can be filled with any data at all. It's there because the software I use to convert video puts synch pulses and that gap in that area. In my file format, this gap is not blacker than black; it's just black, the same black as black in the "picture" area. There are no negative values - which is what I call "synch pulses". My conversion process consists of determining the "height" or "depth" of synch pulses from black, then DC-shifting so that the "shelf" is at 0. Then I remove all negative values - effectively converting the synch pulses to just plain old black. Then I determine the maximum value in the signal and DC-shift by half of that (subtract). Then I amplify by the maximum amount possible without clipping. This tends to put the "black" right down around 0 and the brightest around 255. I might DC-adjust the black to exactly zero if I'm so inclined, but not really necessary.

I agree, there are visible ringing lines in the Doctor Who video - so it's just not obvious when seen on a disc. Me bad. In my defence, I have no viewer and no way to show a single-frame except by capturing with a camera watching my televisor play the file

However, not going to let the general issue go without understanding it. Let's say I took a 2D frame of arbitrary size, but let's say 480 high by 320 wide. If I resample that frame with a paint program and convert to 8-bit greyscale, I am *not* going to see any ringing. Let's say I use bicubic resampling - it really doesn't matter; there are a number of choices. Now I have a 48 high by 32 wide image, with no ringing or artefacting like we are discussing. Then if I take those 1536 pixels and put them in the right order (bottom right scanning upwards and leftwards) then I have the data suitable for displaying on my televisor. Put a few thousand of those blocks together and I have a movie. I think the transition from the black horizontal "frame divider" might be blurry, perhaps - arguable - but we won't have the ringing effects. I don't understand how it can be any other way. What I'm trying to say is that I think it's perfectly possible to have a good looking picture without the ringing effects. I could, for example, take a data stream WITH the ringing, and manually adjust the pixel values so that the visible stripes weren't there and the pixels were the "correct" values. It seems straightforward to me that this is possible.

The discussion to date has been interesting to me, and I think/hope I understand a lot of what's been discussed. I do understand that there are tradeoffs with various filters, but I am still stuck in the following "rut"...

That it's not valid to use 2D image-processing techniques to get an optimal picture with no ringing. Optimal being a personal choice, but essentially "the best looking picture". Or, more to the point that there isn't a difference between processing a stream of data as audio (1D) and as video frames (2d). I think I can/would get a better picture with the latter. If I could replace an arbitrary "bad looking" pixel manually and have it look good (i.e., no ringing) then it must be possible to do it algorithmically with an appropriate filter. I'm still stuck on this sum of infinite sine waves. Yes I understand that a picture is essentially represented by a sum of sine waves, with each pixel being the sum at that point in space/time. However, once you get past that and consider a picture JUST an array of pixel values, then you can have whatever you WANT as those pixel values. And that can be the best resampled/dithered image you care to make. It will not have ringing.

To prove to myself, I may very well have to write a converter to take a video frame, process it with (say) bicubic or similar, convert to a 48 x32 and then to a NBTV8 stream. Kind of a pain, but I need a tool to do this anyway.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: "Ringing"?

Postby gary » Fri Jun 09, 2017 12:25 am

Andrew Davie wrote:I do not consider the black horizontal line a "synch"

That's fine, I would, a sync certainly doesn't have to be negative, in fact it can be whiter than white, but that's another thing, the point is, because it is a black area it has the same affect on the picture as a true sync would when filtered, that's all, the point being is that it is a static area of black and the picture adjacent t it can be any value above it up to white


Andrew Davie wrote:its an arbitrary inter-frame gap that can be filled with any data at all.


Yes I understand that, but a filter running over the entire signal just sees it as a value like all the others and processes it accordingly.
I didn't mean to infer a sync in itself will cause ringing if that's what you thought, it's the fact that it is black (it could just as easily be white) and the picture value next to it can be anything in the dynamic range of the signal and thus you have a transient with frequencies exceeding the Nyquist limit.

Andrew Davie wrote:This tends to put the "black" right down around 0 and the brightest around 255.

Yes, that's the issue, if the signal goes from 0 to 255 that will ring.

Andrew Davie wrote:I agree, there are visible ringing lines in the Doctor Who video - so it's just not obvious when seen on a disc.

No, I realised that, I just wanted to point out that it does have ringing in it in case it wasn't the demonstration video intended.

Andrew Davie wrote:However, not going to let the general issue go without understanding it. Let's say I took a 2D frame of arbitrary size, but let's say 480 high by 320 wide. If I resample that frame with a paint program and convert to 8-bit greyscale, I am *not* going to see any ringing.


Well yes, you could, depending on how it is filtered, keep in mind when doing image processing you effectively AREN'T band limited so you can have nice crisp transitions from black to white (for example), but when that image is transmitted over a bandlimited network (which includes the Nipkow disk itself by the way) those high frequencies must be removed by filtering and if that filter is a brickwall filter you will have ringing.

Andrew Davie wrote:Let's say I use bicubic resampling - it really doesn't matter; there are a number of choices.

true, in fact they are all doing the same thing convolving a kernel with the image - the shape of the kernel defines what "agorithm" it is - or maybe that's vice versa.

Andrew Davie wrote:Now I have a 48 high by 32 wide image, with no ringing or artefacting like we are discussing.


Correct, but you either have a picture that is severely curtailed in detail, or you have a signal whose bandwidth exceeds the bandwidth of the network. (By network i mean all the bits between the signal origin and the display). OR, you could filter it in such a way that you preserve the detail (the frequencies) up to the Nyquist limit and accept a little ringing as the consequence.

Andrew Davie wrote:I think the transition from the black horizontal "frame divider" might be blurry, perhaps - arguable - but we won't have the ringing effects

There we part ways - it must, by the laws of physics be blurry OR ringing OR somewhere in between. it is NOT arguable.
Andrew Davie wrote:I don't understand how it can be any other way.

Well, I and two others have tried to explain why it is the way it is, we aren't making it up, if I am I have wasted 6 years at University, and another 4 obtaining my Electronics and Communications Certificate.

Andrew Davie wrote:What I'm trying to say is that I think it's perfectly possible to have a good looking picture without the ringing effects.

You can certainly have a picture without ringing effects (or at least not noticeably) - whether it is a good looking picture or not, is, of course, subjective. Suffice it to say, however, that somewhere between ringing and loss of detail there is probably a "sweet spot" that would keep most people happy, and who knows? maybe one day you will be able to implement aperture correction on the Arduino (which really just boosts the frequencies diminished by your resampling algorithm).

Andrew Davie wrote:I could, for example, take a data stream WITH the ringing, and manually adjust the pixel values so that the visible stripes weren't there and the pixels were the "correct" values. It seems straightforward to me that this is possible.


Certainly you could do some signal processing of that type but it doesn't *seem* to be straightforward to me as the amount of ringing is highly dependent on the picture content (which is obviously changing with time), in addition you would need some knowledge of what was originally in the picture at that location, but in principle it is plausible.

If you look at the CCNC format that Klaas and Vic Brown developed you will see an example of a trade off between detail and ringing and I haven't heard too many complaints, although there HAVE been some.

Andrew Davie wrote:That it's not valid to use 2D image-processing techniques to get an optimal picture with no ringing. Optimal being a personal choice, but essentially "the best looking picture".


No, no one has said that, we have merely pointed out that it's a trade off between two complementary properties - if you have optimal precision in one property you have sub optimal precision in the other.

Andrew Davie wrote:Or, more to the point that there isn't a difference between processing a stream of data as audio (1D) and as video frames (2d).

In terms of the process of filtering there is definitely no difference the mathematics behind it is identical besides the number of dimensions, but the requirements for audio and video are certainly not the same, the ear is tolerant of ringing and phase distortion, but the eyes are not, but the approach to the signal processing is the same mathematically.

Andrew Davie wrote: I think I can/would get a better picture with the latter. If I could replace an arbitrary "bad looking" pixel manually and have it look good (i.e., no ringing) then it must be possible to do it algorithmically with an appropriate filter. I'm still stuck on this sum of infinite sine waves. Yes I understand that a picture is essentially represented by a sum of sine waves, with each pixel being the sum at that point in space/time. However, once you get past that and consider a picture JUST an array of pixel values, then you can have whatever you WANT as those pixel values. And that can be the best resampled/dithered image you care to make. It will not have ringing.


Well the same goes for audio, it's just a list of sample values and you can change them how you like but put a zero value next to a maximum value and what do you hear? (hint it's a good simulation of a poorly looked after record).

The point is, you CAN do some things, but some things you can't - one things is certain, you can't get around the physics of it, it's pretty well understood now.

Andrew Davie wrote:To prove to myself, I may very well have to write a converter to take a video frame, process it with (say) bicubic or similar, convert to a 48 x32 and then to a NBTV8 stream. Kind of a pain, but I need a tool to do this anyway.


Well that's exactly what I am doing when Video2NBTV generates your format (yes I seem to recall saying I used nearest neighbour but I was wrong I generally use bicubic or bilinear, but in this case because it was a quick cut and paste job it ended up being bicubic).

I use the GDIPlus library.

People are writing new filters all the time that do a specific job for a specific function like this so maybe you will come up with something new - who knows?

There's actually an argument for NOT using 2D methods for NBTV because of the line structure across the disk - it makes more sense to put more of the available bandwidth along the line than across it.

Anyway it's late for me and I am not going to bother to proof read what I have written so i hope there are not too many glaring errors.

PPS: If you haven't had a look at the two links I gave you I thoroughly recommend that you do, it is a fairly good explanation of it all with some nice diagrams that are helpful.
gary
 

Previous

Return to Andrew Davie's Arduino Televisor

Who is online

Users browsing this forum: No registered users and 1 guest

cron