# Define FFT waveforms grecord(aSub,"$(P)$(M):fft") { # Processing functions and other settings field(INAM,"fftInit") field(SNAM,"fftProcess") field(SCAN,"Passive") field(EFLG,"ALWAYS") # Time dependence field(FTA ,"FLOAT") field(NOA ,"$(NSLICES)") field(INPA,"$(P)$(M):wf CPP") field(TSEL,"$(P)$(M):wf.TIME") # Copy of the data field(FTVA,"FLOAT") field(NOVA,"$(NSLICES)") # Real part field(FTVB,"FLOAT") field(NOVB,"$(NFREQS)") # Imaginary part field(FTVC,"FLOAT") field(NOVC,"$(NFREQS)") } grecord(acalcout, "$(P)$(M):wf_calc") { field(SCAN, "Passive") field(CALC, "SUM(AA)") field(OCAL, "AA") field(INAA, "$(P)$(M) CPP") field(DOPT, "Use OCAL") field(OOPT, "When Non-zero") field(NELM, "$(NSLICES)") field(OUT , "$(P)$(M):wf PP") } grecord(waveform, "$(P)$(M):wf") { field(SCAN, "Passive") field(NELM, "$(NSLICES)") field(LOPR, "1") field(HOPR, "$(NSLICES)") field(FTVL, "DOUBLE") } grecord(acalcout, "$(P)$(M):mag_calc") { field(SCAN, "Passive") field(CALC, "DBL(SQRT(BB^2+CC^2)[0,0])>0.001") field(OCAL, "2*SQRT(BB^2+CC^2)/DBL(SQRT(BB^2+CC^2)[0,0])") field(INBB, "$(P)$(M):fft.VALB CPP") field(INCC, "$(P)$(M):fft.VALC CPP") field(DOPT, "Use OCAL") field(OOPT, "When Non-zero") field(NELM, "$(NFREQS)") field(OUT , "$(P)$(M):mag PP") } grecord(acalcout, "$(P)$(M):phase_calc") { field(SCAN, "Passive") field(CALC, "R2D*ATAN2(CC,BB)") field(OCAL, "R2D*ATAN2(CC,BB)") field(INBB, "$(P)$(M):fft.VALB CPP") field(INCC, "$(P)$(M):fft.VALC CPP") field(DOPT, "Use OCAL") field(OOPT, "Every Time") field(NELM, "$(NFREQS)") field(OUT , "$(P)$(M):phase PP") } grecord(acalcout, "$(P)$(M):axis_calc") { field(SCAN, "1 second") field(CALC, "1") field(OCAL, "IX/ARR($(NSLICES)*A)") field(INPA, "$(DWEL)") field(DOPT, "Use OCAL") field(OOPT, "Every Time") field(NELM, "$(NFREQS)") field(NUSE, "$(NFREQS)") field(OUT , "$(P)$(M):axis PP") } grecord(waveform, "$(P)$(M):mag") { field(SCAN, "Passive") field(NELM, "$(NFREQS)") field(LOPR, "1") field(HOPR, "$(NFREQS)") field(FTVL, "DOUBLE") } grecord(waveform, "$(P)$(M):phase") { field(SCAN, "Passive") field(NELM, "$(NFREQS)") field(LOPR, "1") field(HOPR, "$(NFREQS)") field(FTVL, "DOUBLE") } grecord(waveform, "$(P)$(M):axis") { field(SCAN, "Passive") field(NELM, "$(NFREQS)") field(LOPR, "1") field(HOPR, "$(NFREQS)") field(FTVL, "DOUBLE") } grecord(waveform, "$(P)$(M):axis_wf") { field(SCAN, "Passive") field(NELM, "$(NSLICES)") field(LOPR, "1") field(HOPR, "$(NSLICES)") field(FTVL, "DOUBLE") } grecord(acalcout, "$(P)$(M):axis_wf_calc") { field(SCAN, "1 second") field(CALC, "1") field(OCAL, "IX*ARR(A)") field(INPA, "$(DWEL)") field(DOPT, "Use OCAL") field(OOPT, "Every Time") field(NELM, "$(NSLICES)") field(NUSE, "$(NSLICES)") field(OUT , "$(P)$(M):axis_wf PP") } grecord(acalcout, "$(P)$(M):rms_calc") { field(SCAN, "Passive") field(CALC, "AVG(BB)>0.0001?STD(BB)/AVG(BB):0") field(INBB, "$(P)$(M):wf CPP") field(DOPT, "Use CALC") field(OOPT, "Every Time") field(NELM, "$(NSLICES)") field(OUT , "$(P)$(M):rms PP" ) } grecord( ai, "$(P)$(M):rms" ) { field(SCAN, "Passive") field(PREC, "4") } grecord(acalcout, "$(P)$(M):mean_calc") { field(SCAN, "Passive") field(CALC, "AVG(BB)") field(INBB, "$(P)$(M):wf CPP") field(DOPT, "Use CALC") field(OOPT, "Every Time") field(NELM, "$(NSLICES)") field(OUT , "$(P)$(M):mean PP" ) } grecord( ai, "$(P)$(M):mean" ) { field(SCAN, "Passive") field(PREC, "3") } grecord(acalcout, "$(P)$(M):sum_calc") { field(SCAN, "Passive") field(CALC, "SUM(BB)") field(INBB, "$(P)$(M):wf CPP") field(DOPT, "Use CALC") field(OOPT, "Every Time") field(NELM, "$(NSLICES)") field(OUT , "$(P)$(M):sum PP" ) } grecord( ai, "$(P)$(M):sum" ) { field(SCAN, "Passive") field(PREC, "1") } grecord(calc, "$(P)$(M):rate") { field(SCAN, "Passive") # field(CALC, "A>1E-2?B/A:B") field(CALC, "(C*D)>1E-2?B/(C*D):B") field(INPA, "$(P)$(M).ELTM") field(INPB, "$(P)$(M):sum CPP") field(INPC, "$(P)Dwell") field(INPD, "$(P)$(M).NMAX") field(PREC, "1") field(EGU , "Hz" ) } grecord( calc, "$(P)$(M):rms_corr") { field(SCAN, "Passive") field(CALC, "B>0&&A*A>1/B?SQRT(A*A-1/B):0") field(INPA, "$(P)$(M):rms CPP") field(INPB, "$(P)$(M):mean CPP") field(PREC, "4") } grecord( stringout, "$(P)$(M):display") { field(SCAN, "Passive") field(VAL , "Unassigned") }