Hello everyone. First of all, I'm not an English speaker, so I apologize for any strange translations. and I am a beginner, have been learning it for about 2 months.
What I want you to tell me is...
how to do FFT/IFFT in Processing
how to reduce the noise
How to reduce noise. Please help me.
I'm trying to read a sound with added noise using an Arduino analog microphone, FFT it with Processing, IFFT the resulting spectrum with reduced noise, and play the reduced noise sound with an Arduino dynamic speaker.
I was able to send the values acquired by the Arduino to Processing via serial communication. However, I can't figure out how to do the FFT in Processing. (There was a Minim library, but only the built-in microphone seemed to pick up the sound, right? )
So I went to various sites and found one that provided its own FFT, and used it. Then the next thing I know, I don't know if the FFT'd values are correct! I modified the FFT function to perform an IFFT to check it, but I got an unintelligible value, so I was completely stuck.
I don't even know how to reduce the noise ... I think peak detection would be a good solution, but I can't figure out how to implement it.
If there is anything else, please let me know. Thanks!
You cannot reduce "noise" until you can identify what the noise signal looks like!!! To do that you need an oscilloscope to visually examine the "noise" and determine it's properties, such as frequency, voltage wave form and how often it occurs.
Can you please describe a bit more why you want to do this? What is this project about and about yourself e.g., what electronics, software, algorithm knowledge do you have?
FFT is just one mathematical tool for digital signal processing. What you need to do is filter the data. There are many things to know about digital filters. To give you better advice we will need to know a bit more what you know and what you would like to do.
Thank you, Paul_KD7HB. that's white noise.
I thought I could find the amplitude by doing an FFT and reduce the noise by reducing all but the highest values, but is it wrong? If possible, I would like to use only Arduino and Processing.
Thank you, Klaus_K. For a college project, I was asked how to extract only the waveform from a noisy waveform, but I couldn't solve the problem with my knowledge.
I have some knowledge of FFT and DFT, but it is not perfect. I know that I can apply a window function to the waveform, divide it into finite intervals, and then do an FFT.
As for filters, I know about high-pass, low-pass, and band-pass filters. I know what they are. However, I don't know how to use them in practice...
Filtering is the ONLY real-time processing you can do to your signal. Any thing else will be slow, done in blocks of data and will miss anything that occurs between processing a small bunch of integers.
There are ICs that are programmable to do near real-time signal processing, but are not Arduino related.
There are Arduinos which can be used for digital signal processing. Anything that has a ARM Cortex-M4 or M7 is more than capable (e.g., Arduino Nano 33 BLE). The question is the software support. The Common Microcontroller Software Interface Standard (CMSIS) has a DSP library optimized for these processors using the DSP instructions.
You can install it using the Library Manager. Search for DSP. Install Arduino_CMSIS-DSP. There are no examples in this library so some information from the original source (ARM) may be helpful.
I'm using an Arduino Uno R3, and I've looked into the CMSIS library, but unfortunately I've heard that it can't be used with the Arduino Uno because it has a different processor.
I thought about using the Arduino_FFT library, but I don't know how to do IFFT (I know the process is almost the same, but I don't know what to change since it's not in the library), so I decided to use Processing.
Lets look at it another way. How many times per second can your program read the AD pin on your Arduino? When you store the integers in a array, how large of an array do you need? How much free memory is available for the array?
Hmm... not sure if I'm answering correctly, but the portrait is set to 115200. I haven't decided on the size of the arrays. In the meantime, I'm setting it to 512 so that I can do FFT.
When I tried to do the FFT on my Arduino uno, I just found out that the memory limit is 256 samples.
The biggest problem I have now is how to reduce the noise. I can't use a filter because I don't know the frequency of the waveform I want to find.
...So I have to store some of them in an array and do signal processing?
If the Arduino Uno was capable of doing what you ask for, new processor would not have been invented. The Arduino Uno uses some outdated technology from the last century. It is still useful for some simple experimenting, but it has its limits. Your college professors must be aware of this fact. Are they asking you to use the Arduino Uno?
Yes, for CMSIS DSP you need an ARM Cortex-M processor. Cortex-M4 and M7 have DSP instructions. M0/M0+ and M3 might work at much lower performance using normal math instructions.
That is logically impossible. If you do not know what the signal is, you cannot filter it out. There is not fundamental difference between signal and noise except definition.
Maybe he knows what the good signal is, and just need to "remove" everything else. Presumably, if you do FFT on the sampled signal, you'll have peaks for the "good signal" and any discernable "noise". You filter out those "noise" (since you already know what frequency they occur), and then do an IFFT of the modified signal and you get a cleaner waveform. Isn't this the basis of MP3 compression. It removes some signal (that arent discernable by human anyway) via FFT and IFFT