Searching \ for 'frequency noise ?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=frequency+noise
Search entire site for: 'frequency noise ?'.

Truncated match.
PICList Thread
'frequency noise ?'
1998\01\27@125105 by Craig Niederberger

flavicon
face
Hi PIC gurus,

I have an application in which I need to determine the frequency of each
of the 8 lines on PORTB of a 1684.  Right now, my code simply counts for 3
signal transitions, and thus determines the period.  My problem is that
the signal transitions are noisy, especially at low frequencies.  Does
anyone have either (1) a good software algorithm for debouncing the signal
transitions, or (2) a good, simple, HW solution (the footprint must be
very small).

TIA,
Craig

1998\01\27@131011 by John Bellini

flavicon
face
Have you tried to decouple the lines with something like 0.1uf flm or
ceramic caps?  You might have to use smaller values if you need fast
transistion times.

> {Original Message removed}

1998\01\27@215244 by wft

face
flavicon
face
To smooth out transitions in the face of noise, it would be helpful to
know the range of frequencies monitored.  Why only three cycles?  What
does the noise look like.  Somethimes random noise included with the
signal will improve detection.
Wioth more info I may be able to make suggestions.  What is your
response time?  (Sample time to decision time.)
--
Gus Calabrese    Lola Montes      WFT Electronics
4337 Raleigh Street      Denver, CO 80212
303 964-9670......voicemail      spam_OUTwftTakeThisOuTspamfrii.com   http://www.frii.com/~wft

EMERGENCY:   791 High Street     Estes Park, CO  80517
if no success with .....wftKILLspamspam@spam@frii.com, try .... wftspamKILLspambigfoot.com   then
.....wftKILLspamspam.....eudoramail.com

1998\01\27@230812 by Pedro Drummond

flavicon
face
I have been through a very similar problem lately. Several friends helped
me, and Marc Heuler was specially helpful. You can contact him or me off the
list, if you wish.


Pedro.






At 11:45 27/01/98 -0600, you wrote:
{Quote hidden}

1998\01\28@203916 by Craig Niederberger

flavicon
face
> To smooth out transitions in the face of noise, it would be helpful to
> know the range of frequencies monitored.  Why only three cycles?  What
> does the noise look like.  Somethimes random noise included with the
> signal will improve detection.
> Wioth more info I may be able to make suggestions.  What is your
> response time?  (Sample time to decision time.)

Hi Gus, thanks for the response.

(1) Range of frequencies: about 150 Hz -- 150000 Hz

(2) 3 transitions for one cycle:

       ...........         ..........
       |         |         |
       |         |         |
 ......|         |.........|
       1         2         3

  Right now, that's all I'm measuring, but the noise is interfering
  with the signal.  I'm open to any SW/HW suggestion.  The problem is
  that I'm seeing noise primarily at *low* freqencies, around the edges
  of each transition.  At high frequencies, the transitions are pretty
  stable.

(3) The noise looks like jagged high frequencies as the transition edges
  low freqency signals.

(4) Response time preferably no more than .025 msec.

Thanks again,
Craig

1998\01\28@221100 by sdattalo

face
flavicon
face
Craig Niederberger wrote:
{Quote hidden}

Craig,

For debouncing the edges you may want to take a look at:
http://www.interstice.com/~sdattalo/technical/software/pic/debounce.html

However, if the high frequency stuff around your low frequency edges is
less than 150kHz, then this software debouncer will not work.

I thought about this "parallel frequency counter" thing for a bit
and thought of something that might be useful for your application
(but probably not for frequency counting in general). Think about
how a counter works. The n'th bit is toggle if all of the n-1 bits
are high and there is a request to count up, otherwise the nth bit
is unchanged. For example

 0101 ==> 0110
bit 0 and bit 1 are toggled
 0111 ==> 1000
bit 0,1,2, & 3 are all toggled

In boolean, we can say that the 4 bit counter is for example:
ABCD. Let's say that I is the input that indicates we want to
increment the counter (when I is high we increment when I is
low the counter remains unchanged). Then the equations can be
written:

 D+ = D ^ I
 C+ = C ^ (I&D)
 B+ = B ^ (I&C&D)
 A+ = A ^ (I&B&C&D)

