Hi there!
Some possibilities you might like to consider, depending on what you're trying already:
Have you tried asking them for their input, such as how they're finding class? If you're willing to ask them for their opinions in a way you're comfortable with, and they trust you, you'll receive useful info.
Could their lack of attention be a sign that they're struggling? Sometimes if students feel hopeless about a subject the reaction can be to disengage, even as a protective measure.
Rather than trying to be more stern, have you tried expanding your teach repertoire? Somtimes trying our a new method or approach can help to engage students, as can linking it to their real life experience. If you have a sporty crowd, maybe real life applications that match the math content to things where you take them out of the classroom or even just use videos as a safer option can help. If it feels relevant, there's a greater chance they'll tune in.
There's always a temptation to give resources and provide info, but they still need to know what to do with it and how to make sense of it. Have you thought about how using small group activities or differentiating, if you're not already, so that you can deal with those who aren't paying that much attention in a different way? A few minutes one on one, even just to check in, or to work more slowly through some difficulties, will likely earn you respect.
My advice would be basically: don't blame them. Instead, find out what's going on, look to reach them and maybe ask a colleague for their opinion. But it's tough, and the fact that you want to continue improving is a great thing. Hope this helps a little!