Lossless FFT with Audio data

Discussion in 'Programmer's Corner' started by funkyguy4000, Apr 11, 2014.

  1. funkyguy4000

    Thread Starter New Member

    Feb 21, 2012
    5
    2
    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: Apr 11, 2014
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,375
    494
    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.
     
  3. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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.
     
  4. fernan82

    New Member

    Apr 19, 2014
    26
    9
    @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.
     
  5. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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". :)
     
  6. fernan82

    New Member

    Apr 19, 2014
    26
    9

    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.
     
    THE_RB likes this.
Loading...