CPOD hardware From 1 488 To 488 onwards Exceptions Notes V0 hydrophone – main td plus narrow td V1 hydrophone – main td plus very narrow (6.5) 1 125 124 onwards 104? File structure 0 File structure 1 488 1 536 537 onwards Some under 120? Were set up with high sensitivity settings Narrow boards V0 operational config. BW 30, weak 4, strong 255, HRI 0/128, start amp 1, min amp 3, min max 12. V1 operational config. BW 22, weak 8, strong 50, HRI 3, start amp 1, min amp 3, min max 3. C.POD Files *.CP1 RAW clicks *.CP2 Clusters marked *.CP3 Trains marked *.CP4 Environment Bytes 1..360 or 720 header 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Click record CP1 version0 StartMSB Start StartLSB Ncyc BW avF endF Pmax P1 P5 CP1 version1 StartMSB Start StartLSB Ncyc BW avF endF Pmax slope dodgy F = endF Minute record 15 14 HP status 2LSB Optional minute meta data EOF marker Temp 20 Noise Last t Nclx 254 253 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 Click records First TDA version + CP1 same 0 1 T1 1 2 T2 2 3 T3 3 4 Ncyc 4 5 BW 5 6 avF 6 7 EndF 7 8 Pmax 8 9 Envelope 2 vals 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 Angle CP2 click records pt1 = 0; pt2 = 1; pt3 = 2; pNcyc = 3; pBW = 4; pavF = 5; pEndF = 6; pPmax = 7; pSlope = 8; // to 2 values pNinClstr = 9; pClstrDur/slope 10; // expands ptCyc = 11; // expands pFmin = 12; pFmax = 13; pFdiff = 14; pFband = 15; pPreICI = 16; // expands pPmin = 17 pClstrSts = 18; pClass = 19; CP3 same except: Sp … later Q Class Sp Class and 128 to mark prior virtual Trn 5..127 CLICK Second TDA version CP22 0 T1 1 T2 2 T3 3 Ncyc 4 BW 5 avF 6 EndF 7 SPL 8 Envelope 2 vals 9 BandKhz, if in a band, otherwise 0 10 NinClstr 11 Dur/slope // expands 12 UPsteps + nFusedCls in 3 MSB 13 cSlope 14 MxCycDvSPL0 highest value of (Ncyc* 32 / SPL) 15 nBW0, 2bits, BW1 3bits, BW2 3bits 16 Fmin in cluster 17 Fmax in cluster 18 nCycFused 19 cFav 20 PreICI // expands 21 cPmin 22 cPmax 23 24 NinClstr 25 Dur/slope // expands 26 UPsteps + FusedCyc in 3 MSB 27 cSlope 28 MxCycDvSPL1 highest value of (Ncyc* 32 / SPL) 29 nBW0, 2bits, BW1 3bits, BW2 3bits 30 Fmin 31 Fmax higher frequency of two loudest clicks if both above 50 32 Fdiff 33 cFav 34 PreICI // expands 35 cPmin 36 37 38 39 cPmax BandN CP3 Click params Click params Click params Click params Click params Click params Click params Click params Click params Clstr params from Clstr selected Clstr params from Clstr selected Clstr params from Clstr selected Clstr params from Clstr selected Clstr params from Clstr selected Clstr params from Clstr selected Clstr params from Clstr selected Clstr params from Clstr selected Clstr params from Clstr selected tcFrange bits in 7 LSB NarrowBand in MSB Clstr params from Clstr selected Blank – preICI is still there but could be re-used Clstr params from Clstr selected Clstr params from Clstr selected p0ClstrSts NinTrain avF avPRF msb avPRF lsb GdID[1] GdID[2] GdID[3] GdID[4] WUTrisk 2LSB Marked = MSB BandN bits 0..2 Preceding gap = MSB Qclass / RateQ / SpQ / SpClass p1ClstrSts TrainSpN EncSpN NrType Byte 36 Qn:= RateGood:= SpGood:= SpClass:= b and 3 ; // Qn xx Boolean(b and 4 shr 2) ; // Sp good Boolean(b and 8 shr 3) ; // rate good tSpClass(b and 240 shr 4); // Sp n minute 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 CP22 minute NofBands avSPLBand0 Temp deg C Angle Noise Time of last click Nclicks MSB Nclicks LSB Band0 kHz mode Band1 kHz mode Band2 kHz mode Band3 kHz mode Band4 kHz mode Band0 SonarRisk Bands Sonar Low Risk 1-4 2 bits cyc and ICI risk for each band Bands Sonar High Risk 1-4 2 bits cyc and ICI risk for each band SedNoise kHz AdjacentMinSonarRisk 1 = present any more = khZ Band0SumOfGaps Band1SumOfGaps Band2SumOfGaps Band3SumOfGaps 30 31 32 33 34 35 36 37 38 39 Band4SumOfGaps Band0NofClstrs Band1NofClstrs Band2NofClstrs Band3NofClstrs Band4NofClstrs minute records CP2 minute holds values derived from CP1 0 HP status 1 sonar risk 2 3 Temp deg C 4 Angle 5 6 Time of last click 7 Nclicks total – expands. 255 if = logging limit 8 Nclicks 120 - 160kHz - expands 9 NcycRatio <120khz> - 4 bits each low freq in low bits 10 11 12 Band0 F cancelled 13 Band1 F cancelled 14 Band2 F cancelled 15 Band0 SonarRisk 16 Band1 SonarRisk 17 Band2 SonarRisk 18 19 254/255 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 CP22 minute NofBands Not used Temp deg C Angle Time of last click Nclicks MSB Nclicks LSB Band0kHz mode Band1kHz mean Band2kHz mean Band3kHz mean Band4kHz mean Band0 SonarRisk Bands 1,2 Sonar risk Bands 3,4 SonarRisk SedNoise kHz NinBand1 NinBand2 NinBand3 NinBand4 CP3 repeats CP1 params, plus 0 1 2 3 4 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 Not used Temp deg C Angle Not used Time of last click Nclicks MSB Nclicks LSB Not used NCetHi – expands base 8 instead of 16 NTrn – expands base 8 instead of 16 Band0kHz mode Band1kHz mean Band2kHz mean Band3kHz mean Band4kHz mean Band0 SonarRisk Bands 1,2 Sonar risk Bands 3,4 SonarRisk RampTrend SedNoise kHz Vis sp1 Vis sp2 Vis sp3 Vis sp4 Vis sp5 Vis sp6 CP3 files Byte 19 Bits 1,2 Qclass. 3=Hi, 2=Lo, 1=?, 0=?? Bits 3,4,5 SpClass 0=Porp, 1=Dol, 2=otherCet, 3=non cet , 4=unknown Byte 20: Train Number 5..127 HPstatus: // 0 = no HP, 1 = HP possible, 2 = HP probable TrnStatus: to include # reliable rate from low iici and other params # reliable sp group # reliable sp? # sonar risk # previous click is virtual set Hi bit to 1 RecType values Fused out 0 Clstr member 1 Free 2 Lone 3 Sentinel 4 Train N 5..127 not allocated 129.. 252 Defective 253 as Clstr status for Clstr1 this means the click is not within the band Minute 254 End 255 SpN Species Number 0 0 unclassified NBHF NBOtherF BB low Boat sonars 'harmonic' sonars Slope 0..6 P1 > P5 7 PI = P5 8..15 P5 > P1 So line can be drawn by adding (slope – 7) to Y value MSB 4 bits of slope is Pmax * 2 div P5 ClassID / TrN 0 Fused out 1 members 2 Free Range 3 Sentilones 4 Sentinels 21 22-26 27-46 47-66 67-96 97-127 128-253 254 scratcher trains Unallocated weirdos ?? ? CetLo CetHi unallocated Minute marker 255 File end marker Clusters: . Cluster number (ClstrN) Bit allocation: Bit 1 = 0 – sole click, not in a cluster Bit 1 = 1 – within a cluster, not the first - so these form continuous runs, including all fusedout clicks Bits 2,3,4,5 = compressed cluster size stored in sentinel click, mean click maxPk in the rest. Cluster Slope Bits 6,7,8 = cluster pk slope. 0 = initially lower 1 = no slope 2..7 = greater slopes, initially higher Pre3msCoFcyc: The number of same-freq cycles/10 in the first 3ms time before the start of the click is stored with: Pre2CoFtime: The number of all click cycles in the 10ms before. PreMult: Pre2CoFtime on a log scale as the 4 higher bits of byte 13 + with Pre3msCoFcyc on a non-linear scale as the 4 LSB Pre2CoFtime 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 mS <1 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 FiveMuSecs <200 200 400 800 1600 3200 6400 12800 25600 51200 102400 204800 409600 819200 1638400 Max Lapse reject 200 400 800 1600 3200 6400 12800 25600 51200 102400 204800 409600 MaxLapse MaxLapse Fused stores n of cycles of same F / constFusedGapCycles that follow with no gaps longer than constFusedGapCycles. PostF is the av frequency of the first non CoFre click starting within constFusedGapCycles. It is there to help identify any bimodal pattern. BW = mean diff between Zs 2..5 Target = 12.5% of mean Z Mean is taken when there are 4, 8 or 16 diffs Freq groups – kHz 7 lo hi width 20 29 10 30 44 15 45 64 20 65 89 25 90 119 30 120 149 40 >150? PRF groups 8 PRF > range 0 3.333333 10 30 90 270 810 2430 range/prev range 3.33 6.67 2 20 3 60 3 180 3 540 3 1620 3 Very slow Slow Slow Medium Fast Medium Fast Buzzes Very fast Extremely fast Click Selection (tcAllClx, tcAllTrains, tcBoatSonar, tcNonCet, tcDoubtfulCet, tcCetLo, tcCetHi); ClickClass 0 subsid 1..10 n in cluster 11.. kHz 20 40 50 100 125 150 200 ZCI full cycle 250 125 100 50 40 33 25 ZCI to Freq ZCI 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 kHz 200 192 185 178 172 166 161 156 151 147 142 138 135 131 128 125 121 119 116 113 111 108 106 104 102 100 98 96 94 The values here are a pair of successive ZCIs summed ZCI 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 kHz 92 90 89 87 86 84 83 81 80 79 78 76 75 74 73 72 71 70 69 68 67 66 65 64 64 63 62 61 60 ZCI 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 kHz 60 59 58 58 57 56 56 55 54 54 53 53 52 52 51 51 50 50 49 49 48 48 47 47 46 46 45 45 45 ZCI 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 kHz 44 44 43 43 43 42 42 42 41 41 40 40 40 40 39 39 39 38 38 38 37 37 37 37 36 36 36 35 35 ZCI 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 kHz 35 34 34 34 34 34 33 33 33 33 32 32 32 32 32 31 31 31 31 31 30 30 30 30 30 29 29 29 29 ZCI 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 kHz 29 29 28 28 28 28 28 28 27 27 27 27 27 27 27 26 26 26 26 26 26 26 25 25 25 25 25 25 25 ZCI 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 kHz 25 24 24 24 24 24 24 24 24 23 23 23 23 23 23 23 23 23 22 22 22 22 22 22 22 22 22 22 21 ZCI 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 kHz 21 21 21 21 21 21 21 21 21 21 20 20 20 20 20 20 20 20 20 20 20 20 Train detection For DD2 a click-centred view is added: Fusion groups: The duration of continuous same-frequency sound with no gaps longer than n (5?) cycles is found and stored as a fusion group length measured in 5-cycle units. The frequency match and cycle lengths used are based on the first click, and do not change. It is just possible for a higher frequency click to remain in the record within the time span of a lower freq fusion group, and this may happen. PreMult: Pre3.2 The number of cycles / const of same freq in the first 3ms before the start of the click is stored as the 4 lower bits of byte .. Pre2CoFtime: The time to find 2 preceding slicks of the same F. stored as the 4 higher bits of byte Scaled as ^2.. Q: should the PreMults be frequency specific? Probably yes, but make this optional. Probability modelling: During train finding log A. the sum of ABS differences between the longest periods with no frequency-eligible clicks in successive ICIs. B. the sum of ABS differences between successive ICIs. C. the number of frequency-eligible clicks. B/A will be high when it is noisy, but will fall when it is very noisy. C will rise when it is very noisy or when there are big multi-path clusters Big multi-path clusters will be shown by high values for fusion group length, or low values for PreMult / fusion group length. So a 3D descriptor should be possible. ? will fusion group length do the job, or should there be a PostMult count? File Structure Structure of file on PC = HdrBuf FileStructure codes 0. original .cp1 form with P1, P5, 1. slope version. WeakLimit: Clicks are logged if StrongLimit (Actual Ncyc - 2) + pMax shr 1 > = weak limit Header size = 360 for CP1 and older CP2 and CP3 files, 720 for newer CP2 and CP3 files FILE STRUCTURE V1 V0 0 same HeaderSize div 10 or RecBytes 1 same RecBytes 2 FileStructure code LSBits 0, 1, as in this table 2 is different in CP2 and CP3 files 3 4 same RateRampsMarked = 1 5 CP3 shortened = 1; 6 CP2_3StructureVersion 0 original, 2 introduced with TDAversion in 293 TDA version 2 7 same Species classification version – POD.exe versions 255=user classification. Details in extended header 8-12 BYTE 8 must be a letter 0 DEPLOYMENT LOCATION 13,20 same LAT 21,28 same LONG 29,30 same Depth of deployment m MSB first 31,32 same Depth of water m 33-63 same Location SETTINGS USED 64 Switch threshold from (0 to 180 ≡ 0 to 255, but sin) User Gain – Use EEPROM value if zero 65 Switch threshold to (0 to 180 ≡ 0 to 255, but sin) User Hysteresis – Use EEPROM value if zero 66 Number of minutes asleep (0 to 10) Switch threshold from (0 to 180 ≡ 0 to 255, but sin) 67 0 Switch threshold to (0 to 180 ≡ 0 to 255, but sin) 68 Delay to logging start (0 to 65536 minutes) Number of minutes asleep (0 to 10) 69 Delay to logging start (0 to 65536 minutes) 0 70,71 Delay to logging end (0 to 16,777,215) Delay to logging start (0 to 65536 minutes) 72 Delay to logging end (0 to 16,777,215) Delay to logging end (0 to 16,777,215) 73-74 Maximum file length in blocks (0 to 1.07 × 109) Delay to logging end (0 to 16,777,215) 9 75 Maximum file length in blocks (0 to 1.07 × 10 ) Maximum file length in blocks (0 to 1.07 × 109) 9 76 Maximum file length in blocks (0 to 1.07 × 10 ) Maximum file length in blocks (0 to 1.07 × 109) 77 User Gain Maximum file length in blocks (0 to 1.07 × 109) 78 79 80 81 82 83 84 85 86 87 88 User Hysteresis Filter Selection 0 same Low ZCI Start (0 to 63) High ZCI Start (0 to 255) same Minimum amplitude (0 to 255) Half range add on (0 to 31) Bandwidth threshold (0 to 31) Minimum cycles in any click (0 to 15 not previously accessible?) 89 MiniMax peak (0 to 255) 90 Weak limit 91 Strong limit 92 Alerting Frequency (0 to 255, 0 = off) 93 Trigger Amplitude 94 Trigger Ncyc Count 95 Trigger First ZCI 96 Trigger Last ZCI 97-98 Minimum Trigger Count 126-127 same SUMMARY OF DATA LOGGED 128-131 same 132-134 same 135-137 same 138-140 same 141 same 142,143 0 POD IDENTIFIERS and DEFAULT SETTINGS 144,145 same 146,147 same 148,150 0 152-159 0 160-163 same 164-67 same 168 0 169 0 170 same 171 same 172 same Maximum file length in blocks (0 to 1.07 × 109) 0 Filter Selection (0 to 3) Minute limit – (No limit, 1024, 4096, 65536. Store 2 bit code) Minimum amplitude (0 to 255) MinMax peak (0 to 255) Minimum start amplitude Bandwidth threshold (0 to 31) Low ZCI Start (0 to 63) High ZCI Start (0 to 255) Trigger Ncyc count Trigger First ZCI (0 to 255) Trigger Last ZCI (0 to 255) Min Trigger Count (0 to 255) – 0 = off Alerting enable On / Off ≡ 0 or 1 Alerting Frequency (0 to 255) 0 0 0 0 POD number from SD card N of clicks in CP1 file Minute number at exit Minutes logged Total minutes truncated Raw File structure version 0 PIC Software version number CPLD Firmware version number Invoice number 0 Year of manufacture POD number EEPROM MainBoardVersion PreampVersion Amplifier ID ADC ID Processor ID 173 174 175 176,177 178,179 180 181,182 183,184 185-191 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212,213 214 215 216 same same same same same same same same 0 POD version Default User Gain Default User Hysteresis Default Filter Selection (0 to 3) 0 Default Minute limit – (No limit, 1024, 4096, 65536. Store 2 bit code) Default Low ZCI Start (0 to 63) Default High ZCI Start (0 to 255) Default Minimum start amplitude Default Minimum amplitude (0 to 255) Default Half range add on (0 to 31) Default Bandwidth threshold (0 to 31) Default Minimum cycles in a click (0 to 15) Default Minimum peak (0 to 255) Default Weak limit Default Strong limit Default Alerting Frequency Trigger Amplitude Trigger ZCI Count Trigger First ZCI Trigger Last ZCI these are all overwritten Minimum Trigger Count 0 0 Self Calibration Mode, gain. 0 – not calibrated, 2 – calibrated OK. 8 – failed at maximum, 9 – failed at minimum. CPLD ID Transducer ID G sensor ID G sensor offset G sensor scale Temperature sensor ID Temperature sensor offset Temperature sensor scale 0 POD version Default Gain Default Hysteresis Default Filter Selection Default Minute Limit Default Minimum Amplitude Default Minimum Peak Default Minimum Start Amplitude Default Bandwidth Threshold Default Low ZCI start Default High ZCI start 0 0 0 0 0 0 Self Calibration Mode. LS 4 bits Gain, MS 4 bits Hysteresis. 0 do nothing, 1 – request calibration, 2 – calibrated OK. 8 – failed at maximum, 9 – failed at minimum. Calib target clicks in 10 seconds Calib target clicks in 10 seconds User Notes 211-255 User Notes User Notes User Notes User Notes 217,218 219 210,211 212,213 Gain amplitude calibration value used Self Calibration Mode, hysteresis. 0 – not calibrated, 2 – calibrated OK. 8 – failed at maximum, 9 – failed at minimum. Hysteresis calibration value used Auto-calibration code Actually all notes 241-255 256 unused DATES AND TIMES 256,259 same 260,263 same 264,267 same 268,271 same 272,275 same 276,279 same 292 293 294,295 310-312 nHiClx 313 SedNoiseFrac: all NBHF clks + SedN / CetAll 314-317 GoToMin 318-322 GoToFiveMuSec 323-325 nNBHFcetAll clicks 326-328 nNNcetAll clicks User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes User Notes unused FirstLoggedMin LastLoggedMin Min of creation Original FirstLoggedMin StoredFirstProcessMin StoredLastProcessMin SlopeFormatVersion UsedTDAversion File identifier two Char e.g. BL for Beluga 329-330 331-332 333 334 335 336 337 338 339 340..342 343 344-345 360-439 nNBWutRiskClks nNNWutRiskClks Av Angle Av temp range p2p8s Sed mins p2p8s Sonar mins p2p8s noisy mins NBnHiTrns NNnHiTrns nLoggingMins ModalNBHFkHz nAllClxPerHour SPECIES CLASSIFICATION GROUPS User defined species text, 8 chars each Block size on SD card 512 Hex 200000 blocks per GB Decimal 2,097,152 SETUP.CHE is at 32776 DATA0.CHE is at 32784 The alerting frequency works as follows: The 312.5kHz clock is multiplied by the number in bits 4..0 of the control byte, and divided by 64. It is also divided by a power of 2 according to bits 6..5 of the control byte. Bit 7 of the control byte doubles the output amplitude. With bits 6..5 = 00, the frequency is 4.88kHz with bits 4..0 = 00001, 9.76kHz at 00010, through to 151.36kHz with bits 4..0 = 11111. These frequencies are halved with bits 6..5 = 01, quarter when = 10, and an eighth when 6..5 = 11. Set as follows: 40kHz (39) 50kHz (48.8) 10 60kHz (58.6) 12 70kHz (68.3) 14 80kHz (78.1) 16 8 90kHz (87.8) 100kHz (97.6) 110kHz (107.4) 120kHz (122) 130kHz (131.8) 140kHz (141.5) 18 20 22 25 27 29 The serial cable. One end plugs into the board, the other to a serial port on a PC running Hyperterminal at 19200 baud, no handshakes. The switch must be on to enable serial communication, when the pod powers up. The LED supposedly flashes for each click in this mode (suspect not working), and the analogue circuits are powered up. To set the gain to hex 3A, for example, type: G 3 A <Return> The pod will respond with R if this is OK, E if not. This only sets the gain temporarily. To change the gain permanently it must be written into the EEPROM. Set the EEPROM gain address: A 0 8 <Return> (Confirm that 'R' is received) Set the gain value in EEPROM: E 3 A <Return> (Confirm that 'R' is received) If another write is sent to the EEPROM, without an 'A' command this will go to the next address, i.e. hysteresis. Revised gain on board 0002 Special Setup File for EEPROM & SW Loading A special SD card may be prepared for loading the EEPROM, PIC code or CPLD code from SD card data. The card is as follows: Byte Description 0-7 String, “Chelonia” 8,9 0xaa, 0x3c = 170, 60! 10 0xfx, where x is as follows: Bit 0 – Update EEPROM 240 Bit 1 – Update PIC 241 Bit 2 – Update CPLD 242 11 Checksum of all EEPROM data from 64 to 127 12 Checksum of all PIC data (Data blocks 0 – 63) 13 Checksum of all CPLD data (Data blocks 64 – 319) 14-17 Version number of EEPROM 18-21 Date of EEPROM data 22-25 Time of EEPROM data 26-29 Version number of PIC 30-33 Date of PIC data 34-37 Time of PIC data 38-41 Version number of CPLD 42-45 Date of CPLD data 46-49 Time of CPLD data 50-76 Not used (but 64-76 is used for checksum) 77 User Gain 78 User Hysteresis 79 Filter Selection (0 to 3) 80 Not used – set to zero 81 Minute limit – (No limit, 1024, 4096, 65536. Store 2 bit code) 82 Low ZCI Start (0 to 63) 83 High ZCI Start (0 to 255) 84 Minimum start amplitude 85 Minimum amplitude (0 to 255) 86 Half range add on (0 to 31) 87 Bandwidth threshold (0 to 31) 88 Minimum cycles in a click (0 to 15) 89 Minimum peak (0 to 255) 90 Weak limit 91 Strong limit 92 Alerting Frequency (0 to 255, 0 = off) 93 Trigger Amplitude 94 Trigger ZCI Count 95 Trigger First ZCI 96 Trigger Last ZCI 97,98 Minimum Trigger Count 99-127 Not used (Extra EEPROM) Only non-zero values will be written to the EEPROM – to avoid changing the EEPROM, set the value in the SD card to zero. Note that all values that may have a legitimate zero value are less than 8 bits long. Set the MSB to 1 to force a write of zero. The EEPROM data will be loaded first, then the CPLD, then the PIC. There must be no power outages during this process otherwise the system will be damaged. After programming the system will be locked up waiting for a power cycle. Issue 1 hardware does not support CPLD upgrade. To use this card power up the pod, and hold the button down while inserting the card. If the button is not down when the card is inserted it will be rejected as a faulty card. Data Files Each file runs into the next. The start of the first file stores a data block as follows: Byte Description 0-127 Setup data as above 128-131 Data blocks written 132-134 Minute number at exit 135-137 Minutes logged 138-140 Total minutes truncated 141 File structure version 142,143 Not used 144,145 PIC Software version number 146,147 CPLD Firmware version number 148-159 Not used 160-163 Year of manufacture 164-67 Unit number 168 Gain setting 169 Hysteresis setting 170 Amplifier ID 171 ADC ID 172 Processor ID 173 CPLD ID 174 Transducer ID 175 G sensor ID 176,177 G sensor offset 178,179 G sensor scale 180 Temperature sensor ID 181,182 Temperature sensor offset 183,184 Temperature sensor scale 185-191 Not used 192 Default Gain 193 Default Hysteresis 194 Default Filter Selection 195 196 197 198 199 200 201 202-207 208 Default Minute Limit Default Minimum Amplitude Default Minimum Peak Default Minimum Start Amplitude Default Bandwidth Threshold Default Low ZCI start Default High ZCI start Not used Self Calibration Mode. LS 4 bits Gain, MS 4 bits Hysteresis. 0 do nothing, 1 – request calibration, 2 – calibrated OK. 8 – failed at maximum, 9 – failed at minimum. 209-210 Expected clicks in 10 seconds There are the following two types of data record, plus an end-of recording marker. Minute Record One of these is recorded every minute starting at zero. Byte Description 0 254 (0xfe) =254 1-3 Minute number. MSB is set to a 1 if the previous minute truncated data Mod 128 is <3 2 Minute number 255 at 45.51 days 3 Minute number 4 Temperature to 0.2°C 5 Orientation, 0 – 255, maps to 0 – 180° Click Record Byte Description 0 Time in 5µs. MSB 1 Time in 5µs. 2 Time in 5µs. LSB 3 Zero crossings in this click 4 Bandwidth, (sum of first 10 zero crossing intervals) div 256 5 (sum of first 10 zero crossing intervals) mod 256 6 Last zero crossing interval 7 Maximum amplitude during click 8 Amplitude of first zero crossing 9 Amplitude of 5th zero crossing Max val 180 Min val 3 Min = ?? Min = Min = Min = End of Recording This is indicated by a single 0xff byte. In practice, the whole of the data file is initialised to 0xff, and some of it is overwritten. Detection algorithm This is the final + 1 version, in Pascal. Values * are set by the user for each run. Subtraction of 24 from ADC values has been implemented in the POD firmware, but is not included here. Byte values Constants that limit what is logged *MinAmp minimum peak height for any ZC admitted – currently 40 *constBWthreshold a user-defined small value in the range 0..4 *MinPeak smallest value of maximum peak in a click admitted *LowZciStart sets a range of starting values for a click *HiZciStart sets a range of starting values for a click *HalfRangeAddOn widens the range of acceptance of next ZCI *WeakLimit used to exclude short weak clicks *StrongLimit used to include strong 4 cycle clicks incoming data variables ZCI next ZCI between upgoing crossings Pk peak to peak amplitude process variables 8 bit ClkZCIMin a calculated range for acceptance of the next ZCI ClkZCIMax “ ClkZciCount the number of cycles in a click – limited to 255 halfrange part of calculating the acceptable ZCI range. May be unnecessary ClkBW a value for the bandwidth calculated when the number of ZCIs allows division to be by 4,8 or 16 ClkZciFirst only used for the external trigger ClkZciLast the last ZCI used to find the bandwidth ClkBWtarget a criterion for exclusion calculated using the ZciSum and the user defined BWthreshold value ClkMaxPk used to exclude too weak clicks ClkPk1 value of the first peak for use in the train detection on the PC ClkPk5 “ 5th SeqBroken true if any out of range ZCI occurs 1 bit process variables more than 8 bit ZciSum the sum of up to 8 ZCIs, excluding the first. 12 bit ZciAbsDiffSum total of absolute ZCI differences for calculation of BW (bandwidth) 10bit ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For each ZCI: If (ZCI < 24) or (ZCI > 255) or (Pk < MinPeak) then SeqBroken:= true; if (ClkZciCount > 0) then begin ongoing click present if (ZCI > ClkZCIMin) and (ZCI < ClkZCIMax) and (ClkZciCount < 255) and (not SeqBroken) new ZCI is in range for this click, so add this ZCI to ongoing click begin Inc(ClkZciCount); if ClkMaxPk < Pk then ClkMaxPk:= Pk; if ClkZciCount < 10 then Inc(ZciSum,ZCI); only 8 ZCIs are summed, numbers 2..9 if ClkZciCount < 18 then Inc(ZciAbsDiffSum,abs(ZCI - ClkZlast)); ClkZciLast:= ZCI; update bandwidth measure and value of 5th peak if ClkZciCount = 5 then ClkBWtarget:= ZciSum div 32 + constBWthreshold; = 1/8 of av of first ZCIs 2..5 + const if ClkBWtarget > 32 then ClkBWtarget:= 32; clkBW:= ZciAbsDiffSum div 4; clkPk5:= Pk; if ClkZciCount = 9 then clkBW:= ZciAbsDiffSum div 8; if ClkZciCount = 17 then clkBW:= ZciAbsDiffSum div 16; no further measurement of BW is made after zci17 calculate new range of acceptable ZCIs based on last. halfrange:= ZCI div 4 + halfRangeAddOn; addon makes selection more tolerant expecially at high frequencies ClkZCIMax:= ZCI + halfrange; limited to 255 ClkZCIMin:= ZCI - halfrange; allows clicks to go above initial frequency range end if (ZCI > ClkZCIMin) and (ZCI < ClkZCIMax) and (ClkZciCount < 255) and (not SeqBroken) else current click ended so evaluate this click for storage begin if (clkMaxPk > StrongLimit) then Dec(ClkZciLimit); If Strong limit is less than 255 it allows very loud, less tonal clicks to be stored. if ( (ClkZciCount > ClkZciLimit) and (clkBW < ClkBWtarget) and (clkMaxPk > MinAmp) and ((clkMaxPk div 2 + ClkZciCount) > WeakLimit) Weak limit rejects very weak clicks unless they are long. then store it begin if ClkZciCount < 10 then Dec(ZciSum,ClkZciLast); reduces noise from last zci value Buf[1]:= ClkStart div (256 * 256); Buf[2]:= (ClkStart mod (256 * 256)) div 256; Buf[3]:= ClkStart mod 256; Buf[4]:= ClkZciCount; Buf[5]:= ClkBW + (ZciSum div 256) * 32; Buf[6]:= ZciSum mod 256; Buf[7]:= ClkZciLast; Buf[8]:= ClkMaxPk; Buf[9]:= ClkPk1; Buf[10]:= ClkPk5; save these 10 bytes end; if (clkMaxPk > StrongLimit) then Inc(ClkZciLimit); restores normal value to ClkZciLimit ClkZciCount:= 0; end; zci out of clk range end; if (ClkZciCount > 0) start new click using rejected ZCI value if (ClkZciCount = 0) and (ZCI > 24) and (ZCI > LowZciStart) and (ZCI < HiZciStart) and (Pk > MinStartingPk) then begin ClkBWtarget:= 255; ClkBW:= 0; ClkZciCount:= 0; ZciAbsDiffSum:= 0; ClkZciCount:= 1; ClkZciFirst:= ZCI; ClkZciLast:= ZCI; ClkMaxPk:= pk; ZciSum:= 0; this omits the first value, which reduces noise ClkPk1:= Pk; halfrange:= ZCI div 4: ClkZCIMax:= ZCI + halfrange; might overflow 8bits but ClkZCIMin:= ZCI - halfrange; this allows clicks to go above the frequency limit set at the start. SeqBroken:= false; end; External Trigger Each click logged is tested against a set of parameters, and those passing the test are added to TriggerCount. If that exceeds a set value at the end of the minute an external logic level is set, if not it is cancelled. Trigger parameters TriggerCount *TriggerAmp *TriggerZciCount *TriggerFirstZCI *TriggerLastZCI *MinTriggerCount The test is: If ClkMaxPk > TriggerAmp and ClkZciCount > TriggerZciCount and ClkZciFirst < TriggerFirstZCI and ClkZciLast > TriggerLastZCI then Inc(TriggerCount) at minute end if TriggerCount > MinTriggerCount then SetTriggerON else SetTriggerOFF. TriggerCount:= 0 // A:(target + N * best) div (N + 1) gives a value between the two and as N gets larger it sticks closer to the latest value. Stays in 0-255 range. use for params with good trend // B:(target + best) div 2 ... mid point // C:(target * N + best) div (N + 1) gives a value between the two and as N gets larger it sticks closer to the older value. Stays in 0-255 range. Use for v noisy params // D: linear extrapolation is (2*Best - Target) ... can go negative or exceed 255 BUT TESTS BEST IN EXCEL // consider target values modified by deviation of last fit from target to model curves instead of just straight lines Notes Cluster finding PPrAddon: higher values give more clusters and more clicks. Useful range 10 to 100 MaxGap: big effect. More clicks in fewer clusters as value rises. Range 100 to 500 PPrthreshold ( ratio) less clusters and more click as value rises Range 1 to 4 Useful Numbers: 1GB per month = 3.3million clicks per day = 2300/minute To write 65536 clicks requires 81 write power cycles 1GB requires 122000 writes Baseline consumption 30mW Noise adds up to 25mW Write cycles add 90mW for 0.3 seconds = 27mW/s Power to write 1Gb = 1,000,000mW s = 274mW/h 4GB approx 1W/h Notes on data structure Clusters: duration weighted mean F is more coherent than amplitude weighted F Bandwidth BW for HP goes down with Ncyc up and maxSPL up. Same for BND but initially Ncyc going form 5 to 6 increases BW Median value of BW HP show fall with rising SPL from 11 to an asymptote of 5.5 BW limit is 1/8th av ZCI per cyc plus addon. 130kHz basic overall click BW limit is 1/8 av ZCI (based on first 4 ZCIs) plus BWaddon. 130kHz cyc to cyc limit is last cyc +- 8 plus addon i.e. ¼ plus addon. Median BW v SPL indicates noise is adding 5.5 to value of the weakest clicks. So the likely addons are in range 2 to 6. Array file structure *.arr Header 0 1 2 3 4..7 8..11 12 13 14 HdrBytes - 200bytes PODrecBytes Rows Columns Start date/time End date/time TDA version Lowest Q class for HP Lowest Q class for dol 20..164 …199 POD numbers? POD rec - bottom byte 0 1 2 3 4 5 6 7 bits 1..6: HP ClkPosTenSecs bit 7: unused bit 8: active. HP Mean kHz HP Mean clk rate Dol ClkPosTenSecs etc. as above but bit 8 unused Dol Mean kHz Dol Mean clk rate POD rec – surface bits 1..6: HP ClkPosTenSecs bit 7: unused bit 8: active. HP Mean kHz 8 9 10 11 HP Mean clk rate Dol ClkPosTenSecs etc. as above but bit 8 unused Dol Mean kHz Dol Mean clk rate 12 bytes per minute per position For 6*6 grid = 432 bytes per minute Size approx: 0.62MB / day