ValueError: operands could not be broadcast together with shapes (400,2) (400,)
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 25/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
從提供的腳本中的 plp(signal, rasta=True) 呼叫開始,並檢查 sidekit/frontend/features.py 中 power_spectrum 的第 399 行。使用所參照的 WAV 輸入重現失敗,然後追蹤 signal、framed[start:stop, :] 與 window 的形狀。對於預期的 WAV 輸入,PLP 擷取不再引發 broadcasting 錯誤即表示完成。
由索引模型根據 Issue 內容生成。
描述
Dear concerns : I am extracting features from wav , using PLP , this ( Pyhton 3.6 -Anaconda Spyder ) after execute i am facing error in this line
File "C:\ProgramData\Anaconda3\lib\site-packages\sidekit\frontend\features.py", line 399, in power_spectrum
ahan = framed[start:stop, :] * window
ValueError: operands could not be broadcast together with shapes (400,2) (400,)
#!usr/bin/python
import numpy.matlib
import scipy
from scipy.fftpack.realtransforms import dct
from sidekit.frontend.vad import pre_emphasis
from sidekit.frontend.io import *
from sidekit.frontend.normfeat import *
from sidekit.frontend.features import *
import scipy.io.wavfile as wav
import numpy as np
def readWavFile(wav):
#given a path from the keyboard to read a .wav file
#wav = raw_input('Give me the path of the .wav file you want to read: ')
inputWav = 'C:/Speech_Processing/2-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques'+wav
return inputWav
#reading the .wav file (signal file) and extract the information we need
def initialize(inputWav):
rate , signal = wav.read(readWavFile(inputWav)) # returns a wave_read object , rate: sampling frequency
sig = wave.open(readWavFile(inputWav))
# signal is the numpy 2D array with the date of the .wav file
# len(signal) number of samples
sampwidth = sig.getsampwidth()
print ('The sample rate of the audio is: ',rate)
print ('Sampwidth: ',sampwidth)
return signal , rate
def PLP():
folder = input('Give the name of the folder that you want to read data: ')
amount = input('Give the number of samples in the specific folder: ')
for x in range(1,int(amount)+1):
wav = '/'+folder+'/'+str(x)+'.wav'
print (wav)
#inputWav = readWavFile(wav)
signal,rate = initialize(wav)
#returns PLP coefficients for every frame
plp_features = plp(signal,rasta=True)
meanFeatures(plp_features[0])
#compute the mean features for one .wav file (take the features for every frame and make a mean for the sample)
def meanFeatures(plp_features):
#make a numpy array with length the number of plp features
mean_features=np.zeros(len(plp_features[0]))
#for one input take the sum of all frames in a specific feature and divide them with the number of frames
for x in range(len(plp_features)):
for y in range(len(plp_features[x])):
mean_features[y]+=plp_features[x][y]
mean_features = (mean_features / len(plp_features))
print (mean_features)
def main():
PLP()
main()
- 主要語言
- Jupyter Notebook
- 星號
- 12.7k
- 分支
- 4.4k
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
rasbt/python-machine-learning-book 的其他 Issue
-
難度 5/5 一週以上 新手友好度 5/100
rasbt/python-machine-learning-book#99 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 35/100
rasbt/python-machine-learning-book#98 · 1 則留言 ·
-
難度 3/5 1-2 天 新手友好度 25/100
rasbt/python-machine-learning-book#95 · 1 則留言 ·
-
難度 3/5 1-2 天 新手友好度 18/100
-
難度 2/5 1-3 小時 新手友好度 55/100
rasbt/python-machine-learning-book#74 · 1 則留言 · 2 個 reaction ·
查看 rasbt/python-machine-learning-book 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 95/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
google-research/flood-forecasting#353 ·
維護者通常 5 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
PriorLabs/TabPFN#1362 · 1 則留言 ·
維護者通常 1 天內回覆
-
bot-triaged module: error checking module: optimizer triaged
難度 2/5 1-3 小時 新手友好度 68/100
pytorch/pytorch#200158 · 1 則留言 ·
維護者通常 1 天內回覆