@Dougster Even with a pinned powervalve the bike should pull smoothly right through the rev range, just with very little power until it comes on the pipe at 6-7000rpm.Actual backfiring could mean a CDI unit issue but this is quite rare; a lot of midrange running problems on the DTR are caused by a blocked emulsion tube in the carb.
If you've just bought the bike I'd do a full carb clean including the emulsion tube (the brass tube the main jet screws into). A lot of people (including bike shops) miss this and don't realise it comes out because you have to screw the main jet back in without the brass washer and tap it gently to remove it from the carb body. The space between this and the carb body gets blocked with moisture, dirt etc and blocks more and more holes in the tube until it just starts fourstroking and won't rev out one day as this controls the mid-throttle fuelling. Make sure the air supply to this is clear as well, it's the small brass tube on the right of the carb body just in front of the carb-to-airbox rubber. You should be able to blow through it, but only just.
You can also make future carb cleaning easier by bypassing the carb with the carb warmer hoses which come from the cooling system. These are only really needed to stop carb icing in countries with really cold winters but they serve another purpose which is to make the cooling system self-bleeding when refilling, so you don't get air gaps at the top of the cylinder head and unlike a lot of two-strokes you don't need bleed bolts in various places on the cooling system. Whilst you're getting the carb off, you can retain this feature by running a single hose directly from the banjo on the cylinder head to the one on the thermostat housing so you don't have to mess with the cooling system next time. Don't forget to check the coolant level in the radiator after doing this