design of a recovery filter after DAC in audio application

Discussion in 'General Electronics Chat' started by xkekex, Jul 4, 2012.

  1. xkekex

    Thread Starter New Member

    May 16, 2012
    25
    0
    Hello everyone,
    I am actually working on a project that needs an audio part. my problem concerns the part between the ADC (integrated in the MCU) and the speaker.
    I already chose the speaker and amplifier. hereis what i have for the moment:
    Capture.JPG

    I realized lately that i forgot to design a recovery filter in order to avoid distorsion of the signal. i tried to find out on the internet how to design this filter, but i have to say that i don't know in which direction to go first!

    please any help is welcome.

    thanks!!
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    How many bit is the ADC. Most ADCs in MCUs are 10 bit. And I doubt that will give very good audio. If an audio signal is sampled with 10 bits. You need magic to restore whats lost in the conversion.
    Can you tell us more about your application. What is your required bandwidth. What is sampling rate and number of bits. What kind of application is this
     
  3. xkekex

    Thread Starter New Member

    May 16, 2012
    25
    0
    Hello thank you and sorry for the late response i have been out fora while.
    The MCU is a Gecko by Energymicro 32MHz cortex-M3 architecture. the embedded ADC is 12bits an the sampling rate is up to 500ksamples/sec.
    The bandwith is 100HZ to 7,000HZ but can be reduced to 500Hz /3,000Hz as it is just needed to play simple sounds (a conversation).

    thank you for your time and answers!

    regards,

    charles
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    Believe me whrn I say distortion will be the least of your problems. 12-bits is unlikely to produce satisfactory audio at least not as far as the golden ears are concerned. There are a handful of people on the planet who have constructed such filters and they are not talking. You can search the Internet to your heart's content but you will not come up with the answer.

    The IC amplifier is also not likely to produce satisfactory results.

    As an experimental project it won't hurt to build it and see for yourself, but don't expect great things from it.
     
  5. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    12 bits is more than sufficient for some purposes for instance such as intelligible speech. In past days for instance 8-bit A/D was used.

    Quality for direct A/D (not some PCM or compressed scheme) depends on the sample rate, you can get some decent results starting at 12 to 14Khz. The sample rate itself will produce audible distortion at the sample rate, so if possible, choose it slightly above 15 KHz.

    The problem is often how to deal with the data stream, means how to store it, not so much the sample rate, or A/D resolution.

    14 Khz Stereo = 28 kbytes every second, which must be stored continuously, if there are only small gaps, this will be audible + annoying.

    At 12 bits = 42 kbytes/second. If you double the sample rate, you already get 84 KBytes/second.
     
    Last edited: Jul 10, 2012
  6. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    To me the phrase "Audio Application" implies music reproduction. Your mileage may vary. In the music realm 16/44.1 is the basic Red Book CD rate and most audiophiles turn their noses up at this. They want 32/192 or even 32/384. My comment about filters applies to digital filters. Analog filters are more open when it comes to information on the internet. You'll have more luck in the analog domain than the digital domain.
     
  7. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    Using software processing you can do away with any unwanted frequencies.

    Isn't clear from the post what you want to filter.

    I mean what is present in the original sample data, and should be absent in the output signal? The distortion of the cheap amplifier?

    Neglible unless you use very expensive speakers.
     
  8. xkekex

    Thread Starter New Member

    May 16, 2012
    25
    0
    Ok i mightnothave been clear:
    The application to play sound of a speech in an understandable way.
    This imply a minimum bandwith of 500Hz to 3000Hz.


    if i understood well the sampling rate (sampling frequency) should be at least twice the cut off frequency of my useful signal (3000Hz).
    so Fsampling min=6000Hz but as i am using a 1st order passive low pass filter (poor slope) this frequency should be increase.
    so you propose 12,14 or even 15kHZ how did you choose these sampling rates?

    I undestand the problem that can be due to data storing speed but let's admitt that itis not a constraint for now.

    what about the filter, how should implement it once that ihave my sampling frequency?

    @papabravo
    I speak about analog filters thx
     
  9. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    I propose at least 12 Khz to 15 Khz, otherwise you get audible effects.
    Not that dramatic, but can be heard clearly.

    Or is it that you want to filter away this sampling noise?

    Maybe this software can be useful (on Windows PC).
    http://www.nch.com.au/wavepad/index.html

    You can decrease sample rate, and see the effect (for instance).
     
  10. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    Going back to your original post, I'm not sure I understand what you mean by a "recovery filter". I originally thought that you wanted a digital filter to "recover" the analog waveform from a sequence of samples from a "loss-less" file such as FLAC. There are a number of effects you need to worry about in high fidelity sound reproduction. For your application, I would get something working and be done with it. You can always improve on it for round 2.
     
  11. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    The little TPA301 amplifier has an output of only 0.25W (when the supply is only 3.3V) into an 8 ohm speaker with fairly high distortion. Its high audio frequencies are very distorted. It is designed for a muffled telephone.
     
  12. xkekex

    Thread Starter New Member

    May 16, 2012
    25
    0
    Thanks all for your answers!
    @takao: softwarehas been usefull, it helped meto analyse the frequency spectrum of a conversation record.

    @papabravo and audioguru
    What i mean by recovery filter is a filter that will compensate the distorsion mainly due to the holder. i know that the amplifier has a 0.25w outputpower only but the speaker also takes lowpower at its input.
    Iwant it to workproperly for frequency range 500-3000Hz.
    so you think it will be fine just without any output filter??
     
  13. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    Presumably you wanted to reduce any problematic quantization noise on the MCU DAC output signal to an acceptable level.

    It will probably not be an issue unless reproduction quality is important. If it is a problem, even a simple passive low pass passive filter might do the trick.
     
  14. xkekex

    Thread Starter New Member

    May 16, 2012
    25
    0
    That is the main idea that came out of the thread:

    no need of a reconstruction filter, distorsion is admitable for my application!

    so in the end my schematic is good as it is? (i could add a low pass filter)
     
  15. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    TDA820 is a good amplifier, I used it once, there is distortion only towards max. volume. Small 8-pin chip, needs a few capacitors.
     
Loading...