And the most annoying noises tend to be periodic anyway.
I think you should give it a try... let us test it, if you can cancel out my air conditioner noise you'll be my favorite person...
In theory it should be possible with a standard sound card, or a sound chip in the motherboard.
If it's close to the ear canal, all you need is low latency hardware (or hardware+software), responding in a few milliseconds thereabouts.
Agree with the first part of your answer, but not sure what you mean by this second part.
There is dedicated hardware for it, then there are solution using your generic gpu (ex Nvidia RTX Voice), then there are solution using your generic cpu (ex whatever the name of the one discord desktop client provides).
https://shop.asus.com/us/90yh02l1-b2ua00-ai-noise-canceling-...
So, it can be on a generic MCU, but not one where the algorithm is competing for CPU time with other processes.
I think you have to detect the sound with a microphone, then come up with the canceling waveform before the sound hits your headphone drivers (as they will be generating the canceling waveform). Given the typical size of headphones, it would be something like
2cm/(34300cm/s) ~ 60us
Although, sound travels faster through solids, so might want to be a little quicker. And 2cm thick headphones would be pretty thick.
I imagine you want a very good approximation of the soundwave that will hit the ear (so you can cancel it out very accurately). The farther that your 'virtual microphone' is from the ear, I guess the harder it will be to figure out exactly how the sounds it is picking up will combine to hit the ear.
I mean, imagine the extreme case -- your 'virtual microphone' is (virtually) sitting in the path of some directed audio beam which won't hit the headphone wearer at all. Now you do the signal processing and generate a signal to cancel out that directed audio beam, which, because the user isn't in the path of it, causes them to hear it!