FPGARelated.com
Forums

Video scaler for Spartan 3E?

Started by Ken Soon May 2, 2007
Yeh Kolja, I will definitely start with something simple first.
Since I haven't begin to understand the concept of coefficient and 
upsampling.

Ah thanks Paul, for taking out the time to explain some concept. (trying to 
digest all of them though >_<)
Well, interpolation is basically creating more datapoints between the 
original fixed datapoints right?
Linear interpolation ar. I hope i can progress not from linear interpolation 
as it seems that the results i will be getting should be very poor.
But I will have to see how far i will be able to go from linear 
interpolation. hope to be able to scale some video input from a vcd players.
Though i will have to worry about the I/O of the boards and other hardware 
related issues.
Will check out the DSP books that you recommended too! :)

"Paul" <pauljbennett@gmail.com> wrote in message 
news:1178285538.481886.251680@l77g2000hsb.googlegroups.com...
> OK... think time domain signal... say your signal x = [1 10 5 3] and > you want to upsample this to twice the sampling frequency.... if you > did a simple linear interpolation you'd get x_upsampled = [1 5.5 10 > 7.5 5 4 3 ?] that last datapoint{?} is kinda arbitrary, presumably > you'd just set it to 3. However, signals are defined as a sum of > sinusoids, and generally they fit that model fairly well - when you > have something that doesn't, it takes more sinusoids to fit it.. thats > the general theory behind a fourier transform, right? So linear > interpolation isn't really you're best solution. You can > mathematically prove that if you had an infinitely long signal, and an > infinitely perfect low pass filter, the "perfect" upsampling is done > by inserting zeros x_zero = [1 0 10 0 5 0 3 0], and low pass > fitlering it. Obviously, neither the infinite sequence or the perfect > LPF is realistic. If you do the math (or plug it into matlab), the > FFT of x (shfited to place zero frequency in the center), X=[-7 -4+7j > 19 -4-7j] If you take the FFT of x_zero, X_ZERO = [19 -4-7j -7 > -4+7j 19 -4-7j -7 -4+7j] Note, this is simply X repeated. > So how do you get back your correct frequency spectrum? An ideal LPF > returns X_UPSAMPLE=[0 0 -7 -4+7j 19 -4-7j 0 0]. Now note > this... if you use matlab and take the inverse FFT of this (the > shifted version of this actually) you get [1.0000 5.8107 > 10.0000 8.6391 5.0000 3.6893 3.0000 0.8609] > Actually... you get this divided by 2 (you need to multiply by your > upsampling facor, that comes out in the math) with a risidual > imaginary part due to the fact that it's an even length sequence, so > you just look at the real part. Point being however, note that the > interpolated values are NOT what you get using straight linear > interpolation. this is because this method takes into account the > curvature of the rest of the sequence and stuff. > > That being said.... for this project, I would imagine that simple > linear interpolation is plenty adequate! A 2 dimensional version of > this example above would be quite tricky and take a lot of processing > power. But read the chapter in your DSP book on upsampling - it will > cover all this :-) Actually, not positive, but the stock, every > college in the world uses, oppenheim & shaeffer signals & systems book > MIGHT even go into it in one of the later chapters. > > >> > How accurate do your interpolations need to be? Think basic 1- >> > dimensional DSP.. how do you upsample a signal? insert zeros between >> > samples and LPF, right? Or do the same thing in the F-domain by zero >> > padding the ends of the FFT and inverse-FFT'ing. Either of these >> > methods in 2 dimensions is going to be a lot of computation and a lot >> > of taking stuff in and out of memory in different orders. DDR >> > memories like you to take stuff out in the same order you put them >> > in... they slow down big time when you try to jump around.. So if you >> > do this, you will need to some up with some clever methods of read out >> > pieces from DDR in the incorrect order, and then re-reading from a >> > local, smaller, block ram in the order you actually want. This will >> > take careful planning and a lot of simulation, even an experienced >> > designer would have a tricky time with this and probably get it wrong >> > in simulation the first shot. >> >> Woah, ok I'm totally lost in here. But no problem, I will take note of >> these >> points and consult my profs or someone >
I definately was not saying that linear interpolation results will be
"very" poor...  in fact... I'd bet some commercial scalers do it that
way....  At any rate... I'd be cautious of shooting for the stars -
you're better off with an obtainable project...  Here's some
considerations...

