Tuesday, April 24, 2018

TBT Error: ./raw_conversion.scr: /bin/tcsh: bad interpreter: No such file or directory

Command: make wav2raw

Error: ./raw_conversion.scr: /bin/tcsh: bad interpreter: No such file or directory

Solution:


    you are missing the C-Shell (csh). Install it by below command:

    sudo apt-get install tcsh

Sunday, March 18, 2018

Feature Extraction using pyAudio

How to find zero crossing rate using pyAudio

That's a lot of unnecessary multiplication. Using a Boolean comparison and running it through np.diff will probably be faster:

zero_crosses = np.nonzero(np.diff(audioData > 0)))[0]

What this is doing:

  1. creates a boolean array of where the signal is above 0 (audioData > 0)
  2. does a pairwise difference (np.diff) so locations of zero crossings become 1 (rising) and -1 (falling)
  3. picks the index of the array where those nonzero values are (np.nonzero).

Then if you want the number of crossings, you can just take zero_crosses.size.

As a bonus you have the timings of all the crosses so you can do things like a histogram that shows where more crosses are happening in your time history.


Source: https://stackoverflow.com/questions/44319374/how-to-calculate-zero-crossing-rate-with-pyaudio-stream-data

Tuesday, October 31, 2017

Re: Find and replace through regular expression

Problem Statement

Find (ah0 0.25) and replace it with ((ah0))


Solution:
Use following regular expression

Find: \(([a-z][a-z][0-1]) 0\.\d+\)
replace: ((\1))

Find and replace through regular expression

Problem Statement

Find aa1 and replace it with (aa1)

or find ey0 and replace it with (ey0)

Solution:
Use following regular expression

Find:  ([a-z][a-z][0-1])
replace: (\1)

Wednesday, August 19, 2015

HMM Def Error

Error:
At the time of running: HCompV -C config_files/config_feature -f 0.01 -m -S flist -M hmm_GMV protos/proto_3s_2m

I am getting following error. Please see what would be possible solution.


HMM Def Error: <Mean> symbol expected in GetMean at line 6/col 11/char 130 in protos/proto_5s_2m
  ERROR [+7050]  HMError:
HMM Def Error: GetMean Failed at line 6/col 12/char 131 in protos/proto_5s_2m
  ERROR [+7050]  HMError:
HMM Def Error: Regression Class Number expected at line 7/col 0/char 132 in protos/proto_5s_2m
  ERROR [+7050]  HMError:
HMM Def Error: GetMixtures failed at line 7/col 1/char 133 in protos/proto_5s_2m
  ERROR [+7050]  HMError:
HMM Def Error: Get Stream Information failed at line 7/col 2/char 134 in protos/proto_5s_2m
  ERROR [+7050]  HMError:
HMM Def Error: GetStream failed at line 7/col 3/char 135 in protos/proto_5s_2m
  ERROR [+7050]  HMError:
HMM Def Error: GetStateInfo failed at line 7/col 4/char 136 in protos/proto_5s_2m
  ERROR [+7050]  HMError:
  ERROR [+7032]  LoadHMMSet: GetHMMDef failed
  ERROR [+2028]  Initialise: LoadHMMSet failed



Wednesday, August 12, 2015

esignal.c:974: error: ‘ARCH’ undeclared (first use in this function)

Error: esignal.c:974: error: 'ARCH' undeclared (first use in this function)


Solution:

  1. Open the HTKLib/esignal.c file in a code-friendly text editor. You can use Xcode, or my personal favorite TextMate 2.
  2. Find and change the below lines:

    Change Line 974: if (strcmp(architecture, ARCH) == 0) /* native architecture */

    To: if (strcmp(architecture, "darwin") == 0) /* native architecture */

    Change Line 1184: ` architecture = ARCH;`

    To: ` architecture = "darwin";`

  3. Now, let's build! Run make all in the terminal window

Source: http://linguisticmystic.com/page4/