I think ronwalf has some excellent suggestions to help narrow down the issue. Knocking is generally easier to solve than creaking, however it can still be a pain in the arse. I am never convinced that speed or pedaling has any effect on a situation as noises can be drowned out by so many other things when you are moving at speed or pedaling hard. I am OCD when it comes to my bike so I regularly find myself inventing new ways to narrow down a noise. When you hear it, try standing out of the saddle while maintaining the same cadence (if possible). Could be a seat issue, or simply a seat bag knocking. Make sure nothing really obvious is occurring such as your heel hitting a pannier or your shoe contacting the crank arm at the bottom of a stroke. Check your headset for play, stand over the bike, apply the front brake and slowly try to push the bike slightly forward, if the headset is loose you will hear a knock. If you are certain it only happens when coasting you can eliminate crank arms, chain rings, and bottom bracket issues, if not, check to see if there is any play in your bottom bracket. If all else fails it most likely is your cassette or hub. The best way to check this is to try a different rear wheel (if you have one) and see if this solves the issue. At least you can narrow it down that way. Hope that helps a little.