For a while, I’ve been thinking about noise cancelling microphones. I realized the other day that in order to ever hope to build one, I needed to model it first. What I ended up doing was building a model in matlab (of course), which includes the following simple classes:
- A waveform class to allow for quick generation of sine waves.
- A wavesource class to allow positioning of those waveforms in space.
- A microphone class to generate wave recievers positioned in space, which computes the distance between itself and the source in order to phase shift the incoming wave.
Then, to get waveforms, you can take the output audio from multiple microphones (which is effectively time aligned) and do math with it.
Then, by sweeping the wave sources through space, we can plot the pickup patterns of different wave forms.
By sweeping the frequency of the waveform over successive sweeps, we can see that impact as well.
Fun. More to come?
Get the code here: https://github.com/wespo/DirectionalMicrophone