From 5b1cc760d8b3cab15213d6ada075d26e19eb1cb1 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Wed, 16 Nov 2022 09:12:55 +0000 Subject: [PATCH] Quick fix of calibration data for ST Click detector. Was getting a 5V input from it's bespoke acquisition, whereas needs 2. --- src/soundtrap/STAcquisitionControl.java | 46 +++++------------------- src/soundtrap/sud/SudFileDWVHandler.java | 3 +- 2 files changed, 11 insertions(+), 38 deletions(-) diff --git a/src/soundtrap/STAcquisitionControl.java b/src/soundtrap/STAcquisitionControl.java index 0b04ffa1..09eebc77 100644 --- a/src/soundtrap/STAcquisitionControl.java +++ b/src/soundtrap/STAcquisitionControl.java @@ -38,6 +38,13 @@ public class STAcquisitionControl extends AcquisitionControl { public static final String STUNITTYPE = "SoundTrap Data Acquisition"; private STAcquisitionProcess stAcquisitionProcess; private STDaqSystem stDaqSystem; + + /* + * Standard voltage for soundtrap data. note that ST calibration is only + * provided as end to end peak input, so the correct thing to do is set the peak to peak as 2 + * (0-peak = 1) and then put the hydrophone sensitivity as - the end to end and all will be well. + */ + public static final double SOUNDTRAPVP2P = 2.0; /** * @param name @@ -45,47 +52,12 @@ public class STAcquisitionControl extends AcquisitionControl { public STAcquisitionControl(String name) { super(name); -// super(STUNITTYPE, name); -// -// acquisitionControl = this; -// -// fileDate = new StandardFileDate(this); -// -// pamController = PamController.getInstance(); -// -// registerDaqSystem(new FileInputSystem(this)); -// registerDaqSystem(folderSystem = new FolderInputSystem(this)); -// -// daqChannelListManager = new DAQChannelListManager(this); -// -// PamSettingManager.getInstance().registerSettings(this); -// -// addPamProcess(acquisitionProcess = new STAcquisitionProcess(this)); -// -// daqMenuEnabler = new MenuItemEnabler(); -// -// statusBarComponent = getStatusBarComponent(); -// -// if (isViewer) { -// offlineFileServer = new OfflineFileServer(this, fileDate); -// } -// else { -// PamStatusBar statusBar = PamStatusBar.getStatusBar(); -// -// if (statusBar != null) { -// statusBar.getToolBar().add(statusBarComponent); -// statusBar.getToolBar().addSeparator(); -// setupStatusBar(); -// } -// } -// setSelectedSystem(); -// -// TDDataProviderRegisterFX.getInstance().registerDataInfo(new RawSoundProviderFX(this)); - // add a second PAM process, for the click data registerDaqSystem(stDaqSystem = new STDaqSystem()); addPamProcess(stAcquisitionProcess = new STAcquisitionProcess(this)); + acquisitionParameters.voltsPeak2Peak = SOUNDTRAPVP2P; + } @Override diff --git a/src/soundtrap/sud/SudFileDWVHandler.java b/src/soundtrap/sud/SudFileDWVHandler.java index 259d791b..11abd304 100644 --- a/src/soundtrap/sud/SudFileDWVHandler.java +++ b/src/soundtrap/sud/SudFileDWVHandler.java @@ -19,6 +19,7 @@ import PamUtils.PamCalendar; import clickDetector.ClickDetection; import clickDetector.ClickDetector; import clickDetector.ClickDetector.ChannelGroupDetector; +import soundtrap.STAcquisitionControl; import soundtrap.STClickControl; import wavFiles.ByteConverter; @@ -77,8 +78,8 @@ public class SudFileDWVHandler implements SUDNotificationHandler { stClickControl.findRawDataBlock().setChannelMap(1); stClickControl.findRawDataBlock().setSampleRate((float) sampleRate, true); stClickControl.getSTAcquisition().acquisitionParameters.sampleRate = (float) sampleRate; + stClickControl.getSTAcquisition().acquisitionParameters.voltsPeak2Peak = STAcquisitionControl.SOUNDTRAPVP2P; stClickControl.getSTAcquisition().getAcquisitionProcess().setSampleRate((float) sampleRate, true); -// stClickControl.getSTAcquisition().getS().setSampleRate((float) sampleRate, true); // System.out.printf("Open input stream fs = %3.1f\n", sampleRate); }