The Securities and Exchange Commission is preparing to remove some high-frequency trading firms.

In a purge of computerized markets, prompted by public outrage unleashed by Michael Lewis’ “Flash Boys,” the SEC’s campaign will see numerous enforcement actions, new rules and new business practices — a sweeping overhaul that could benefit the beleaguered New York Stock Exchange, The Post has learned.

“You’ll probably see the commission coalesce around those enforcement cases and then bring new rules on high-frequency trading,” a source with knowledge of the SEC’s thinking told The Post. “There’s a lot of pressure on the SEC to act.”

The SEC is also mulling a trial run for a so-called trade-at rule, requiring brokerages and dark pools to send their orders to the NYSE, Nasdaq and other public exchanges unless better stock prices occur elsewhere, sources say.

The New York Stock Exchange is also feeling pressure. Its 22.68 percent market share of US trading in the $22 trillion US equity market has been declining for years — running almost neck-and-neck recently with high-speed BATS, itself in the cross hairs of critics. The floor has shed thousands of human traders.

But the decline could soon be stemmed. Intense lobbying by the NYSE’s owners, IntercontinentalExchange Group, for reform of the controversial “maker-taker” rebate rule for buying or selling shares is likely to get more sympathy. The rule’s abolition or amendment, seen as increasingly likely, would help reverse the NYSE’s losses to rivals who have taken volume with their better pricing.

“Back in the day, we used to call it pay to play (now it is called maker-taker), and we used to vigorously fight against it,” said NYSE floor trading vet Doreen Mogavero. “You know, the practice was originally devised by Bernard Madoff — need I say more?”

The source familiar with SEC thinking says the NYSE could get a boost as regulators force out dodgy players among the market’s 45 secretive dark pools, 200 “internalizers” and 13 public exchanges. But it might also be a mixed blessing.

“Yes, some high-frequency guys are going to be taken out of the game, but the NYSE might get rules they don’t care for,” the source said. “The ability of exchanges to develop and [profit] from special-order types is going to be stopped — and this exchange business of selling direct data feeds is going by the wayside.”

Mogavero says she’s not against high-frequency trading per se, but adds, “I do see something wrong though with anybody who is getting a proprietary look at an order to disadvantage the market,” referring to HFT firms that can legally “front run” a customer’s order.

Both the SEC and NYSE declined to comment.