Edit: I've since been able to understand the how the relvant parts of Fourier transform work and how they relate to my problem / what I want to do. And have come to the conclusion that Fourier transform is not the best suited to my problem and that I have an alternative way to do what I want that is much simpler to control / behave in the way I want in practice.
Since I'm new here I don't know what's the right thing to do with my question on this site. Just in case anybody was following this / was preparing an answer, I'm leaving this question up for one more day with this edit and after that I'll delete the question.
I've devloped a basic algorithm for processing audio. I have some programming experience but none with Fourier transforms (but will dedicate all of 2020 to learn this full time if need be). My question relates to how best to program my algorithm in practice.
What I need to do is the following:
- Analyze the frequency content at exact locations of a 44.1kHz PCM audio stream / file.
- Detect and modify the amplitude of specific frequencies at specific time locations (I do not need to modify phase or have knowledge of phase to do this).
- Then turn this modified version back into audio without audible artifacts from processing errors/limitations.
As I said, I currenty do not know much about Fourier transform. So far my understanding is that an FFT (with windowing) will allow me to analyze the frequency spectrum of a block, detect and modify the amplitude of specific frequencies. But not modify the amplitude of specific frequencies at a specific time in that block and not the same frequency at a different time in that same block? For instance if for 44.1kHz sample rate and block size 8192 as far as I understand it normal FFT will not allow me to detect for instance two seperate 10kHz transients in that block as seperate and modify only one of them?
If my above understanding is correct. Can anybody suggest proper (Fourier transform like?) processing method(s) to use / investigate to achieve my goal?
I've throught of a rough way to do what I want with FFT/IFFT by dividing the frequency spectrum (5Hz to Nyquist for instance) into seperate octave bands all processed seperately, for instance first band 11.025kHz to 22.05kHz under 44.1kHz sample rate and block size 4 for instance not sure of the right block size just an estimate (so I get the transients in one block and still sufficient frequency resolution for that frequency band), then 5.5125kHz to 11.025kHz band under 22.05kHz sample rate (downsampled) also with block size 4 as an estimate, etc with a total of 12 bands down to about 5Hz for instance. But this will be a lot of work and will take me a lot of time to develop and surely someone must have done something similar and smarter a long time ago to do the type of processing I wish to do :) If anybody can point me in the right direction (and perhaps if I got some assumptions wrong correct me) I will be very thankful!
Does it have to be real time?
You mention in the beginning that you have developed a basic algorithm. What is
the basic algorithm you have developed? Can you describe it?
– GKH Jan 04 '20 at 22:31Is it mandatory to be FFT-based?
Finally, what exactly do you want to do? I mean, what is the purpose of modifying the amplitudes? What is the target application (let's say)?
- In the end I do want it to be real time (though a large latency is acceptable), it may be processor intensive. If it takes a whole computer or a seperate powerful DSP unit to run it that's ok.
- I cannot describe the algorithm in detail as it is something new. If I describe it there's a good chance someone else will write it before me. I'm certain though that the algorithm itself is correct.
- No, it does not have to be FFT based as long as I can modify the amplitude of specific frequencies at specific points in time.
– Pythagorean Jan 05 '20 at 14:14AudioSampleBuffer(). other than that, all of the code was my own C code contained in a C++ method. regarding the Phase Vocoder, i have some MATLAB code, but no C/C++ code for the Phase Vocoder and STFT. about 18 years ago i implemented this in C, but it was for a company of which i was an employee. hence the company owns the C code, not me. but i own my MATLAB code. – robert bristow-johnson Jan 08 '20 at 03:59