I just got a 1997 f150 and i hear a knocking sound under the hood
It sounds like its coming from the
motor but sometimes its sounds
like its faster than it is at other
Probably your valves ticking. They would go faster at higher RPM's and slower at low RPM's. Older vehicles will have loose valves that don't always work as well as they once did and cause a lot of noise. Since it is 1997 model it probably is about time to have a valve job done, which can be expensive, but you can keep driving for a while you just won't get the best efficiency out of your ride.
It could be your exhaust! You may have a leak at manifold
Search Ford F-150 Questions
Ford F-150 Experts