I acquire an audio signal via an I2S codec through a microphone. I test with a real sinusoid of a 1khz 0.5Vpp generator. I process the signal via an FFT in C language with a ESP32 and once the complexes are obtained I need to modify the signal with an arbitrary phase via an IFFT. However, I note that the 0 and 180° phases seem to work but with different angles such as 90° and 270° the signal disappears, it is cancelled. how can I overcome this problem?
-
$\begingroup$ How do you deal with the fact that the output of your IFFT is complex? (hint: that's the answer to your question.) $\endgroup$– Marcus MüllerCommented Oct 14 at 9:19
-
$\begingroup$ Can you update your question to elaborate on what you are doing specifically and for what purpose? Do you actually intend to modify phase or do you really mean to impart a constant time delay (they are not the same thing)? $\endgroup$– Dan BoschenCommented Oct 14 at 18:52
1 Answer
Constant phase shifts are difficult.
One of the problems is that the transfer function of any real filter must be real at DC and Nyquist, that means that you can achieve constant phase (that's not an integer multiple of $\pi$) over a bandpass region and you need to manage the transition bands.
The resulting filters are non-causal, so the design comes down to a trade off between phase match, amplitude ripple, bandwidth, latency and complexity.
A good example is a Hilbert Transformer which is a +-90 degree phase shifter. Reading up on Hilbert Transform filter design and you give a pointers on how to approach the arbitrary phase shifters (and the tradeoffs involved). One example would be https://www.intechopen.com/chapters/39362