Shop OBEX P1 Docs P2 Docs Learn Events
Very Low Frequency Sine - Correction! — Parallax Forums

Very Low Frequency Sine - Correction!

ArchiverArchiver Posts: 46,084
edited 2003-06-13 21:18 in General Discussion
Due to a minor program error the Table below was incorrect.

>res STEP (deg) steps/period
> 8-Bit 0.2297 1,567
>10-Bit 0.0565 6,371
>12-Bit 0.01404 25,643
>16-Bit 0.0008697 416,046

'
QB program below line
CLS
Bits = 16
Pi = ATN(1) * 4
N = 2 ^ Bits
Count = 0
Increment = .0008697
FOR Deg = Increment TO 360 STEP Increment
rad = (Deg / 180) * Pi
OldX = X
X = INT(SIN(rad) * N)
IF (X - OldX) > 1 THEN
PRINT Count, X, Deg
END IF
Count = Count + 1
NEXT Deg
PRINT "
"
PRINT Count, X, Deg
'
QB program above line


>3 min = 180 sec = 0.00555Hz
>5 min = 300 sec = 0.00333Hz
>
>...So the fundamental frequency for a 3 min Period @ 16_bit
>resolution would be...
>(.00555 x 416,046) = 2,309 Hz
>
>...for a 5 min Period @ 16_bit this works out to...
>(.00333 x 416,046) = 1,385 Hz
Sign In or Register to comment.