Welcome to the Parallax Discussion Forums, sign-up to participate.

- 101.5K All Categories
- 812 Announcements
- 49 Propeller Code
- 21 PASM2/Spin2 (P2)
- 4 PASM/Spin (P1)
- 13 BASIC (for Propeller)
- 61 Forth
- 10 C/C++
- 2.8K Propeller 2
- 27.6K Propeller 1
- 18.9K BASIC Stamp
- 9 micro:bit
- 21.1K General Discussion
- 2K Learn with BlocklyProp
- 8.2K Robotics
- 124 Customer Projects
- 3.3K Accessories

## Comments

1,803It would save some logic if the Hann window had identical ramps to the second Tukey window. I've always assumed that's how a Hann would be done. In fact, I think it should be possible to have one set of taps, for the long Tukey window, with shift register shortcuts for the other two. The following shows how similar the two Tukeys are:

1,80313,685That's right.

16 bits are dedicated to the trigger mechanism. There could be a mode without trigger that is highest resolution. What we have now with the 70 bit filter is pretty amazing. I will post pictures shortly.

1,80313,685We need extra bits to detect edges now. That's why it's longer.

13,685In these pictures, you are looking at the apex of a sine wave being digitized and played back on a DAC at 8x amplitude, so that the individual steps can be clearly seen. The longer the filter is, the lower its passband is, making it quieter, but not good for higher frequencies.

Here is the 70-tap Tukey filter:

Here is the 47-tap Tukey filter:

Here is the 30-tap Hann filter:

10,222Hz, Khz, Mhz?

13,685These filters slow down edges. In the 70-tap filter (which is actually more like a 68-tap filter, but needs extra bits for edge detection), 68 contiguous 1's must go into the filter before it reaches its max output of 255. Then, 68 contiguous 0's must go in before it reaches its internal 0, though it output 0 three clocks earlier. Rounding could lift things a little bit, but is maybe of no real value.

3,78913,685With a 7/8th reduction in the ADC's integrator capacitance, it will pass higher frequencies much better.

I was reading that to digitize baseband video, you need to sample at 13.5MHz. So, if you were to run at 216MHz you could have 16 clocks per sample in which an 8-bit-quality Sinc3 conversion could be performed.

With the ADC change, that should be viable. This will all be in the next silicon.

1,328Any chance it could be extended to 20 clocks per sample, or it would mess with the filterings?

With sysclk@ 270 MHz and 20 clocks per sample, it would enable almost direct coupling of resulting data to HDMI.

Only a thought...

3,789It sounds pretty good Chip. I hope it all fits in the next rev. Cheers!

Roger.

13,685Sure. 20 clocks per sample would be better. You can use whatever decimation rate you want. Then, there's the need to use some Goertzel analysis on the chroma signal and then do some colorspace conversion to RGB.

4,4367/8 reduction? The figures I think I've seen you post were 3.5 ~ 6.5 MHz current bandwidth. But that'd imply you only needed to halve or quarter the capacitor

10,222Boy, that 70 tap looks perty

2,995Some of Chip's comments seem to involve changing the pad stuff and not just verilog? Or an I misunderstanding?

12,17913,685374You still did not fix the issue of differentiating the input data. While the BASIC program shows 12 taps, it actually uses 24 taps since it uses tn and (tn)+1. It's not actually a bad idea to integrate 3 times if the filter was designed for cubic curves. As it is now, one of the integrators is just undoing the differentiation that was inadvertently added. Surely the code below would be much cheaper to implement.

374We have to assume that there are zeros before and after the values shown. So using a derivative of the filter requires a few more bits in the shift register, but if done properly we come out way ahead because there will only be a handful of terms to sum.

It's rather inconvenient for me that the Matlab "diff" function does not assume that anything exists beyond the array boundaries, so the output gets shorter with each differentiation.

18,037And it's all theory and a little testing on the FPGA with external ADC which is not like the real P2-ES. No testing on the real P2-ES as far as I can tell.

12,179I think Christmas is tying people up. I'll be offline soon enough. Testing with P2D2 and ES boards will have to wait till January.

12,179AD7400 clock generator is not particularly stable. With Prop2 recording it varies about 150 ppm wrt the FPGA crystal. The scope is showing worse over shorter intervals.

EDIT: Prop2 is, agreeing with scope, up to 240 ppm wobble on repeated 0.1 second recordings. Compared to earlier 0.4 s recordings.

13,685Wow! This is way better!!!

I wish I knew how to think about math more easily, because this should have occurred to me, too. I remember thinking it was weird that I needed to run that first integrator. There are so many neat things to learn about.

Anyway, this is going to save a lot of logic! Thanks for pointing this out.

1,803Hann/Tukey is a cosine-squared function. Just rename new 12-tap delta to inta and all the program outputs will be the same. There is still shift register skipping for smaller windows to try.

13,685Now we'll see what kind of logic reduction this yields.

It's just amazing that so little math can compute the area under the filter curve on every clock. I wouldn't have thought this was possible. It's the miracle of calculus. Makes me wonder how many other things could be tackled like this. Seems like some live Goertzel could be done.

1,803delta = dy

inta = y

intb = inty = ∫ydt

13,685We could even go a level deeper and define the filter by only six points:

(1) initially from Y=0, begin upwards acceleration (+1)

(2) at the inflection point of the filter rise, begin upwards deceleration (-2)

(3) at the start of the plateau when delta is now zero, cancel deceleration (+1)

(4) at the end of the plateau, begin downwards acceleration (-1)

(5) at the inflection point of the filter fall, begin downwards deceleration (+2)

(6) at the end of the filter when Y and delta are now 0, cancel deceleration (-1)

It would take only two parameters to define the filter:

a) the acceleration/deceleration period for filter rise and fall

b) the plateau period

With a few more bits of resolution, we could dial it in much better than we have been.

13,685Here is what the code looks like now. It's just amazing how much this has been simplified:

1,803I think we've had separate savings of 34, 10 and now 18 ALMs, with a logic increase between the second and third. At one time it was 80+ ALMs per smart pin.

I'll look at modifying the BASIC program for shift register skipping to allow a single set of 12 taps later this afternoon.