Octave 库 - 'MeanPeakHeight' 无效参数
Octave library - 'MeanPeakHeight' invalid parameter
我想在 Python 中使用 Octave 库对 Raspberry pi 3 中的 .wav 文件信号进行峰值检测 Raspbian 但是 octave.findpeaks函数。我有这个错误:findpeaks:参数 'MeanPeakHeight' 与解析器的任何有效参数不匹配
我已经安装了所有与 Octave 有关的软件包,所以这就是我不明白的原因。
这是我程序的一部分:
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile as wav
from scipy.signal import find_peaks_cwt, butter, lfilter
from pylab import *
import os
from operator import truediv
from easygui import *
from oct2py import octave
"High and Low Frequency for the filter"
low = 100
high = 50
list_file = []
octave.eval("pkg load signal")
def display_wav(wav_file):
samplerate, beat = wav.read('/home/pi/heartbeat_project/heartbeat_songs/%s' %wav_file)
beat_resize = np.fromfile(open('/home/pi/heartbeat_project/heartbeat_songs/%s' %wav_file),np.int16)[4*samplerate:float(beat.shape[0])-4*samplerate]
beat_resize = beat_resize / (2.**15)
timeArray = arange(0,float(beat_resize.shape[0]),1)
timeArray = timeArray / samplerate
ylow = butter_lowpass_filter(samplerate, 5, low, beat_resize)
y = butter_highpass_filter(samplerate, 5, high, ylow)
peaks, indexes = octave.findpeaks(np.array(y),'DoubleSided','MeanPeakHeight',np.std(y))
findpeaks 是 octave-forge 信号包的一部分:source file
此函数没有 'MeanPeakHeight
' 参数。我猜这是一个错字,你想要 'MinPeakHeight'
我想在 Python 中使用 Octave 库对 Raspberry pi 3 中的 .wav 文件信号进行峰值检测 Raspbian 但是 octave.findpeaks函数。我有这个错误:findpeaks:参数 'MeanPeakHeight' 与解析器的任何有效参数不匹配 我已经安装了所有与 Octave 有关的软件包,所以这就是我不明白的原因。 这是我程序的一部分:
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile as wav
from scipy.signal import find_peaks_cwt, butter, lfilter
from pylab import *
import os
from operator import truediv
from easygui import *
from oct2py import octave
"High and Low Frequency for the filter"
low = 100
high = 50
list_file = []
octave.eval("pkg load signal")
def display_wav(wav_file):
samplerate, beat = wav.read('/home/pi/heartbeat_project/heartbeat_songs/%s' %wav_file)
beat_resize = np.fromfile(open('/home/pi/heartbeat_project/heartbeat_songs/%s' %wav_file),np.int16)[4*samplerate:float(beat.shape[0])-4*samplerate]
beat_resize = beat_resize / (2.**15)
timeArray = arange(0,float(beat_resize.shape[0]),1)
timeArray = timeArray / samplerate
ylow = butter_lowpass_filter(samplerate, 5, low, beat_resize)
y = butter_highpass_filter(samplerate, 5, high, ylow)
peaks, indexes = octave.findpeaks(np.array(y),'DoubleSided','MeanPeakHeight',np.std(y))
findpeaks 是 octave-forge 信号包的一部分:source file
此函数没有 'MeanPeakHeight
' 参数。我猜这是一个错字,你想要 'MinPeakHeight'