關於scipy
Scipy高級科學計算庫:和Numpy聯系很密切,Scipy一般都是操控Numpy數組來進行科學計算、統計分析,所以可以說是基於Numpy之上了。Scipy有很多子模塊可以應對不同的應用,例如插值運算,優化算法等等。SciPy則是在NumPy的基礎上構建的更為強大,應用領域也更為廣泛的科學計算包。正是出於這個原因,SciPy需要依賴NumPy的支持進行安裝和運行。
它增加的功能包括數值積分、最優化、統計和一些專用函數。 SciPy函數庫在NumPy庫的基礎上增加了眾多的數學、科學以及工程計算中常用的庫函數。例如線性代數、常微分方程數值求解、信號處理、圖像處理、稀疏矩陣等等。
關於【Scipy文件輸入/輸出】可參考:https://blog.csdn.net/Dorisi_H_n_q/article/details/82584668
read
scipy.io.wavfile.
read
(filename, mmap=False)
Open a WAV file. Return the sample rate (in samples/sec) and data from a WAV file.
- Parameters
-
- filename [ string or open file handle] Input wav file.
- mmap [ bool, optional] Whether to read data as memory-mapped. Only to be used on real files (Default: False). New in version 0.12.0.
- Returns
-
- rate [ int] Sample rate of wav file.
- data [ numpy array] Data read from wav file. Data-type is determined from the file; see Notes.
write
scipy.io.wavfile.
write
(filename, rate, data)
Write a numpy array as a WAV file.
-
- filename [ string or open file handle] Output wav file.
- rate [ int] The sample rate (in samples/sec).
- data [ ndarray] A 1-D or 2-D numpy array of either integer or float data-type.