to_raf.py
def to_raf(signal,filename):
    """Convert the signal (already the correct length) to a RAF file."""
    signal = np.array(signal,dtype=float)
    # Shift and convert the signal
    signal = signal - signal.min()
    signal = ((signal/signal.max()) * int("3fff", 16)).astype('int16')
    # Write the signal as binary.
    fp = open(filename+".RAF", "wb")
    draw(signal)
    signal.tofile(fp)
Convert the signal (already the correct length) to a RAF file.
Convert the signal (already the correct length) to a RAF file.
Convert the signal ( already the correct length ) to a RAF file .
def to_raf(signal,filename):
    signal = np.array(signal,dtype=float)
    signal = signal - signal.min()
    signal = ((signal/signal.max()) * int("3fff", 16)).astype('int16')
    fp = open(filename+".RAF", "wb")
    draw(signal)
    signal.tofile(fp)
def to_raf ( signal , filename ) : signal = np . array ( signal , dtype = float ) signal = signal - signal . min ( ) signal = ( ( signal / signal . max ( ) ) * int ( "3fff" , 16 ) ) . astype ( 'int16' ) fp = open ( filename + ".RAF" , "wb" ) draw ( signal ) signal . tofile ( fp )
Convert the signal (already the correct length) to a RAF file.
Convert the signal ( already the correct length ) to a RAF file .
"""Convert the signal (already the correct length) to a RAF file.""" # Shift and convert the signal # Write the signal as binary.
signal
filename