Answers.Body: <p>You set dBref=10**(-175.9/20). (use the R equivalent of potentiating)</p>
  <p>internally, spectro does the following operation</p>
  <pre><code>if(!is.null(dB))
      {
          if(is.null(dBref)) {z &lt;- 20*log10(z)} else {z &lt;- 20*log10(z/dBref)}
      ...
      }
  </code></pre>
  <p>So, it divides the data values by dBref. Consequently this is equivalent to adding 175.9 dB to your levels.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-27T08:20:55.510Z
Answers.LastActivityDate: 2024-01-26T20:07:38.440Z
Answers.LastEditDate: 2024-01-26T20:07:38.440Z
Answers.UserDisplayName: WMXZ
Body: <p>I am using seewave's spectro() to generate a spectrogram from a hydrophone recording.  My call is:</p>
  <pre><code>spectro(wave, wl=2048, wn=&quot;hamming&quot;, ovlp=50, flim=c(40, 1000), dBref=3D1*10e-6, scalelab=&quot;dB re 1 uPa&quot;, palette=temp.colors, collevels=seq(10, 100))
  </code></pre>
  <p>My question: how do I alter the spectrogram to make it display amplitude
  colors based on the calibrated dB for my hydrophone?  I am using a
  soundtrap, with an end-to-end calibration factor of 175.9 dB.  If dB are
  set to &quot;max0&quot; then I would add 175.9 to each amplitude measurement to get a
  calibrated amplitude, but I'm not sure how to do that with spectro.</p>
  <p>Thanks very much.</p>
  
Tags: <calibration><spectrogram><db><seewave>
Title: How to adjust seewave spectro to account for hydrophone sensitivity?
ThreadText: # How to adjust seewave spectro to account for hydrophone sensitivity?
  
  (Asked by: username_0 on 2023-12-26)
  
  I am using seewave's spectro() to generate a spectrogram from a hydrophone recording.  My call is:
  spectro(wave, wl=2048, wn="hamming", ovlp=50, flim=c(40, 1000), dBref=3D1*10e-6, scalelab="dB re 1 uPa", palette=temp.colors, collevels=seq(10, 100))
  
  My question: how do I alter the spectrogram to make it display amplitude
  colors based on the calibrated dB for my hydrophone?  I am using a
  soundtrap, with an end-to-end calibration factor of 175.9 dB.  If dB are
  set to "max0" then I would add 175.9 to each amplitude measurement to get a
  calibrated amplitude, but I'm not sure how to do that with spectro.
  Thanks very much.
  
  **Tags:** calibration, spectrogram, db, seewave
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-12-27. Score: 1
  
  You set dBref=10**(-175.9/20). (use the R equivalent of potentiating)
  internally, spectro does the following operation
  if(!is.null(dB))
      {
          if(is.null(dBref)) {z <- 20*log10(z)} else {z <- 20*log10(z/dBref)}
      ...
      }
  
  So, it divides the data values by dBref. Consequently this is equivalent to adding 175.9 dB to your levels.
  
  
  ---
  
  