Login   |   Register
Search Minimize
Recent_Comments Minimize
re:
Thanks for putting an effort to publish this information and for sharing this with us.

Cindy
www.gofastek.com
re:
I'm impressed. You're truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. I'm saving this for future use.

Vivian
Marks Web
www.imarksweb.org
hermes birkin buy
Nowadays it's quite than a woman has several designer bags to her jewelry and clothes. The way you use and preserve hermes sample sale them now turns into a necessary lesson for fashion girls, especially leather bags, because leather is a special material, it's best to be more conscious of its maintenance to help with making the leather products new and durable. Most of the time, for a new leather bag, you should earn some frictions using your clean hands slowly and lightly. So long as you use proper cleansing product, little Hermes Plume 28 wrinkles and in many cases small scars can be taken off. Like shoes, begin using a similar bag each day, the leather's elasticity can be weakened, which means you should use several bags alternatively in the same way you alter your shoes. Bags will present scratches and dirties unavoidably should they be used, then easy methods to solve such variety of problems? Towards the dirty spots, clean these clean sponges stained with temperate soap fluid or white wine, alcohol, then clean them louis vuitton outlet store with water that is clean, let leather be blown to dry naturally. In case the dirty spots are usually strong, you will employ cleanser to treat them possibly, you should really be wary in order to avoid the harm in the surface of leather. Do not allow the bag contact sunshine or perhaps be all around any heating device where possible , if you do so, the leather are going to be drier and drier, the elasticity and softness of leather will disappear gradually too. Bags are typically hermes birkin sale polluted by rain in moist environment. If bags are unluckily be polluted by rain, do not roast it with fire or expose it for the sun both hands the baggage from distorted. The most effective way is clean the and it at a cool place. Natural oil during the leather will reduce over time or while you to work with an increasing number of, so for the leather products of high quality, they are really you will maintenance too. When you shoes with red bottoms collect bags which were out from season, you'll want to clean their surfaces first as well as set clean broken balled paper Hermes Evelyn GM or cotton skirts within them to keep their shapes. Then put the bag into soft cotton bags and also it from the wardrobe, to avoid the distortion brought shoes with red bottoms by improper pressure. The wardrobe where leather items are placed must be well ventilated, including, a wardrobe by having a slate door works miracles, therefore you ought to not put just too many products within the wardrobe. What is important for ones upkeep of leather products louis vuitton purses is to cherish it. Don't possess abrasion, or never allow your bags be drenched by rain or polluted by dirty in everyday using, these are the basic simplest general knowledge with the repair of bags. In case you deal with them after problems appear, then your effect is definitely not flexible.
# hermes birkin buy
Recent_Entries Minimize
MakerFaire is a wrap!!!
News, updates and more!
Some site updates, news and more!!
Relay Units Back in Stock!
Added some more tutorial videos!
Update To LeoPhi
LeoPhi and our own VID/PID combo!!
Arduino 1.0.1
Collection of op-amp circuits
  Minimize
  Minimize

Oversampling to enhance ADC resolution

Apr 3

Written by:
4/3/2012 11:24 PM  RssIcon

The method implemented in the application note is called Oversampling and Decimation, and while is a complex theorem, the usage on this scale can be managed and implemented quite easily, so that’s good news! Lets take a quick look at the basic parts and then apply it to some code after learning about the process a bit.

Sampling Frequency:

According to the Nyquist theorem in order to reconstruct a signal properly we must sample it at least twice as fast. When applied to the 10bit ADC in the AVR family, we get an effective range of 50kHz-200kHz. Putting our upper bandwidth threshold of the signal at ~8kHz. This is an important consideration to keep in mind(Although AVR ADC can go up to 1MHz, it comes at a much lower ENOB). Luckily for our signal this doesn’t matter much, the signal we will interface with is a nice and slow one!

Oversampling:

Now that we understand the limits in place due to sampling frequency and hardware limitations, we can form a better picture of this technique. In short we need to take a large number of samples and add them together, the number of oversamples determines the increased bit resolution. For ever desired bit of resolution the signal must be sampled 4 times. As you can see this can put a strain on our frequency limits very quickly, and therefore must be used wisely. For just 2 more bits of resolution we must sample the signal an extra 16 times.

