AnalogIn problem

11 Jun 2011

hahah cool it looks like I was not far off but by my calculation 48khz is 2100 picofarads:P I am just guessing tho

11 Jun 2011

In that case... You would most likely need to buffer the DAC so that the output filter does not load the DAC output. A buffer (or voltage follower) has a very high input impedance, this will limit the effects of capacitance on the DAC output stage, provided your buffer is as close as possible to the mbed pin. After the buffer, you can do your regular filtering, in this case, at 48kHz.

See

http://en.wikipedia.org/wiki/Voltage_follower

http://en.wikipedia.org/wiki/Sallen_Key_filter

11 Jun 2011

hmmm..

15 picofarad for 200khz.. 7.5k resistance

is 2.2 picofarad for the adc input??? 90khz:)??

Need resistor to get as low as 48khz??

11 Jun 2011

The input resistance of the ADC should be high enough not to affect your cut off frequency. For 48k, you can use 3.3k and 1 nF.

11 Jun 2011

150 picofarad:) 112khz:P

11 Jun 2011

To avoid aliasing, you need to filter at half the sampling freq :P

11 Jun 2011

Igor Martinovski wrote:

To avoid aliasing, you need to filter at half the sampling freq :P

you lost me the woman female is singing:P

11 Jun 2011
11 Jun 2011

15 picofarad and 10 picofarad sound best... 1000 picofarad is too much.. don't have resistors yet tho but without them 15 pf and 10pf is best... how do you calculate this. maybe is 2.2pf or below 10pf for 100khz, for adc this is.

11 Jun 2011

right half it is 7.5 picofarads 100khz, 3.75k resistance.

11 Jun 2011

The thing is, you can't calculate the cutoff frequency without resistance. A capacitor acts as an integrator when connected to ground, and as a differentiators when it is in series. It is no longer a low pass filter.

If you only use a capacitor, the resistance of the ADC pin and the resistance of your mic output determine the bandwidth. It's a more involved calculation in that case. This is why high input impedance and low output impedance is important. It allows you to use a greater range of values in your circuit because the input/output impedance between stages has less of an effect on the circuit between the stages.

If you aren't using a resistor with your cap, your guess is as good as mine :P

11 Jun 2011

@philips philips,

I just hope your name isn't inspired by the company with a similar name. I don't know what your competences are but when it comes to analog electronics you obiviously haven't got a clue. So please read a book or stay away from it.

11 Jun 2011

What has me puzzled is that for difference sample rates you need difference calculations difference capacitors and resistors. you need switch in the circuit or something, to switch between caps like kinda how a flip flop works??

11 Jun 2011

@Ad van der Weiden That's not very encouraging. Everyone's free to ask questions. If you have nothing constructive to say, don't say anything at all.

@ phillips

You don't switch between values. For different sampling frequencies, there is a different nyquist frequency (ideally half of the sampling rate, practically less than half of the sampling frequency).

So if your (maximum) sampling rate is 96kHz, then your anti-aliasing filter should be at 48k. If you sample at 48k, the anti-aliasing filter should be 24k. You don't have to use an anti aliasing filter in some applications. But you must in audio. Otherwise you'd hear a lot of other harmonics on the output. So, sample at 96k or 48k, and keep the filter at 24k. That way you can lower the sampling rate if you need to without changing the filter. We can't hear much past 22khz, so a cutoff of 24khz or 48khz shouldn't be noticeable.

11 Jun 2011

Ad van der Weiden wrote:

@philips philips,

I just hope your name isn't inspired by the company with a similar name. I don't know what your competences are but when it comes to analog electronics you obiviously haven't got a clue. So please read a book or stay away from it.

Well retire workers, My ears are all I need.

11 Jun 2011

Philips Philips wrote:

Ad van der Weiden wrote:

@philips philips,

I just hope your name isn't inspired by the company with a similar name. I don't know what your competences are but when it comes to analog electronics you obiviously haven't got a clue. So please read a book or stay away from it.

Well retire workers, My ears are all I need.

I supposed you gonna tell me delta sigma is the best thing ever right? but your right I don't know anything about analog circuits, but to me this is life or death:)

11 Jun 2011

Phillips, I don't think this topic is suitable for our discussion anymore. It the original topic pertains to AnalogIn issues.

