Hard to say without seeing the bike. But we similarly only experience the related noise while pedaling.
As I mentioned, this may not be the source of your issues, and I encourge you to check what other members have suggested in this thread, but noise investigations by nature are about isolating...