Changeset 40291 for trunk/Ohana/src/opihi/cmd.data/test/periodogram.sh
- Timestamp:
- Dec 13, 2017, 10:53:48 AM (9 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/opihi/cmd.data/test/periodogram.sh (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
trunk/Ohana/src/opihi/cmd.data/test/periodogram.sh
r40165 r40291 209 209 # test using fewer random samples, high frequency, non-zero DC, some noise 210 210 macro test8 211 if ($0 != 2)212 echo "USAGE: test8: Ndays")211 if ($0 != 4) 212 echo "USAGE: test8: Period Ndays df" 213 213 break 214 214 end 215 215 216 216 local Ndays 217 $Ndays = $1 218 219 $PASS = 1 220 break -auto off 221 222 local P PI 223 $PI = 3.14159265359 224 $P = 0.8*rnd(0) + 0.2 217 $P = $1 218 $Ndays = $2 219 $dM = $3 220 221 $PASS = 1 222 break -auto off 223 224 local PI 225 $PI = 3.14159265359 225 226 $trueP = $P 226 227 … … 230 231 231 232 # t is a time in days, but we always have 4 within 1 hour: 232 set t 0 = int(100 * rnd(x))233 set dtx = (3/24) * rnd(x) 234 set t0 = t 0+ dtx233 set tday = int(100 * rnd(x)); # choose Ndays random days between 0 and 100 234 set dtx = (3/24) * rnd(x); # choose a starting time within that night 235 set t0 = tday + dtx 235 236 236 237 set dt1 = (15.0 / 1440) * rnd(x) + ( 0 + 7.5) / 1440 … … 244 245 set tmp = t0 + dt3; concat tmp t 245 246 246 set fraw = sin(2*$PI*t/$P) + 0.5247 set fraw = 0.75*sin(2*$PI*t/$P) 247 248 248 249 # 0.05 : peakpos = 14.95 249 250 # 0.10 : peakpos = 15.04 ( 250 gaussdev df t[] 0.0 0.25251 gaussdev df t[] 0.0 $dM 251 252 set f = fraw + df 252 253 … … 260 261 if (abs ($peakpos - $P) > 0.05) 261 262 $PASS = 0 263 end 264 if ($PLOT) 265 lim period power; clear; box; line -c red70 -lw 3 $P 0 to $P $peakval; plot period power -x line 262 266 end 263 267 end
Note:
See TracChangeset
for help on using the changeset viewer.