If you want to discuss filters and other circuits, please post in the Electronics and Hardware forum and maybe more people can help out.

11 Jun 2011

Igor Martinovski wrote:

Phillips, I don't think this topic is suitable for our discussion anymore. It the original topic pertains to AnalogIn issues.

If you want to discuss filters and other circuits, please post in the Electronics and Hardware forum and maybe more people can help out.

Yeah somebody pooped the party, just resistors as caps igor.

11 Jun 2011
11 Jun 2011

Have you ever used variable capacitor, and variable resistor, to get the right settling time update rate.

11 Jun 2011

nope. It's not needed. Just design the appropriate filter and hope for the best.

The settling time of the actual ADC or DAC should be much faster than your filter anyway and should be of no consequence. If its not, then you need a faster converter.

This is the general way it works: Your requirement is 96kHz sampling rate of the ADC. The nyquist rate of this frequency is 48k. Now, you don't have to filter the input signal at all; however, if you don't filter at half the sampling rate with a very steep filter (i.e. a high order lowpass filter), you cannot be sure that your sampled signal is 40kHz or 400kHz! (or any other multiple thereof) due to the lack of information about the signal between samples. To avoid this uncertainty, we use a filter to make sure that signals more than 48k (more than half of the sampling frequency) don't enter our ADC. If we know that 400kHz can't enter the ADC, then we are sure that our 40kHz sampled signal is indeed 40kHz. So when you design your analog front end, just make sure you filter at half the sampling rate at least. Ideally, this should be a very good and steep filter, but a single-pole filter is better than nothing.

The fact that you're sampling near the limit of the ADC complicates matters, but you can assume that the ADC should settle faster than your filter anyway (after all, we are still sampling within the specifications), so you don't have to dwell about the settling time and rise time of your ADC because your filter is slower by design!

Since you're working on an audio application, I would go further and filter down to 20kHz (since we are using a single-pole filter) to be safe.

Same deal for the output..

12 Jun 2011

I see I need big fancy scope:) when I said mojo I know their is dirty secret of when you set the right capacitors and resistors down you will get the most mojo out of mbed

Like how amplifiers work you set the capacitors and resistors and you get the most mojo:) I will tried what you said, but obviously until I get a scope, I can't be as precise as I want or can I lol:)

Also why the 1 MHz update rate for the DAC if the SAR adc can only do 200khz? is this for gpio dma or passing the data to something? how do you do this on calaculator:P R = 1/(2*pi*(1nF)(48kHz)) = 3315 ohms, or 3.3k ohms

thanks. /media/uploads/mbed2f/pocket-headphone-amplifier-by-opa134.gif

12 Jun 2011

Igor Martinovski wrote:

I like to avoid magnetics for the A/D unless I need galvanic isolation. In the other post, a low pass filter with a 100khz cut off frequency did wonders. Note that the R/C values are 6.8k and 220pf. The low resistance keeps the input impedance low to make the input less susceptible to noise.

http://mbed.org/forum/bugs-suggestions/topic/1514/?page=2

what schematics are you talking about on this page? I was looking at the second schematics, I see it was this one

/media/uploads/mbed2f/schematic_6.8_k.jpg

12 Jun 2011

Hi Philips,

To assist you in your electronics hobby, I have started a new thread here:

http://mbed.org/forum/electronics/topic/2392/

There is a link which will allow you to build an test your circuits in a simulator and see if you get the expected result.

This thread is regarding the Analog inputs of the Mbed, which after a lot of testing have proven to be perfectly acceptable, even if our circuit designs haven't been. :)

12 Jun 2011

Matt Parsons wrote:

Hi Philips,

To assist you in your electronics hobby, I have started a new thread here:

http://mbed.org/forum/electronics/topic/2392/

There is a link which will allow you to build an test your circuits in a simulator and see if you get the expected result.

This thread is regarding the Analog inputs of the Mbed, which after a lot of testing have proven to be perfectly acceptable, even if our circuit designs haven't been. :)

cool will take a look I needed a 15k 22k and 150k I thinks lol.. I think I need to wait untill I can afford the big fancy scope lol hopefully with the lpcxpresso and the debugger it has I can get the information I need from the debugger and scope, I don't have two pennys to scratch my ass with at the moment:) Have to eat food.

12 Jun 2011

