Lossless FFT with Audio data

Thread Starter

funkyguy4000

Joined Feb 21, 2012
5
Hello,

I have an application where I'll be receiving an audio stream, much like using headphones, into my processor. I would like to run FFT and various DSP algorithms on the sampled audio and then spit the audio back out as if the device wasn't there. Basically doing DSP in real-time in between samples I guess. The processor I'm using is the MKL26Z128xxx4, mounted on the FRDM-KL26Z development board. It has a single ARM Cortex M0+ core and is programmed in C/C++ and can use the THUMB Assembly instruction set.

How would I do this without losing any of the streamed audio?
 
Last edited:

shteii01

Joined Feb 19, 2010
4,644
You can not. Nobody really can.

First you convert analog to digital using ADC. Then later you convert digital to analog using DAC.

The real question is: how much loss is acceptable?

If you are doing speech, then you can have a lot of loss and not even notice. If you are doing full symphony orchestra, then you need to be careful.
 

THE_RB

Joined Feb 11, 2008
5,438
Maybe I am misunderstanding, BUT if the audio comes out unmodified then it is very easy. Just get the DSP chip to "listen" to the two audio channels as they go past.

A couple of opamps with high input impedance can listen to the audio without affecting it.
 

fernan82

Joined Apr 19, 2014
26
@THE_RB Whenever you convert a analog signal to digital there is a loss since the analog signal can have an infinite number of amplitude values and sampling at 16-bit for example can only represent 65536 values. Sampling audio at 16bits/44100 is perceptibly looseless but you're still loosing information.

@Funkyguy4000 if you want to spit out the same audio data why not just send the analog signal directly to the output bypassing the processor? That way you don't need a DAC and the associated circuitry.
 

THE_RB

Joined Feb 11, 2008
5,438
@THE_RB Whenever you convert a analog signal to digital there is a loss since the analog signal can have an infinite number of amplitude values and sampling at 16-bit for example can only represent 65536 values. Sampling audio at 16bits/44100 is perceptibly looseless but you're still loosing information.
Umm, yep I design microcontroller ADC stuff for a living. ;)

@Funkyguy4000 if you want to spit out the same audio data why not just send the analog signal directly to the output bypassing the processor? That way you don't need a DAC and the associated circuitry.
Which is exactly what I said in post #3. The micro "listens as the analogue signal goes past". :)
 

fernan82

Joined Apr 19, 2014
26
Umm, yep I design microcontroller ADC stuff for a living. ;)



Which is exactly what I said in post #3. The micro "listens as the analogue signal goes past". :)

I'm sorry, I'm reading the posts sequentially and since it's right after shteii01 I thought you meant you don't understand his reply and I interpreted the rest of your code in the context of that reply so it didn't made much sense.
 
Top