Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/13/07 06:02
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#144544 - Getting rid of the flutter
Responding to: ???'s previous message
This is typical for ADC's, and you should never use one and expect a reading which doesn't flutter. If you do, you're naive.

So how to get rid of this? Most people will tell you you should apply averaging or such. Essentially this will act like a low-pass filter. But the problem is that the flutter is essentially noise, and contains very low frequency components. So averaging will get rid of quick fluctuations, but it will still give you slow ones.

I once had a chat with a manufacturer of digital mixing consoles, and we talked about how to read the faders, and how to get rid of ADC flutter there. Surprisingly, he had devised a mechanism which was identical to a mechanism I had also developed and applied in some device of my own. To give an analogy, this mechanism imitates the slack you have on an analog potentiometer. Turning the shaft a little will not move the wiper. Only if you turn past the slack, the wiper will follow. Remember that this algorithm works miracles when it comes to clean up flutter from reading potentiometers and such, but it should never be used as a noise suppression algorithm on signals.


; if |current-previous| > slack
; 	if (current-previous) > 0
; 		previous = current - slack
; 	else
; 		previous = current + slack

			bseg

dir:			dbit	1

			dseg

current:			db	1
previous:			db	1

			cseg

			mov	a,current		; current should be a buffered reading
			clr	c
			subb	a,previous		; current - previous = change
			mov	dir,c			; dir set if change was down
			jnc	absignend		; calculate absolute value of change
			cpl	a
			inc	a
absignend:		cjne	a,#slack,tresadc	; Compare change to slack
tresadc:		jc	endadc			; if not changed more than slack, ignore
			mov	a,current		; remember current value
			jb	dir,addtresh		; If change is up, compensate down
			clr	c
			subb	a,#slack
			sjmp	storeprevious
addtresh:		add	a,#slack		; If change is up, compensate up
storeprevious:		mov	previous,a		; Store calculated value

endadc:							; Your new value now in a.



List of 65 messages in thread
TopicAuthorDate
Cant solve, trouble midi controller with adc0804            01/01/70 00:00      
   Some suggestions            01/01/70 00:00      
      Average read            01/01/70 00:00      
   Breadboard ?            01/01/70 00:00      
   Getting rid of the flutter            01/01/70 00:00      
      Averaging            01/01/70 00:00      
         Trying to understand            01/01/70 00:00      
            |Caps            01/01/70 00:00      
            Re: Trying to understand            01/01/70 00:00      
            everything there applies and is exasperated ...            01/01/70 00:00      
               words!            01/01/70 00:00      
                  thanx            01/01/70 00:00      
      Tried your method            01/01/70 00:00      
         Re: Tried your method            01/01/70 00:00      
            Your method            01/01/70 00:00      
               Relocatable assembler ?            01/01/70 00:00      
                  re: Relocatable assembler            01/01/70 00:00      
                     Relocatable assembler            01/01/70 00:00      
                        Examples            01/01/70 00:00      
                           essentially, yes            01/01/70 00:00      
                        You mean...            01/01/70 00:00      
                           Yip            01/01/70 00:00      
                              Am I doing wrong?            01/01/70 00:00      
                                 ds            01/01/70 00:00      
      changed the code, but cant debug!            01/01/70 00:00      
         Re: changed the code, but cant debug!            01/01/70 00:00      
            Certainly it isnt READ            01/01/70 00:00      
               RE: Certainly it isnt READ            01/01/70 00:00      
                  Here goes the code. Thanks for all help            01/01/70 00:00      
                     Pascal            01/01/70 00:00      
   does 'everything' include reading ...            01/01/70 00:00      
   Example?            01/01/70 00:00      
      Simple!            01/01/70 00:00      
         That is all??            01/01/70 00:00      
            Discard LSB for MIDI            01/01/70 00:00      
               He is using Pots            01/01/70 00:00      
                  Vref needs to be solid            01/01/70 00:00      
                     not necessafrily            01/01/70 00:00      
                        OK it's good half the time            01/01/70 00:00      
            Averaging, "dead zone"            01/01/70 00:00      
               No disagree...            01/01/70 00:00      
   Discarding the lsb!            01/01/70 00:00      
      What is Vref            01/01/70 00:00      
         Vref            01/01/70 00:00      
      MIDI power source            01/01/70 00:00      
         Re: MIDI power source, provides power.            01/01/70 00:00      
            re: MIDI power source, provides power.            01/01/70 00:00      
               re: MIDI power source            01/01/70 00:00      
                  Stealing MIDI power            01/01/70 00:00      
                  +5V power on the MIDI connector            01/01/70 00:00      
   Pot matrix? Is possible?            01/01/70 00:00      
      No!            01/01/70 00:00      
         How could I do?            01/01/70 00:00      
            One 4051 for each group of 4 trimmers...            01/01/70 00:00      
      History Lesson            01/01/70 00:00      
         ->Grant            01/01/70 00:00      
   LCD Upgrade            01/01/70 00:00      
      Pull Ups            01/01/70 00:00      
         Thanks Neil, 10k works 100%            01/01/70 00:00      
   How to control CS EN lines...            01/01/70 00:00      
      Google            01/01/70 00:00      
         YEAH!!!            01/01/70 00:00      
            Watch the output polarity            01/01/70 00:00      
      74HCT237            01/01/70 00:00      
   Quality            01/01/70 00:00      

Back to Subject List