# Question about PPSD output value by default (without	using special\_hanging parameter).

**URL:** <https://discourse.obspy.org/t/question-about-ppsd-output-value-by-default-without-using-special-hanging-parameter/906>\
**Category:** Users Mailing List Archive\
**Tags:** archive\
**Created:** [June 24, 2020, 6:00pm UTC](https://discourse.obspy.org/t/question-about-ppsd-output-value-by-default-without-using-special-hanging-parameter/906 "2020-06-24T18:00:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gbehou\_Ange\_Amour\_So](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/g/f6c823/32.png) [@Gbehou\_Ange\_Amour\_So](https://discourse.obspy.org/u/Gbehou_Ange_Amour_So)\
**Post date:** [June 24, 2020, 6:00pm UTC](https://discourse.obspy.org/t/question-about-ppsd-output-value-by-default-without-using-special-hanging-parameter/906/1 "2020-06-24T18:00:34Z")

</div>

Hello,

I would like to analyse ambient noise from different instruments (Geophone, BroadBand, accelerometer..) by using ObsPy’s PPSD. It is therefore necessary for me to have the same unit for the PSD estimation in order to compare them (from different instruments).

For example if my raw data are in velocity (geophone sensor), does ppsd estimation automatically convert it into acceleration, as it shows [**(m/s²)²/Hz**] [db] when we plot ? Then what if raw data are in acceleration (accelerometer sensor)?

Best regards.

Ange SOUPPLIAN.

---

<div class="post-metadata">

**Author:** ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)\
**Post date:** [June 25, 2020, 10:00am UTC](https://discourse.obspy.org/t/question-about-ppsd-output-value-by-default-without-using-special-hanging-parameter/906/2 "2020-06-25T10:00:39Z")

</div>

Basically, no matter what units your input data, the metadata should  
correctly specify how to get to physical units from that starting point.

Usually raw data are in counts and the metadata specifies how to get  
from counts to velocity in m/s or to acceleration in m/s\*\*2 in case of  
accelerometers.

If your data already is in e.g. velocity in m/s, you ideally should set  
up a proper response, basically stating input and output units are both  
m/s and that nothing has to be done, e.g. have a look at this ticket, to  
get an idea what i mean:

> <https://github.com/obspy/obspy/issues/2408>
>
> I think it might be a good idea (and not hard / a lot of work to implement) to h…ave a helper function (or maybe a static method on \`Response\`) that returns a flat response. Sometimes this is needed with workflows that expect station metadata with a response and when handling data that already was converted to the target units outside of the workflow (e.g. industry data sometimes, converted to m/s during data acquisition).
> 
> \`\`\`python
> class Response(object):
> @staticmethod
> def get\_flat\_response(normalization\_frequency=1, overall\_sensitivity=1, units='M/S'):
> """
> :param units: one of 'VEL', 'ACC', 'DISP', or any arbitrary units string
> """
> response = Response(...)
> return response
> \`\`\`
> 
> CC @d-chambers
> 
> Opinions?
> 
> Here's an example I created at some point, there might be other (better?) options to achieve the same thing.
> 
> \`\`\`xml
> \<Response\>
> \<InstrumentSensitivity\>
> \<Value\>1\</Value\>
> \<Frequency\>10\</Frequency\>
> \<InputUnits\>
> \<Name\>M/S\</Name\>
> \<Description\>Velocity in Meters per Second\</Description\>
> \</InputUnits\>
> \<OutputUnits\>
> \<Name\>M/S\</Name\>
> \<Description\>Velocity in Meters per Second\</Description\>
> \</OutputUnits\>
> \</InstrumentSensitivity\>
> \<Stage number="1"\>
> \<PolesZeros\>
> \<InputUnits\>
> \<Name\>M/S\</Name\>
> \<Description\>Velocity in Meters per Second\</Description\>
> \</InputUnits\>
> \<OutputUnits\>
> \<Name\>M/S\</Name\>
> \<Description\>Velocity in Meters per Second\</Description\>
> \</OutputUnits\>
> \<PzTransferFunctionType\>LAPLACE (RADIANS/SECOND)\</PzTransferFunctionType\>
> \<NormalizationFactor\>1.0\</NormalizationFactor\>
> \<NormalizationFrequency unit="HERTZ"\>10.0\</NormalizationFrequency\>
> \</PolesZeros\>
> \<StageGain\>
> \<Value\>1\</Value\>
> \<Frequency\>10\</Frequency\>
> \</StageGain\>
> \</Stage\>
> \</Response\>
> \`\`\`
> 
> !\[Figure\_1-2\](https://user-images.githubusercontent.com/1842780/58541133-1922db80-81fb-11e9-9746-d403c6aa7152.png)

hope it helps,  
Tobias

---

<div class="post-metadata">

**Author:** ![Aleksey\_Emanov](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@Aleksey\_Emanov](https://discourse.obspy.org/u/Aleksey_Emanov)\
**Post date:** [June 25, 2020, 10:22am UTC](https://discourse.obspy.org/t/question-about-ppsd-output-value-by-default-without-using-special-hanging-parameter/906/3 "2020-06-25T10:22:23Z")

</div>

Hi Ange,

For the accelerometric data you could add additional zero at (0,0). Thus you could convert it to velocity.

Regards,  
Alex

---

<div class="post-metadata">

**Author:** ![Gbehou\_Ange\_Amour\_So](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/g/f6c823/32.png) [@Gbehou\_Ange\_Amour\_So](https://discourse.obspy.org/u/Gbehou_Ange_Amour_So)\
**Post date:** [June 25, 2020, 12:19pm UTC](https://discourse.obspy.org/t/question-about-ppsd-output-value-by-default-without-using-special-hanging-parameter/906/4 "2020-06-25T12:19:02Z")

</div>

Thanks for your response, I understand this particular case, when the response is already corrected in the data.

The reason why I was wondering about the output value of PPSD is that, in the source code you multiply the PSD value by (2_PI_f)² (= Omega²) when removing instrument response for special\_hanging = none.

When you do this multiplication by Omega, does that convert into acceleration? Since on the PPSD plot, it is marked [(m/s²)²/Hz] (when we don’t specify special\_hanging).

Sorry if this is a stupid question, the reason is I’m learning by myself, so I don’t have plenty notions on it.

Best regards.

---

<div class="post-metadata">

**Author:** ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)\
**Post date:** [June 25, 2020, 12:34pm UTC](https://discourse.obspy.org/t/question-about-ppsd-output-value-by-default-without-using-special-hanging-parameter/906/5 "2020-06-25T12:34:18Z")

</div>

In all cases, we request response correction to velocity from underlying  
evalresp, and then go to acceleration in frequency domin like you  
mentioned. If the station metadata you provide (e.g. StationXML) states  
how to convert e.g. counts to acceleration, evalresp should account for  
us requesting velocity.  
So, it should be alright. However personally I do not use accelerometer  
data, so double checking can never hurt and being cautious is always a  
good idea. Although I would imagine that we have quite a few users  
working with accelerometer data. So if there was a drastic problem like  
that it should have surfaced by now, I would think, as it would produce  
values that are off by a mile or two.

Another double check you could do with a publicly available  
accelerometer is e.g. requesting the PQLX plot from IRIS' mustang and  
comparing with an obspy calculated version. That would be comparing to  
completely separate codes.

> **[NSF SAGE: 
  
  

  
    MUSTANG: 
  

  
    Noise-Pdf: 
  

  
    Docs: 
 ...](http://services.iris.edu/mustang/noise-pdf/1/)**

best,  
Tobias

---

<div class="post-metadata">

**Author:** ![Gbehou\_Ange\_Amour\_So](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/g/f6c823/32.png) [@Gbehou\_Ange\_Amour\_So](https://discourse.obspy.org/u/Gbehou_Ange_Amour_So)\
**Post date:** [June 25, 2020, 12:57pm UTC](https://discourse.obspy.org/t/question-about-ppsd-output-value-by-default-without-using-special-hanging-parameter/906/6 "2020-06-25T12:57:53Z")

</div>

Okay thanks you. This helps a lot.

Best

---

<div class="post-metadata">

**Author:** ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)\
**Post date:** [June 26, 2020, 9:29am UTC](https://discourse.obspy.org/t/question-about-ppsd-output-value-by-default-without-using-special-hanging-parameter/906/7 "2020-06-26T09:29:15Z")

</div>

Like stated before, such tinkering should not be needed in most cases like "Stream.remove\_response()" or in PPSD processing. Evalresp can take care of it, based on the station metadata in an Inventory object, coming from StationXML, via FDSNWS or dataless SEED etc.  
For remove\_response you can specify the output units (DISP, VEL, ACC, see docs) and evalresp will take care of it.

Tinkering with poles/zeros should only ever be needed if you really only use a plain poles and zeros dictionary, which should always be the last resort.

best,  
Tobias
