Exemple #1
0
def readdata(filename, start, n):
    """Read *n* samples from file *filename* starting at sample *start*.

    Returns a two dimensional array of shape=(2, n/2) with the data
    for both channels.

    Example::

        # Import modules
        import rif
        import matplotlib.pyplot as plt

        # Read 1024 samples for each channel starting at sample 0.
        d = rif.readdata("RIF.dat", 0, 2048)

        # Plot raw time series of:
        plt.plot(d[0]) # channel 0
        plt.plot(d[1]) # channel 1.

        plt.show()

    """
    data = _rif.readdata(filename, start, n)

    return data.reshape((n / 2, 2)).transpose()
Exemple #2
0
def readdata(filename, start, n):
    """Read *n* samples from file *filename* starting at sample *start*.

    Returns a two dimensional array of shape=(2, n/2) with the data
    for both channels.

    Example::

        # Import modules
        import rif
        import matplotlib.pyplot as plt

        # Read 1024 samples for each channel starting at sample 0.
        d = rif.readdata("RIF.dat", 0, 2048)

        # Plot raw time series of:
        plt.plot(d[0]) # channel 0
        plt.plot(d[1]) # channel 1.

        plt.show()

    """
    data = _rif.readdata(filename, start, n)

    return data.reshape((n/2, 2)).transpose()
Exemple #3
0
def readdata_single_channel(filename, start, n):
    """Read *n* samples from file *filename* starting at sample *start*.

    Returns a two dimensional array with the data.

    Example::

        # Import modules
        import rif
        import matplotlib.pyplot as plt

        # Read 1024 samples for each channel starting at sample 0.
        d = rif.readdata("RIF.dat", 0, 2048)

        # Plot raw time series of:
        plt.plot(d)

        plt.show()

    """
    data = _rif.readdata(filename, start, n)

    return data
Exemple #4
0
def readdata_single_channel(filename, start, n):
    """Read *n* samples from file *filename* starting at sample *start*.

    Returns a two dimensional array with the data.

    Example::

        # Import modules
        import rif
        import matplotlib.pyplot as plt

        # Read 1024 samples for each channel starting at sample 0.
        d = rif.readdata("RIF.dat", 0, 2048)

        # Plot raw time series of:
        plt.plot(d)

        plt.show()

    """
    data = _rif.readdata(filename, start, n)

    return data