facing error during feature extraction using plp,TypeError: ufunc 'add' did not contain a loop with signature...





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0
















when i execute this program on pycharm than found about error , what
changing required in my code , anyone please help me. How can i modift it TypeError: ufunc
'add' did not contain a loop with signature matching.




#!usr/bin/python
import pandas as pd
import numpy
import numpy.matlib
import scipy
from scipy.fftpack.realtransforms import dct
from SIDEKIT.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
from six.moves import input as raw_input

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:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-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 = raw_input('Give the name of the folder that you want to read data: ')
amount = raw_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()



Give the name of the folder that you want to read data: samples Give
the number of samples in the specific folder: 5 Traceback (most recent
call last): File
"C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
line 53, in
PLP() File "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
line 40, in PLP
meanFeatures(plp_features[0]) File "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
line 48, in meanFeatures
mean_features[y]+=plp_features[x][y] TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('


Process finished with exit code 1











share|improve this question





























    0
















    when i execute this program on pycharm than found about error , what
    changing required in my code , anyone please help me. How can i modift it TypeError: ufunc
    'add' did not contain a loop with signature matching.




    #!usr/bin/python
    import pandas as pd
    import numpy
    import numpy.matlib
    import scipy
    from scipy.fftpack.realtransforms import dct
    from SIDEKIT.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
    from six.moves import input as raw_input

    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:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-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 = raw_input('Give the name of the folder that you want to read data: ')
    amount = raw_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()



    Give the name of the folder that you want to read data: samples Give
    the number of samples in the specific folder: 5 Traceback (most recent
    call last): File
    "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
    line 53, in
    PLP() File "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
    line 40, in PLP
    meanFeatures(plp_features[0]) File "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
    line 48, in meanFeatures
    mean_features[y]+=plp_features[x][y] TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('


    Process finished with exit code 1











    share|improve this question

























      0












      0








      0









      when i execute this program on pycharm than found about error , what
      changing required in my code , anyone please help me. How can i modift it TypeError: ufunc
      'add' did not contain a loop with signature matching.




      #!usr/bin/python
      import pandas as pd
      import numpy
      import numpy.matlib
      import scipy
      from scipy.fftpack.realtransforms import dct
      from SIDEKIT.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
      from six.moves import input as raw_input

      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:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-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 = raw_input('Give the name of the folder that you want to read data: ')
      amount = raw_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()



      Give the name of the folder that you want to read data: samples Give
      the number of samples in the specific folder: 5 Traceback (most recent
      call last): File
      "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
      line 53, in
      PLP() File "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
      line 40, in PLP
      meanFeatures(plp_features[0]) File "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
      line 48, in meanFeatures
      mean_features[y]+=plp_features[x][y] TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('


      Process finished with exit code 1











      share|improve this question















      when i execute this program on pycharm than found about error , what
      changing required in my code , anyone please help me. How can i modift it TypeError: ufunc
      'add' did not contain a loop with signature matching.




      #!usr/bin/python
      import pandas as pd
      import numpy
      import numpy.matlib
      import scipy
      from scipy.fftpack.realtransforms import dct
      from SIDEKIT.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
      from six.moves import input as raw_input

      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:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-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 = raw_input('Give the name of the folder that you want to read data: ')
      amount = raw_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()



      Give the name of the folder that you want to read data: samples Give
      the number of samples in the specific folder: 5 Traceback (most recent
      call last): File
      "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
      line 53, in
      PLP() File "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
      line 40, in PLP
      meanFeatures(plp_features[0]) File "C:/Users/KALEEM/PycharmProjects/kaleem_wavprocessing/12-Speech_Signal_Processing_and_Classification-master/feature_extraction_techniques/plp.py",
      line 48, in meanFeatures
      mean_features[y]+=plp_features[x][y] TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('


      Process finished with exit code 1








      python machine-learning speech-recognition feature-extraction






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 4 at 6:31









      InshalInshal

      64




      64
























          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54034052%2ffacing-error-during-feature-extraction-using-plp-typeerror-ufunc-add-did-not%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54034052%2ffacing-error-during-feature-extraction-using-plp-typeerror-ufunc-add-did-not%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas