Open hananabilabd opened 6 years ago
Hi, I am not sure I understand your question. The circuit attached to my website (http://soerenbnoergaard.dk/project_adcdac.html) has a few filtering capacitors but the frequency response is generally flat through the circuit.
I would recommend spending a bit of time designing a better anti-aliasing low-pass filter (0-20kHz) before the ADC. The same filter could also be replicated on the output, although the signal quality from the DAC is generally ok.
The low-pass filter code in here is a very simple digital filter.
It has been a long time since I looked at this circuit. I believe i found the ADC too noisy, so I did not get to use it much.
Best regards, Søren
Thanks "It has been a long time since I looked at this circuit. I believe i found the ADC too noisy, so I did not get to use it much." Did you mean by that the ADC of the dspic is noisy ??
Hi.
Yes, i think the ADC of the dspic was quite noisy. I think it showed spikes at 48000 Hz when sampling at this frequency.
You could easily use an LM358, but you should probably use a 5V supply for this to get a signal swing close to the 3.3V range of the dspic.
I would probably use one of the amps in the lm358 as a single-supply Sallen Key filter (2nd or 3rd order low pass filter with cutoff at around, say, 16kHz) and then the second amp as a buffer just before the ADC.
Best, Søren
To avoid noise in increasing components number can't I make this filter (0 -21 khz ) inside dspic ?
Unfortunately, the filter must be analog to avoid aliasing. A simple rc filter might mere ok as long as you have the buffer before the adc. I am pretty sure the dspic will be fried at 5V, so you would need a regulator -- e.g a cheap AMS1117 and two 10uF capacitors.
Best, Søren
aha actually um gonna use this dspic to make a prototype to digital Hearing aid , to be able to increase the gain of some frequencies band , Since you have worked on it , Have I made a perfect choice by using it?
As I said, it might be a bit noisy, but I do not really have any better single-chip alternative. It would probably be better to have an external audio adc/dac/frontend chip. I think some have built-in anti-aliasing and are made for audio/speach. Then you could use a microcontroller with a suitable digital interface to communicate with it.
I have some AD74111 because they were cheap, but have not tried them yet.
The problem now is that i can't even hear nearly any voice coming out of the speaker ,
You probably need to bias the input of the first amp so you signal swings around e.g 2V instead of ground. Second, I am not sure you can drive an 8 ohm speaker directly from the opamp -- try using lighter load (e.g an oscilloscope or an aux input of an audio amplifier) -- the output should go through a capacitor in any case. Third, I think the 2.2 uF capacitor should be replaced with a short to ground so the output amp is also biased. The output amp should also be powered fro 5V.
Sir I have 2 question for you In this schematic what would you change if you just replace the audio in with an electret microphone -- the second inquiry Is this frequency response (the attenuation of greater than 100 HZ) is due to the RC circuit or the you made a low-pass digital filter inside the dsPIC ?
Hi,
If you just want to use my circuit without the suggestions I have above about anti-aliasing filter, I would do the following:
Best, Søren
In Fact i was going to use sallen key low pass and i got the components and everything , but then i said i must ensure first there is a signal coming out of the dspic , but after all the modifications i still get a noisy sound from the aux earphone . in fact i make the same circuit as yours with all the components except for the MCP6022 I used LM358 ( as MCP can't be found in my country :( )
it works after all , Thanks a lot
I still have a little question here in the schematic the 1K OHM here is it a variable resistance or what ?
Hi, yes, the 1k is a potentiometer where the center pin is connected to the + input through the 10k resistor. It should probably be located around midways to begin with.
You could also try to replace the 2M2 resistors with 100k--220k resistors and the input capacitor from 1uF to 10uF.
Also, I seem to remember that the output of the LM358 must be loaded somehow. Your could try to add a 1k resister from the opamp to ground in both cases.
I hope you can get it working :-)
Best, Søren
Thanks for help sure um going to try that but about the sallen-key low-pass filter should i put it directly after the 100n capacitor or after the 2.2M biasing resistor
in fact i tried to put it before and after but i get no sound , should the op-amp of the sallen-key filter has 2M2 bias resistors ?
It should be before the 100nF capacitor.
Notice that you need a "single supply" version of the sallen key filter unless you have a negative power supply. So yes, you need some biasing resistors and an additional input series capacitor for the filter.
Hi Um just wondering if the circuit to this code attached in the website is doing filtering meaning that filters are done by capacitors attached not the digital filters inside the dspic ,, and what if i want to make the filters what is the general circuit for the adc for audio in and Dac for audio out