Noise:

In order for this method of increased resolution to work properly there needs to be some noise in the signal. The signal itself must also be stable during conversion. On the surface this looks strange since we want noise, but also stable signal, the whole idea is to get the LSBs to twitch a bit, and allows us to lock onto variations that avoid reading in the same value (turning this into normal averaging) over and over. An added benefit to this method is spreading the noise across a larger binary number, effectively increasing our Signal to Noise ratio as well as our ENOB.

Averaging:

Now that we have a given sample set, at a set frequency and a noise base that allows this method to work, how do we turn this into a meaningful number that we can use? This is where the Decimation or Interpolation portion comes into play. Unlike the normal averaging method where x samples are added then divided by x, decimation allows for an increase of resolution, by bit shifting to the right to scale accordingly (1 shift right is like dividing by a factor of 2). This handy trick gives us the power of the Moving average as well as an increase in resolution. When 16 10bit numbers are added together the result is a 14bit number with the last 2 bits expected to hold null data, to get “back” to 12bits we need to scale this number by a factor(SF=2^n, n=desired bit increase). In our 12bit case we would need to shift twice(first shift is a power of 2 and second would be 4, 2^2 =4).

So by taking 16 10bit samples in a desired sampling frequency range, adding these numbers together and bit shifting to the right twice we have created a 12 bit number and spread our noise across a 14bit. This is an effective way to increase the resolution as shown above, now lets apply it to some code and take a 12bit reading from a 10bit ADC!

#define BUFFER_SIZE 16 // For 12 Bit ADC data

volatile uint32_t result[BUFFER_SIZE];
volatile int i = 0;
volatile uint32_t sum=0;

void setupADC(uint8_t channel, int frequency)
{
  cli();
  ADMUX = channel | _BV(REFS0);
  ADCSRA |= _BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0) | _BV(ADATE) | _BV(ADIE);
  ADCSRB |= _BV(ADTS2) | _BV(ADTS0);  //Compare Match B on counter 1
  TCCR1A = _BV(COM1B1);
  TCCR1B = _BV(CS11)| _BV(CS10) | _BV(WGM12);
  uint32_t clock = 250000;
  uint16_t counts = clock/(BUFFER_SIZE*frequency);
  OCR1B = counts;
 
  TIMSK1 = _BV(OCIE1B);
  ADCSRA |= _BV(ADEN) | _BV(ADSC);
  sei();
}

ISR(ADC_vect)
{
  result[i] = ADC;
  i=++i&(BUFFER_SIZE-1);
  for(int j=0;j   {
    sum+=result[j];
  }
  if(i==0)
  {
   /****DEAL WITH DATA HERE*****/
    sum = sum>>2;
    //Serial.println(sum,DEC);
    pHRaw = sum;
  }
  sum=0;
  TCNT1=0;
}
ISR(TIMER1_COMPB_vect)
{
}

Not only are we oversampling but this code creates a Timer triggered ADC port that gets us an accurate sampling frequency and allows us some space in our main loop to do some work with our results! There really inst much to this in terms of the oversampling, We fill a 16 sample wide buffer, once full we add the the results together and bit shift the sum 2 places to get us scaled back to 12bits, Pretty neat! For more detail about interrupts, ISRs and timer triggered ADCs check out the Arduino and AVR forums!

As a last step lets plug this code into one of our pH units and see how it performs, Instead of 1024 steps our new result will be 4096steps and we’ll expect numbers like 2048 instead of 512!

Tags:
Categories:
Location: Blogs Parent Separator Main Blog

1 comment(s) so far...


Gravatar

Re: Oversampling to enhance ADC resolution

Sir, could you please explain how or why you assign clock= 250000 and is the timer set to give a constant noise to AREF pin as described in the avr121 application note?? And can i implement this program with minor changes to over sample to 16 bit resolution on a atmega32 chip??

By S Gowri Shankar on   1/19/2013 9:40 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
2012 Sparky's Widgets
chanel coach replica designer handbags wendyreplica replica watches australia replica rolex gucci handbags