22-03-2018, 11:42 AM
I didn't look to see if you had oversampled the output. Well done for making a 4x oversampler. The simple output filter shouldn't produce any significant overshoot. The point about oversampling is that the output filter can be very simple. An example...
Sampling frequency 9MHz, wanted BW 3.5MHz. The filter has to go from a flat passband at 3.5MHz to a good stopband at 4.5MHz and stay at least 40dB down above that. Doing this with good phase response is hard. Very hard. Something like a 5th order elliptical with phase compensation sections. You used to pay the likes of Matthey and BAL a lot of money to do this.
Now let's oversample 4 times to 36MHz. The passband is still flat to 3.5MHz. The stopband is now from 18MHz. you've got over 2 octaves to get down to 40dB so a 3 pole filter should be OK. Just 1 coil and 2 caps. I suspect you'd be aiming at a fairly soft Bessel response, possibly even Gaussian. Very easy to design and very uncritical.
It won't matter here, but there's also a need for sin(x)/x correction. This is because a DAC produces steps rather than unit impulses. For the non-oversampled example it's more than 1dB increase in response at 3.5MHz.Must be linear phase. Again Matthey etc would sell you this for lots of dosh. For 4x oversampling it's about 0.15dB. In this design you can forget about it. In a high precision system that I designed I used a 3 pole FIR with small -ve outer coeffts to do it. Not 100% accurate but I reckon I was within 0.02dB overall, probably better. When doing this kind of filter which has greater than unity gain at some frequencies you need to watch that you don't hit the endstops and roll round. From 255 to 0 or 0 to 255 in an 8 bit system. If you're a bit close, the fix is to wind down the low freuency gain a bit by tweaking the coeffts.
To test the oversampler and output filter you simply program in suitable test waveforms. Pulse and bar, sine wave multiburst are both good. P&B shows phase response as well as freequency. The ultimate test is a strange looking sin(x)/x waveform and to be honest I've not done this even on my own designs. You can also program impossible waveforms such a big step changes directly to the DAC or via the oversampler. This allows you to investigate the impusle repsonse of both analogue filter and oversampler.
Sampling frequency 9MHz, wanted BW 3.5MHz. The filter has to go from a flat passband at 3.5MHz to a good stopband at 4.5MHz and stay at least 40dB down above that. Doing this with good phase response is hard. Very hard. Something like a 5th order elliptical with phase compensation sections. You used to pay the likes of Matthey and BAL a lot of money to do this.
Now let's oversample 4 times to 36MHz. The passband is still flat to 3.5MHz. The stopband is now from 18MHz. you've got over 2 octaves to get down to 40dB so a 3 pole filter should be OK. Just 1 coil and 2 caps. I suspect you'd be aiming at a fairly soft Bessel response, possibly even Gaussian. Very easy to design and very uncritical.
It won't matter here, but there's also a need for sin(x)/x correction. This is because a DAC produces steps rather than unit impulses. For the non-oversampled example it's more than 1dB increase in response at 3.5MHz.Must be linear phase. Again Matthey etc would sell you this for lots of dosh. For 4x oversampling it's about 0.15dB. In this design you can forget about it. In a high precision system that I designed I used a 3 pole FIR with small -ve outer coeffts to do it. Not 100% accurate but I reckon I was within 0.02dB overall, probably better. When doing this kind of filter which has greater than unity gain at some frequencies you need to watch that you don't hit the endstops and roll round. From 255 to 0 or 0 to 255 in an 8 bit system. If you're a bit close, the fix is to wind down the low freuency gain a bit by tweaking the coeffts.
To test the oversampler and output filter you simply program in suitable test waveforms. Pulse and bar, sine wave multiburst are both good. P&B shows phase response as well as freequency. The ultimate test is a strange looking sin(x)/x waveform and to be honest I've not done this even on my own designs. You can also program impossible waveforms such a big step changes directly to the DAC or via the oversampler. This allows you to investigate the impusle repsonse of both analogue filter and oversampler.
www.borinsky.co.uk Jeffrey Borinsky www.becg.tv