Or is that 495 ohms I need to get a 7.5k input resistance for adc, and it max input of 15 picofarads.

12 Jun 2011

Matt Parsons wrote:

Hi Philips,

To assist you in your electronics hobby, I have started a new thread here:

http://mbed.org/forum/electronics/topic/2392/

There is a link which will allow you to build an test your circuits in a simulator and see if you get the expected result.

This thread is regarding the Analog inputs of the Mbed, which after a lot of testing have proven to be perfectly acceptable, even if our circuit designs haven't been. :)

You should make it downloadable, its cool:)

16 Jun 2011

I put a 1mh rf choke inductor on the mic input ,on the postive line and then I got a 150 picofarad cap after that, so I guess this is acting as a high and low pass filter, but it now seems to be fixed I hope.

To be honest everything I have done has fixed it pretty much from the just putting the ferrite bead on the postive mic line only and not GND, everything I have done has only been on the postive line of the wire going into the mbed. I have notice with the resistor I have used when I put them , onto going from postive input of mic to GND it does not work... But if I put the resistor just on the positive mic line only it works:)

I think 150 picofarads is good from maybe 112 khz not sure still trying to find the best size caps to use, but obviously I can not do it without a scope..

But I think I should be looking for a cap that give the right update right for whatever khz I used and that gives lowest settling time μs

Would be nice if nxp would have taken into considerations more graphs or at least advise on One or more graph(s) of load impedance vs. settling time will be included in the final data sheet.

16 Jun 2011

You don't need a scope for this (and please don't buy one thinking that it will make everything ok)

I explained the basic theory behind the kind of filters you should use. The external capacitors have nothing to do with the update rate and settling time and the rise time of the ADC or DAC. You do not need to take these into account for most applications.

Also, by including inductance, you have now introduced a resonant frequency within your circuit. This is another reason to avoid adding inductive components to a circuit. Now, if you happen to input that particular frequency in the RLC (or LC) circuit, the gain will be really large and the circuit will ring or oscillate at that frequency. Something like this should always be avoided unless you need a resonant circuit for a specific reason.. In this case, you do not.

16 Jun 2011

Igor Martinovski wrote:

You don't need a scope for this (and please don't buy one thinking that it will make everything ok)

I explained the basic theory behind the kind of filters you should use. The external capacitors have nothing to do with the update rate and settling time and the rise time of the ADC or DAC. You do not need to take these into account for most applications.

Also, by including inductance, you have now introduced a resonant frequency within your circuit. This is another reason to avoid adding inductive components to a circuit. Now, if you happen to input that particular frequency in the RLC (or LC) circuit, the gain will be really large and the circuit will ring or oscillate at that frequency. Something like this should always be avoided unless you need a resonant circuit for a specific reason.. In this case, you do not.

Everything you have advise up to yet did not work for my situation, and I am afraid for what I am creating I do need a scope:) I do need to take into account the update rate and settling time and the rise time of the ADC and DAC.

This is what they did in the old days, old is gold:) whatever.......caps inductors resistors they are all filters ok:)

http://en.wikipedia.org/wiki/Electronic_filter

Passive filters

Passive implementations of linear filters are based on combinations of resistors (R), inductors (L) and capacitors (C). These types are collectively known as passive filters, because they do not depend upon an external power supply and/or they do not contain active components such as transistors.

Inductors block high-frequency signals and conduct low-frequency signals, while capacitors do the reverse. A filter in which the signal passes through an inductor, or in which a capacitor provides a path to ground, presents less attenuation to low-frequency signals than high-frequency signals and is a low-pass filter. If the signal passes through a capacitor, or has a path to ground through an inductor, then the filter presents less attenuation to high-frequency signals than low-frequency signals and is a high-pass filter. Resistors on their own have no frequency-selective properties, but are added to inductors and capacitors to determine the time-constants of the circuit, and therefore the frequencies to which it responds.

The inductors and capacitors are the reactive elements of the filter. The number of elements determines the order of the filter. In this context, an LC tuned circuit being used in a band-pass or band-stop filter is considered a single element even though it consists of two components.

At high frequencies (above about 100 megahertz), sometimes the inductors consist of single loops or strips of sheet metal, and the capacitors consist of adjacent strips of metal. These inductive or capacitive pieces of metal are called stubs.