When you hear rapid knocking in your home, do you think that the neighborhood kids are harassing you?
While this could happen, it could also be a woodpecker. Woodpeckers are attracted by wood-destroying insects, so you might think that this is a good thing, but if they start digging for them in your home, you will soon see unsightly holes all over the place.
Woodpeckers have amazing hearing and eyesight, so they can detect bugs from a great distance. This means that your best way of dealing with them is to take care of the bug problem. Using a professional exterminator might be the easiest way to get it taken care of, but you might need to install some kind of cover to protect the area until the woodpecker gets discouraged.
Since woodpeckers are protected, your only way of dealing with them would be to discourage them from using your home as their personal pantry, either by removing the food-source or by blocking access to your home with netting or something similar.