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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/31/05 17:04
Read: times


 
#94156 - Lookup table
Responding to: ???'s previous message
I've done a couple of AC rms measurement projects, and have *never* used floating point. Integer arithmetic is fine if you watch what you're doing (overflow and the like).

One of my projects used a lookup table to handle the square root function. I had the advantage that I know the range of values I was dealing with, so my table only covered those values. On the next project I had a different compiler which had an integer sqrt function, so I used that.

By taking my samples every 277.77us I was able to take 60 samples per cycle (with 60Hz power). I had a little state machine to watch for zero crossings, start sampling immediately after the first crossing, stop after the second. Integer arithmetic provided the rms value I was looking for, and the number of samples gave me the frequency.

Dennis

List of 20 messages in thread
TopicAuthorDate
RMS Calculation            01/01/70 00:00      
   Going back to basics...            01/01/70 00:00      
   How Many Samples Per Second?            01/01/70 00:00      
   Square Root Algorithm            01/01/70 00:00      
   RMS for sinusoidal signals            01/01/70 00:00      
      Clarification            01/01/70 00:00      
         I beg a question...            01/01/70 00:00      
            Full o' holes            01/01/70 00:00      
            Bang on target...            01/01/70 00:00      
         thats true...            01/01/70 00:00      
   RMS Value            01/01/70 00:00      
      Please elaborate more...            01/01/70 00:00      
         Elaboration            01/01/70 00:00      
            Correction            01/01/70 00:00      
               DC+AC RMS            01/01/70 00:00      
                  DC contribution to total rms value            01/01/70 00:00      
            Thanx Anywayz...            01/01/70 00:00      
               square root by Newton's Rule            01/01/70 00:00      
               Lookup table            01/01/70 00:00      
                  better option...as of now            01/01/70 00:00      

Back to Subject List