using the STM32 Blue Pill
That is not an Arduino, this is an Arduino Forum.
with Arduino IDE.
Irrelevant, as that is just a C++ compiler and not much to do with an Arduino.
That being said, you have not told us what you are trying, what hardware you have and how it is wired up. What results you are getting with the code you have so far and posting that code. Also whether this is supposed to just cancel noise or if there will be an audio signal you want to be present and the noise you don’t.
So even if someone came along and read this, and knows what a STM32 Blue Pill is, and what its analogue sampling rate is, and how much memory it has then they would not be able to answer your question.
Unless you have an oscilloscope, and know how to use it, then I think you are not well equipped to do this project anyway.