Now what's neat about this, is that we can handle all eight
inputs simultaneously. In other words, we can allocate/name
a PIC register 'D' and let it hold all 8 of the LSB's, let
'C' hold the next LSB etc. I call these vertical counters
(although there may be a more appropriate name) because if
you view the RAM they occupy as a stack, then the counter
bits are grouped vertically instead of the more familiar
horizontal-single-register way. For a slightly less botched
explanation, check out:

http://www.interstice.com/~sdattalo/technical/software/pic/vertcnt.html

At any rate, we can write:

      MOVF   PORTB, W

 ;debounce ....

 ;with debounced value in W

      XORWF  last_value,W   ;Get the changes from last time
      XORWF  last_value,F   ;Save this sample for next time
                            ;note (A^B)^A == B

      MOVWF  I
      ANDWF  B,W
      ANDWF  C,W
      ANDWF  D,W
      XORWF  A,F

      MOVF   I,W
      ANDWF  C,W
      ANDWF  D,W
      XORWF  B,F

      MOVF   I,W
      ANDWF  D,W
      XORWF  C,F

      MOVF   I,W
      XORWF  D,F

And you can check for rollovers like so with this chunk
just before you increment the counters.

      MOVF   I,W
      ANDWF  A,W
      ANDWF  B,W
      ANDWF  C,W
      ANDWF  D,W

There's another way to implement this vertical counter
that's slightly less efficient, but handles the rollover
case much better. But damn, I'm way too busy now.

Hope this is of some use.

Scott

1998\01\29@153451 by Mike Keitz

picon face
On Wed, 28 Jan 1998 19:34:14 -0600 Craig Niederberger
<EraseMEcraignspam_OUTspamTakeThisOuTGODOT.UROL.UIC.EDU> writes:

>   that I'm seeing noise primarily at *low* freqencies, around the
>edges
>   of each transition.  At high frequencies, the transitions are
>pretty
>   stable.

The usual method of "debounce" is to ignore transitions for a period of
time after the first one (the one that is counted).   The period of time
used is of course limited by the maximum rate of transitions in a valid
signal.  If your low-frequency signals have a "noise" component below the
highest frequency to be accepted, there is no way to tell them apart.

Usually in a period measurement only edges of one polarity are
considered.  Then, variations in the duty cycle of the signal are
rejected.

Doing even a simple period measurement (no noise rejection) at 150 KHz on
8 inputs simultaneously seems impossible.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\01\29@215200 by sdattalo

face
flavicon
face
Yesterday I wrote:

{Quote hidden}

I'm still too busy, but...


       MOVF   PORTB, W

  ;debounce ....

  ;with debounced value in W

       XORWF  last_value,W   ;Get the changes from last time
       XORWF  last_value,F   ;Save this sample for next time
                             ;note (A^B)^A == B

  ;W contains what we were previously calling 'I'.

       XORWF  D,F    ;D+ = D ^ I

       XORLW  0xff   ;W = ~W = ~I
       IORWF  D,W    ;W = ~I | D+ = ~I | (D^I)
       XORLW  0xff   ;W = ~(~I | (D^I))
                     ;  = ~(~I | ~D&I | D&~I)
                     ;  = ~(~I | ~D)
                     ;  = I&D    boolean magic!

       XORWF  C,F    ;C+ = C ^ (I&D)
       XORLW  0xff   ;W = ~W = ~(I&D)
       IORWF  C,W    ;W = ~(I&D) | D+ = ~(I&D) | (C^(I&D))
       XORLW  0xff   ;W = ~(~(I&D) | (C^(I&D)))
                     ;  = ~(~(I&D) | ~C&(I&D) | C&~(I&D))
                     ;  = ~(~(I&D | ~C)
                     ;  = I&C&D

       XORWF  B,F    ;B+ = B ^ (I&C&D)
       XORLW  0xff   ;
       IORWF  B,W    ;
       XORLW  0xff   ;W = I&B&C&D

       XORWF  A,F    ;A+ = A ^ (I&B&C&D)

Which is the first routine I think I've ever written that
contains only XOR's and IOR's.

Again, I don't know if this is useful, but it's sort of neat
none-the-less.

Scott

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...