I agree with Layne75.
The issue appears to be when you upgrade from 9 to 10.
I have managed to improve mine, I don't think it is quite as good as before, and it is still not as good as the iPad.
But completely wiping the phone and installing from scratch seems to improve it.
You should firstly do a backup of your current ios 10 install to iTunes and iCloud.
Then reset your phone to factory settings.
You then have a choice: Restore from backup, or set up as New iPhone.
Restore from backup didn't work for me first time so I set up as New iPhone after following advice from Apple.
This seemed to improve things, but I had lost all my data and wanted it back so I restored the backup at this point to retrieve my contacts/photos/settings etc, everything but music files.
I then re-installed the music files and the sound seemed back to normal, through Bluetooth and headphones.
Please note; when setting up as new iPhone you will need to sign in to Apple on your phone and they will try to send you a code, but you wont be able to see the code because you cant access your texts yet and it didn't pop up on the screen.
So my advice is to bypass the sign in and say you will do it later, then sign in through the settings menu.
Another thing to note; when re-installing the music files there is a setting.
'Convert Higher Bit Rate Songs to _____kbps' and there is a list of options.
I had this option ticked so I un-ticked it before installing the music files, there is a chance that this setting was also a factor.
I believe that this option is used to compress the music files to save space at the expense of some quality, but it was fine before so I used this option to save space. Now I have a bigger capacity phone I don't need this option and transferring music files is much quicker with it disabled.
Hope this helps some of you restore your quality.