This scenario is surprisingly common and is almost always perpetrated by male Northern Cardinals, American Robins, and Mockingbirds. The concentration of hormones in male birds increases dramatically during breeding season which can cause a ferocious defense of their territory. Certain species seem more prone to being “fooled” by their reflection in windows, thinking it is a rival in their territory.
The solution is to eliminate the reflective properties of glass by covering the window from the outside. Anything attached to the inside of the window may reduce reflectivity, but not eliminate it. You may have to cover the window for a period of time, perhaps a week or more. Attaching white paper to the entire outer surface of the window will allow for light to enter while eliminating reflection. Try stringing balloons, old CDs, or strips of shiny material to the outer window surface. If the bird is still persistent, you may have to attach fine netting across your windows to at least stop them from banging into the glass.