640x480 = 307200points... which, if you're talking about RGB input,
means 307200 points of Red, Green & Blue each....   307200points x
60fps = 18.4MSample/s per color... lets assume you're processing the
three colors independently... I know the Spartan3 development boards
have 50MHz clocks on them.  I probably wouldn't try to push a Spartan
design much past 100MHz unless it was a VERY empty part (the higher
the utilization the more difficult it is to place and route it at a
higher speed).  Now, assuming 100MHz, processing 3 colors
independently, that basically means you can do 5 "operations" in a
sample time... if you want to double your output rate (i.e. - scale up
to 1280x960) that may be as low as 2.5 operations, depending what the
operation is and if it needs to be done at the higher or lower rate.
In short what that gets down to is that anymore operations than that
must be done in different "blocks" of the design (i.e. they use more
resources).  And that is going to quickly run you up against the limit
in terms of the number of multipliers in the spartan probably.

Now those are all TOTALLY ballpark, off the cuff numbers.  My gut
instinct would be that linear interpolation will be NO problem at all
in the spartan at 100MHz, I'd bet you could even do it at those
resolutions at 50MHz.  But my other gut instinct there is also that
any real significant amount of processing beyond linear interpolation
is going to get really tight, really quick.  I think as a student
you're better off not trying to attempt a really tightly packed
design.  The reason I say that is that to get a really tight design to
place and route correctly and meet timing you need to really know all
the ins and outs of the software tools (the Xilinx software).  You
have to set all sorts of settings, possibly go in an manually place
critical parts of the design, etc... etc....    And that's REALLY not
what you want to be spending your time on as a student.  Your purpose
is to learn about the logical part of FPGA design, and that's going to
be tricky enough on its own - I really wouldnt recommend working
yourself into that tight a position... You're really going to have a
lot on your plate with this design as it is.

At any rate.. that's my advice..   anyone else is welcome to
disagree...




On May 11, 1:14 am, "Ken Soon" <c...@xilinx.com> wrote:
> Yeh Kolja, I will definitely start with something simple first. > Since I haven't begin to understand the concept of coefficient and > upsampling. > > Ah thanks Paul, for taking out the time to explain some concept. (trying to > digest all of them though >_<) > Well, interpolation is basically creating more datapoints between the > original fixed datapoints right? > Linear interpolation ar. I hope i can progress not from linear interpolation > as it seems that the results i will be getting should be very poor. > But I will have to see how far i will be able to go from linear > interpolation. hope to be able to scale some video input from a vcd players. > Though i will have to worry about the I/O of the boards and other hardware > related issues. > Will check out the DSP books that you recommended too! :) > > "Paul" <pauljbenn...@gmail.com> wrote in message > > news:1178285538.481886.251680@l77g2000hsb.googlegroups.com... > > > > > OK... think time domain signal... say your signal x = [1 10 5 3] and > > you want to upsample this to twice the sampling frequency.... if you > > did a simple linear interpolation you'd get x_upsampled = [1 5.5 10 > > 7.5 5 4 3 ?] that last datapoint{?} is kinda arbitrary, presumably > > you'd just set it to 3. However, signals are defined as a sum of > > sinusoids, and generally they fit that model fairly well - when you > > have something that doesn't, it takes more sinusoids to fit it.. thats > > the general theory behind a fourier transform, right? So linear > > interpolation isn't really you're best solution. You can > > mathematically prove that if you had an infinitely long signal, and an > > infinitely perfect low pass filter, the "perfect" upsampling is done > > by inserting zeros x_zero = [1 0 10 0 5 0 3 0], and low pass > > fitlering it. Obviously, neither the infinite sequence or the perfect > > LPF is realistic. If you do the math (or plug it into matlab), the > > FFT of x (shfited to place zero frequency in the center), X=[-7 -4+7j > > 19 -4-7j] If you take the FFT of x_zero, X_ZERO = [19 -4-7j -7 > > -4+7j 19 -4-7j -7 -4+7j] Note, this is simply X repeated. > > So how do you get back your correct frequency spectrum? An ideal LPF > > returns X_UPSAMPLE=[0 0 -7 -4+7j 19 -4-7j 0 0]. Now note > > this... if you use matlab and take the inverse FFT of this (the > > shifted version of this actually) you get [1.0000 5.8107 > > 10.0000 8.6391 5.0000 3.6893 3.0000 0.8609] > > Actually... you get this divided by 2 (you need to multiply by your > > upsampling facor, that comes out in the math) with a risidual > > imaginary part due to the fact that it's an even length sequence, so > > you just look at the real part. Point being however, note that the > > interpolated values are NOT what you get using straight linear > > interpolation. this is because this method takes into account the > > curvature of the rest of the sequence and stuff. > > > That being said.... for this project, I would imagine that simple > > linear interpolation is plenty adequate! A 2 dimensional version of > > this example above would be quite tricky and take a lot of processing > > power. But read the chapter in your DSP book on upsampling - it will > > cover all this :-) Actually, not positive, but the stock, every > > college in the world uses, oppenheim & shaeffer signals & systems book > > MIGHT even go into it in one of the later chapters. > > >> > How accurate do your interpolations need to be? Think basic 1- > >> > dimensional DSP.. how do you upsample a signal? insert zeros between > >> > samples and LPF, right? Or do the same thing in the F-domain by zero > >> > padding the ends of the FFT and inverse-FFT'ing. Either of these > >> > methods in 2 dimensions is going to be a lot of computation and a lot > >> > of taking stuff in and out of memory in different orders. DDR > >> > memories like you to take stuff out in the same order you put them > >> > in... they slow down big time when you try to jump around.. So if you > >> > do this, you will need to some up with some clever methods of read out > >> > pieces from DDR in the incorrect order, and then re-reading from a > >> > local, smaller, block ram in the order you actually want. This will > >> > take careful planning and a lot of simulation, even an experienced > >> > designer would have a tricky time with this and probably get it wrong > >> > in simulation the first shot. > > >> Woah, ok I'm totally lost in here. But no problem, I will take note of > >> these > >> points and consult my profs or someone- Hide quoted text - > > - Show quoted text -
ok... I guess i better start small anyway since I really new to this.
Well I'm going to take a DSP module in school soon so it will definitely 
help me along.

