---
name: "msr_samprate"
section: "3"
platform: "linux"
package: "libmseed-doc"
version: "2.19.8-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/msr_samprate"
---

# msr\_samprate(3)

Determine sample rate from an MSRecord structure

## NAME

msr\_samprate - Determine sample rate from an MSRecord structure

## SYNOPSIS

```
#include <libmseed.h>
double  msr_samprate ( MSRecord *msr );
double  msr_nomsamprate ( MSRecord *msr );
```

## DESCRIPTION

**msr\_samprate** will calculate a double precision sample rate in samples per second using the header values in the specified MSRecord. If a Blockette 100 is included, the "Actual sample rate" (field 3) will be returned, otherwise a nominal sample rate will be calculated from the sample rate factor and multiplier in the fixed section data header.

NOTE: The sample rate for a MSRecord structure is available directly at MSRecord.samplerate.  libmseed based programs should use that sample rate whenever possible (**msr\_unpack** uses **msr\_samprate** to set MSRecord.samplerate).

**msr\_nomsamprate** will calculate a double precision sample rate in samples per second using the sample rate factor and multiplier in the fixed section data header.

## RETURN VALUES

**msr\_samprate** returns a double precision sample rate on success and -1.0 on error.

**msr\_nomsamprate** returns a double precision sample rate on success and -1.0 on error.

## SEE ALSO

**[ms\_intro(3)](/ms_intro/3.md)** and **[msr\_unpack(3)](/msr_unpack/3.md)**.

## AUTHOR

```
Chad Trabant
IRIS Data Management Center
```
