Lots of cities have noise ordinances, that basically take your equipment if you don't comply. Being a retired police officer I know how it works, but you can fight it if you are in the right, if you are blasting your neighbors, you will probably lose.
If you know they are just trying to run you off make a deal with someone in power that might side with you and let them have a component that will stop the problem and park it with them for a week and run your TV loud or something to get them going. Then when they complain, you will have positive proof they are harassing you and at that point the tables can be turned and you can FILE against them for harassment, and probably make it stick. But you need to be careful as most noise complaints are valid, so you need to PROVE yours is not.
I took a guys stereo because he stated that it wasn't on at the time and the neighbors were harassing them. I took them and booked the items into the PD as he asked me to. Two nights later there was a complaint that there was noise and I went, it was quiet. The neighbors stated they would sign a complaint that the noise was louder than their own TV. I knew it wasn't possible and it went into the report. The kid sued and won 15,000 bucks from the people. They moved, never found out the complaint, but it was a problem. I showed up at the trail and they settled before the trail began, knowing that I was going to testify that the equipment wasn't on the property that night. The insurance company paid them I believe....
So most places can but it has to be recurring and loud with more than one person complaining. The other side of the coin, how would you like to live next to someone that played stuff you couldn't stand or kept you up at all hours, piss you off too...
Jack