(the higher the utilization the more difficult it is to place and route it 
at a higher speed).
Yes so true. I kept getting timing constraint problem for my current video 
scaler project.
Well though i learnt that timing delay could be reduced by adding output 
registers to fit the timing constraint.

Oh yah consulted my colleague who said that my video scaler (polyphase 
actually, did i mention it before?) is good in a sense that it consumes 
lesser resources.
Well I could be working on this project further on, though i will still need 
to understand some of the theory in video scaling as well.

Well really thank alot for the time and effort to advise me and give me some 
direction.

Oh by the way, can I ask if that once i kind of burn the chip and little 
smoke came off, is the chip spoilt? The board's power indicators are fine 
and I programmed successfully into the chip through a parallel IV cable but 
nothing was displayed though. No self-test or whatsoever is available 
though...so scared...

"Paul" <pauljbennett@gmail.com> wrote in message
news:1178889638.696406.114280@h2g2000hsg.googlegroups.com...
>I definately was not saying that linear interpolation results will be > "very" poor... in fact... I'd bet some commercial scalers do it that > way.... At any rate... I'd be cautious of shooting for the stars - > you're better off with an obtainable project... Here's some > considerations... > > 640x480 = 307200points... which, if you're talking about RGB input, > means 307200 points of Red, Green & Blue each.... 307200points x > 60fps = 18.4MSample/s per color... lets assume you're processing the > three colors independently... I know the Spartan3 development boards > have 50MHz clocks on them. I probably wouldn't try to push a Spartan > design much past 100MHz unless it was a VERY empty part (the higher > the utilization the more difficult it is to place and route it at a > higher speed). Now, assuming 100MHz, processing 3 colors > independently, that basically means you can do 5 "operations" in a > sample time... if you want to double your output rate (i.e. - scale up > to 1280x960) that may be as low as 2.5 operations, depending what the > operation is and if it needs to be done at the higher or lower rate. > In short what that gets down to is that anymore operations than that > must be done in different "blocks" of the design (i.e. they use more > resources). And that is going to quickly run you up against the limit > in terms of the number of multipliers in the spartan probably. > > Now those are all TOTALLY ballpark, off the cuff numbers. My gut > instinct would be that linear interpolation will be NO problem at all > in the spartan at 100MHz, I'd bet you could even do it at those > resolutions at 50MHz. But my other gut instinct there is also that > any real significant amount of processing beyond linear interpolation > is going to get really tight, really quick. I think as a student > you're better off not trying to attempt a really tightly packed > design. The reason I say that is that to get a really tight design to > place and route correctly and meet timing you need to really know all > the ins and outs of the software tools (the Xilinx software). You > have to set all sorts of settings, possibly go in an manually place > critical parts of the design, etc... etc.... And that's REALLY not > what you want to be spending your time on as a student. Your purpose > is to learn about the logical part of FPGA design, and that's going to > be tricky enough on its own - I really wouldnt recommend working > yourself into that tight a position... You're really going to have a > lot on your plate with this design as it is. > > At any rate.. that's my advice.. anyone else is welcome to > disagree... > > > > > On May 11, 1:14 am, "Ken Soon" <c...@xilinx.com> wrote: >> Yeh Kolja, I will definitely start with something simple first. >> Since I haven't begin to understand the concept of coefficient and >> upsampling. >> >> Ah thanks Paul, for taking out the time to explain some concept. (trying >> to >> digest all of them though >_<) >> Well, interpolation is basically creating more datapoints between the >> original fixed datapoints right? >> Linear interpolation ar. I hope i can progress not from linear >> interpolation >> as it seems that the results i will be getting should be very poor. >> But I will have to see how far i will be able to go from linear >> interpolation. hope to be able to scale some video input from a vcd >> players. >> Though i will have to worry about the I/O of the boards and other >> hardware >> related issues. >> Will check out the DSP books that you recommended too! :) >> >> "Paul" <pauljbenn...@gmail.com> wrote in message >> >> news:1178285538.481886.251680@l77g2000hsb.googlegroups.com... >> >> >> >> > OK... think time domain signal... say your signal x = [1 10 5 3] and >> > you want to upsample this to twice the sampling frequency.... if you >> > did a simple linear interpolation you'd get x_upsampled = [1 5.5 10 >> > 7.5 5 4 3 ?] that last datapoint{?} is kinda arbitrary, presumably >> > you'd just set it to 3. However, signals are defined as a sum of >> > sinusoids, and generally they fit that model fairly well - when you >> > have something that doesn't, it takes more sinusoids to fit it.. thats >> > the general theory behind a fourier transform, right? So linear >> > interpolation isn't really you're best solution. You can >> > mathematically prove that if you had an infinitely long signal, and an >> > infinitely perfect low pass filter, the "perfect" upsampling is done >> > by inserting zeros x_zero = [1 0 10 0 5 0 3 0], and low pass >> > fitlering it. Obviously, neither the infinite sequence or the perfect >> > LPF is realistic. If you do the math (or plug it into matlab), the >> > FFT of x (shfited to place zero frequency in the center), X=[-7 -4+7j >> > 19 -4-7j] If you take the FFT of x_zero, X_ZERO = [19 -4-7j -7 >> > -4+7j 19 -4-7j -7 -4+7j] Note, this is simply X repeated. >> > So how do you get back your correct frequency spectrum? An ideal LPF >> > returns X_UPSAMPLE=[0 0 -7 -4+7j 19 -4-7j 0 0]. Now note >> > this... if you use matlab and take the inverse FFT of this (the >> > shifted version of this actually) you get [1.0000 5.8107 >> > 10.0000 8.6391 5.0000 3.6893 3.0000 0.8609] >> > Actually... you get this divided by 2 (you need to multiply by your >> > upsampling facor, that comes out in the math) with a risidual >> > imaginary part due to the fact that it's an even length sequence, so >> > you just look at the real part. Point being however, note that the >> > interpolated values are NOT what you get using straight linear >> > interpolation. this is because this method takes into account the >> > curvature of the rest of the sequence and stuff. >> >> > That being said.... for this project, I would imagine that simple >> > linear interpolation is plenty adequate! A 2 dimensional version of >> > this example above would be quite tricky and take a lot of processing >> > power. But read the chapter in your DSP book on upsampling - it will >> > cover all this :-) Actually, not positive, but the stock, every >> > college in the world uses, oppenheim & shaeffer signals & systems book >> > MIGHT even go into it in one of the later chapters. >> >> >> > How accurate do your interpolations need to be? Think basic 1- >> >> > dimensional DSP.. how do you upsample a signal? insert zeros >> >> > between >> >> > samples and LPF, right? Or do the same thing in the F-domain by >> >> > zero >> >> > padding the ends of the FFT and inverse-FFT'ing. Either of these >> >> > methods in 2 dimensions is going to be a lot of computation and a >> >> > lot >> >> > of taking stuff in and out of memory in different orders. DDR >> >> > memories like you to take stuff out in the same order you put them >> >> > in... they slow down big time when you try to jump around.. So if >> >> > you >> >> > do this, you will need to some up with some clever methods of read >> >> > out >> >> > pieces from DDR in the incorrect order, and then re-reading from a >> >> > local, smaller, block ram in the order you actually want. This will >> >> > take careful planning and a lot of simulation, even an experienced >> >> > designer would have a tricky time with this and probably get it >> >> > wrong >> >> > in simulation the first shot. >> >> >> Woah, ok I'm totally lost in here. But no problem, I will take note of >> >> these >> >> points and consult my profs or someone- Hide quoted text - >> >> - Show quoted text - > >
On 16 Mai, 11:10, "Ken Soon" <c...@xilinx.com> wrote:
> ok... I guess i better start small anyway since I really new to this. > Well I'm going to take a DSP module in school soon so it will definitely > help me along.
[]
> Oh by the way, can I ask if that once i kind of burn the chip and little > smoke came off, is the chip spoilt? The board's power indicators are fine > and I programmed successfully into the chip through a parallel IV cable but > nothing was displayed though. No self-test or whatsoever is available > though...so scared... > > "Paul" <pauljbenn...@gmail.com> wrote in message > > news:1178889638.696406.114280@h2g2000hsg.googlegroups.com...
yes, smoke is rather bad usually :( when really visible smoke comes, its usually really some dead things on board already, possible plastic housing cracked or some trace burned. sometimes before smoke comes you can feel with the nose, that something smells like hot, in that case the damage may be not fatal. real smoke is usually fatal. the only hope that the damage is reversible is if there was some PCB trace burned (and all chips are ok), but the PCB trace burn doesnt make smoke, only some bad smell and sometimes visible light for short time. oh well depend on PCB and power supply, I guess PCB tracks can make smoke also.. as soon as something burns, better take immediate visual and smell observation, to see what burned, if PCB looks burnt, or if some IC has plastic cracked on top (reverse volcano where waporized silicium comes out).. Antti http://code.google.com/p/s3astarter/
Everyone knows:

The smoke is what makes the part work.

If you let the smoke out, the part doesn't work anymore.

QED

DO NOT let the smoke out.

You can not put the smoke back in.

Austin
austin wrote:
> DO NOT let the smoke out. > You can not put the smoke back in.
Yes, it's really difficult to get the smoke into a chip. Putting the smoke in at the factory requires a a fab costing upwards of a billion dollars!
Eric,

Yes, to get the right amount of smoke into each transistor is incredibly
difficult!  With 65nm, the entire area of a FET is less than one square
micron squared, so in a chip that is 10mm X 10mm (100 square mm), there
are potentially a billion or more devices!

Each device requires just the right amount, color, and smell of smoke.

So, releasing all the smoke at once, well, they blew it!

Austin
Oh dear smoke is bad huh...
Hmm it is the chip that burned, on the outer casing.
I cant really see any hole on the chip so I kind of hope (hope) that 
everything is fine and that only because it got too hot for the casing that 
it burnt and gave off smoke.
well I could program successfully into using IMpact though...right?



"Antti" <Antti.Lukats@googlemail.com> wrote in message 
news:1179307626.982562.103320@n59g2000hsh.googlegroups.com...
> On 16 Mai, 11:10, "Ken Soon" <c...@xilinx.com> wrote: >> ok... I guess i better start small anyway since I really new to this. >> Well I'm going to take a DSP module in school soon so it will definitely >> help me along. > [] >> Oh by the way, can I ask if that once i kind of burn the chip and little >> smoke came off, is the chip spoilt? The board's power indicators are fine >> and I programmed successfully into the chip through a parallel IV cable >> but >> nothing was displayed though. No self-test or whatsoever is available >> though...so scared... >> >> "Paul" <pauljbenn...@gmail.com> wrote in message >> >> news:1178889638.696406.114280@h2g2000hsg.googlegroups.com... > > yes, smoke is rather bad usually :( > > when really visible smoke comes, its usually really some dead things > on board already, possible plastic housing cracked or some trace > burned. > sometimes before smoke comes you can feel with the nose, that > something smells like hot, in that case the damage may be not fatal. > real smoke is usually fatal. > > the only hope that the damage is reversible is if there was some PCB > trace burned (and all chips are ok), but the PCB trace burn doesnt > make smoke, only some bad smell and sometimes visible light for short > time. oh well depend on PCB and power supply, I guess PCB tracks can > make smoke also.. > > as soon as something burns, better take immediate visual and smell > observation, to see what burned, if PCB looks burnt, or if some IC has > plastic cracked on top (reverse volcano where waporized silicium comes > out).. > > Antti > http://code.google.com/p/s3astarter/ >
austin wrote:
> Yes, to get the right amount of smoke into each transistor is incredibly > difficult!
When discussing the way semiconductors *really* work (magic smoke) with friends years ago, the question arose: What is the difference between a 3.3V 1A regulator and a 3.3V 2A regulator? Almost everyone guessed that it was how much smoke is inside the regulator, but that is not correct.
Ken,

Seriously:  any evidence of smoke or damage to the package, and it is
all over.  It is dead.  We call it "electrical over-stress" which is a
polite way of saying "you blew its brains out."

Austin