Forum Replies Created
-
AuthorPosts
-
お問い合わせありがとうございます。
> どこかで伝達関数ファイルが公開されているようならそれについても教えていただけると幸いです。
製造元(*1)にお問い合わせ頂くのが一番ですが、どのような条件で作成されたものか分からなかったり公開自体をしていない可能性が高く、ご自身で作成して頂くのが確実かと思われます。
*1) アルデバランロボティクスは、2016年5月よりソフトバンクロボティクスに名称が変更された様です。HARKで使用する伝達関数ファイルはHARKTOOL5で作成が可能です。HARKTOOL5のドキュメントにつきましては下記のURLをご参照ください。
https://www.hark.jp/document/packages/harktool5-gui-en/index.html (English Ver.)
https://www.hark.jp/document/packages/harktool5-gui-ja/index.html (日本語版)伝達関数の作成方法として実測ベースと幾何計算ベースの2通り御座いますが、実測ベースの伝達関数の作成方法については下記のURLから動画で確認する事が出来ます。
https://www.hark.jp/document/harktv/幾何計算ベースの場合、マイクアレイの正確なマイク配置が分かっていれば作成する事が可能(*2)です。もし、製造元からサイズ入りのCAD図面や仕様などが入手できる場合は、TSP収録を行わず幾何計算で作成する事も可能となります。
*2) HARKTOOL5上でマイクの配置と音源の配置を与える事で計算されます。マイク座標が自動生成出来る配置ではない場合、個数だけ合わせて頂きEditで個々のマイク座標を修正する事で任意のマイク配置を指定する事が可能です。下記に幾何計算ベース/実測ベースでの伝達関数作成方法のドキュメントが御座いますので、もし宜しければ併せてご確認ください。
https://www.hark.jp/document/transfer-function-generation-manuals/> NAOの伝達関数の作成時のノウハウについてご教授いただきたいです。
伝達関数ファイルの作成上の主な注意点などは動画内の説明やドキュメント内の記述に御座います。
また、Forum上では伝達関数作成についての疑問点などについても回答させて頂いておりますので、Forumの検索機能などをご活用頂ければ幸いです。
例として、下記は実測ベースの伝達関数作成時における適切なTSPの収録音量について回答しております。
https://wp.hark.jp/forums/topic/generating-transfer-function/以上、よろしくお願いいたします。
-
This reply was modified 3 years, 10 months ago by
Masayuki Takigahira.
お問い合わせありがとうございます。
> どういった改造を施せば可能となるのか教えていただけると幸いです。
クックブックに古い記述が残っていたようです。
https://www.hark.jp/document/changelog/
の HARK2.1.0 更新履歴で記述されているようにコード上は既に3D定位/分離対応済みとなっております。該当する記述は下記の部分です。
- NewFeatures
- Released HarkTool5. HarkTool5 is a platform-independent WEB-based generating transfer function tools. This tool has the same features as conventional HarkTool4 with 3D support.
- Released libharkio3. libharkio3 was designed for file I/O format unification and the consolidation of the matrix operation code etc.
HARK 1.2.0 から HARK 2.0.x までの LocalizeMUSIC では、3次元座標に対応しているものの MUSICスペクトルのピーク探索が1次元的に行われていましたが、 HARK 2.1.0 以降は libharkio3 による新しい伝達関数フォーマットで近傍情報を保持出来るように再設計され、その近傍情報を元に3次元空間における局所最大でピーク探索を行うように変更されています。近傍とみなす範囲は伝達関数の作成時にHARKTool5の設定で変更できます。
そのため、方位角/仰角/距離の異なる音源位置からの伝達関数を準備して頂くことで空間内の位置座標を得る事が可能です。注意点として、マイクアレイの各マイクが得たい位置に対して異なる位置に並んでいなければ高い精度が出ない事です。
サポートハードウェアであるTAMAGO-03を例に挙げると水平面上に円形配置されているため方位角に対して高い精度が出ますが、異なる高さにマイクが無いため仰角方向の精度は出しにくくなります。仰角方向で精度を出すためには例えばマイク配置を2段や3段の円形に配置するような工夫が必要となります。
yoshi様が希望される距離の測定はその点から考慮するとマイク配置のみで解決しようとすると難しいですが、3点測量などの手法を併用する事で比較的容易に算出する事が可能です。具体的な例を挙げるとマイクアレイを2セット用意し、各LocalizeMUSICの定位結果を用いて3点測量で距離を推定する等です。
なお、複数の定位結果から3点測量を行って出力するコードはHARK-Pythonを用いる事により、C++でノードを書いてコンパイルするといった手間なくHARK内の処理で完結させることが出来ます。
定位結果を外部に送るノード(HarkDataStreamSender)もありますので、外部で定位結果を受け取っているのであれば各マイクアレイ用に2つのネットワークファイルを起動して外部で2つの結果を受信して推定処理を行うという手段でも良いと思われます。以上、ご参考になれば幸いです。
Thank you for your inquiry.
The WAV file format supported by the AudioStreamFromWave node is as follows:
– signed 16bit / 24bit PCM
– WAV-Ex header is not supported.
Please see this page for details.
https://www.hark.jp/document/hark-document-en/subsec-AudioStreamFromWave.htmlYour WAV file could not be loaded due to the following:
– IEEE float 32bit PCM
Unfortunately, this format is not supported by the AudioStreamFromWave node.Solution:
To correct a file that AudioStreamFromWave could not read, follow these steps:Step.1: Please open the WAV file in Audacity. This is the same state as immediately after recording.
Step.2: Please trace like “File => Export => Export Audio…” and display the Export Audio dialog.
Step.3: Please select “Other uncompressed files” for the file type.
Step.4: Please select “WAV (Microsoft)” for the “Header:” item. Please do not choose “WAVEX (Microsoft)” here.
Step.5: Please select “Signed 24-bit PCM” for the “Encoding:” item. TAMAGO-03 has 24-bit resolution. Please select “Signed 16-bit PCM” for other 16-bit microphone arrays.
Step.6: Please click “Save” button.Best regards,
HARK support team-
This reply was modified 4 years ago by
Masayuki Takigahira.
August 26, 2019 at 12:34 pm in reply to: Notification of access failure (August 23, 2019 13:00 JST) #1132We confirmed that it returned to the normal state.
Sincerely,
HARK support teamAugust 23, 2019 at 2:36 pm in reply to: Notification of access failure (August 23, 2019 13:00 JST) #1128You can check the latest status of AWS from the “Asia Pacific” tab at https://status.aws.amazon.com/ .
You need to use
hark_msgs/HarkWave
in your workspace.
In your case,audio_common_msgs/AudioData
seems to storemp3
data intouint8[]
array, so you will first need to expand it to raw PCM data.Second, the data structure of
hark_msgs/HarkWave
is as follows.user@ubuntu:~$ rosmsg show hark_msgs/HarkWave std_msgs/Header header uint32 seq time stamp string frame_id int32 count int32 nch int32 length int32 data_bytes hark_msgs/HarkWaveVal[] src float32[] wavedata
wavedata
is a raw PCM data array. Since HARK is not aware of the number of bits, it simply casts an integer value to a floating point type. In other words,123
is123.0f
.data_bytes
is the data size. In other words, it is the size offloat
(4 bytes) multiplied by the size ofwavedata
.length
is the number of samples per frame handled by HARK. The initial value of HARK is512
. Since HARK processed frame by frame, in other words, the size ofwavedata
must bench
timeslength=512
.nch
is the number of channels. Your device seems to be 1ch, so it should be1
. For microphone array data, a larger number will be stored.count
is the frame count. Since HARK processing frame by frame, it is necessary to know what frame the data is. In other words, it is incremented as the frame advances. The first frame number is0
. Not1
.There is a final note. In order to prevent problems in FFT/IFFT processing, etc., the frames processing by HARK are subject to sample overlap processing.
The following image may help you understand.
Best regards,
m.takigahiraSample code is not provided from the official website, but specifications and source code are available. I hope you find it helpful.
There is only one point to note. Since the data is transmitted in little endian, it is not in the network byte order generally called.Please refer to the next url for specifications.
https://www.hark.jp/document/hark-document-en/subsec-HarkDataStreamSender.htmlThe source code can be obtained with the following command on Ubuntu.
apt source hark-core
In the case of Windows environment, it is probably easy to download from the following URL.
http://archive.hark.jp/harkrepos/dists/bionic/non-free/source/
You can download any version by clicking the following file name on the browser. The<version>
will be in the form of “x.x.x”.
hark-core_<version>.tar.gz
Best regards,
m.takigahiraThe Windows version of wios supports only the function to record via the network that RASP-24 etc. supports. In other words, wios can be used only when recording over the network with a USB-LAN or USB-Wireless dongle inserted into the USB port of the RASP-ZX.
Currently, when connecting directly with a USB cable, you can only create a WAV file with a third-party recording tool such as Audacity. HARKTOOL5 can create a transfer function with an Complex Regression Model that does not require synchronized recording.
https://www.hark.jp/document/packages/harktool5-gui-en/harktool5-gui.html#fd-conv-label
If you need a TSP wav file created by synchronized recording, the following workaround also exists.
Please create Ubuntu installed the virtual machine on VMWare/VirtualBox on Windows and connect RASP-ZX to the virtual machine. In that case, you can record with ALSA.
Best regards,
m.takigahira——————————————————————————————
Since I noticed that there was a mistake, I deleted it immediately after the following post. wios did not support both WASAPI and DirectSound (DS) at this time. Only the RASP protocol that cannot be supported by the standard Windows API is supported.
The RASP-24 is connected via a LAN, and the recording data is transmitted over the network using the SiF original protocol and recorded using the SiF original interface.The USB Audio Class (UAC) supported devices connected via USB, such as TAMAGO-03, are recorded with WASAPI or DirectSound (DS) interface.RASP-ZX supports two connection methods.
If you are connected directly to a PC with a USB cable, it will be recorded with WASAPI or DS interface. On the other hand, if a USB-LAN or USB-Wireless dongle is inserted into the USB port and you are trying to connect via a network, it will be connected with the SiF original protocol as same as RASP-24.You need to choose a wios command depending on which connection method you use.Notes:
HARK has supported WASAPI since version 3.0, but wios has not yet completed support for WASAPI, DirectSound (DS) will be used. The effect of this difference will hardly occur.Best regards,
m.takigahira-
This reply was modified 4 years, 1 month ago by
Masayuki Takigahira.
-
This reply was modified 4 years, 1 month ago by
Masayuki Takigahira.
-
This reply was modified 4 years, 1 month ago by
Masayuki Takigahira.
-
This reply was modified 4 years, 1 month ago by
Masayuki Takigahira.
July 26, 2019 at 4:17 pm in reply to: HARK音声認識セット("HARK_recog_2.3.0.1_practice2")のモデルを自作モデルに差し替えたい。 #1083> 私の環境上直近で用意できるのがnnet1モデルのみであるため、
> どうにかnnet1で動作させたいという思いがございます。
理解しました。> ご教示いただいた内容からnnet3の場合Kaldiのモデル作成からやり直す必要が
> あるように見受けられますがnnet1の場合も同様なのでしょうか。
MSLS特徴量を使用したい場合は、HARKでしかMSLS特徴量を生成できませんので再学習が必要になります。一方で広く一般的に使われるMFCC特徴量もHARKで計算する事が出来ますので、性能等に差が出る場合もございますがMFCC特徴量で学習されたモデルをKaldiDecoderで使う事は可能です。
HARKの分離音をSaveWavePCMで出力して学習に使用された場合などは、CSJの学習レシピを変更していなければKaldiがMFCC特徴量に変換して学習しているはずですので、再学習しなくても設定変更だけで済むものと思われます。その場合、お使いの環境で下記の変更が必要となります。1.HARKのネットワークファイルの差し替え
Kaldi公式レシピでPCMデータから学習している場合、KaldiDecoderには40次元のMFCC特徴量を入力する必要があります。上の投稿にありますように、入力した特徴量形式と次元数が一致していれば特徴量空間での適応処理(fMLLR)を行って作成されたモデルの場合でも問題なくデコードできます。
HARK_recog_2.3.0.1_practice2 に含まれるネットワークファイルでは特徴量の次元数が異なりますので修正が必要です。40次元の特徴量を作るHARKのネットワークファイルのサンプルは、 HARK_recog_3.0.0_practice2.zip に含まれております。注意点として、 MSLSExtraction ノードでMSLS特徴量を生成している部分を MFCCExtraction ノードに置き換えて頂く必要が御座います。MFCCExtractionノードのパラメータは MSLSExtraction と同じように40次元となるように設定して差し替えてください。2.KaldiDecoderに渡すconfigファイルの変更
上の投稿にありますように、KaldiDecoderに読み込ませるconfファイルへ下記の行を追記してください。
--splice=17
以上、宜しくお願い致します。
July 25, 2019 at 12:12 pm in reply to: HARK音声認識セット("HARK_recog_2.3.0.1_practice2")のモデルを自作モデルに差し替えたい。 #1077お問い合わせありがとうございます。
ご質問の目的ですが、CSJコーパスで学習された音響/言語モデルが必要という認識で宜しいでしょうか。
nnet3形式のchain modelで宜しければ、学習済みのモデルが下記ページよりダウンロード可能です。
https://www.hark.jp/download/samples/現行の最新版(HARK3.0)のサンプルファイルがCSJで学習されたモデルとなります。
次のファイルをダウンロードして頂けますでしょうか。
HARK_recog_3.0.0_practice2.zip従来のnnet1形式のモデルに比べ認識性能、処理速度なども向上しておりますので、
今後も互換性のためにnnet1形式のモデルを使用して動作させる事は可能ですが
理由が特になければnnet3形式のモデルへ移行される事を推奨しております。モデルの変更にあたり、デコード時に使用する特徴量は
特徴量13次元 + Delta特徴量13次元 + DeltaPower特徴量 の27次元から
特徴量40次元 に変更となっています。ご了承ください。—-
また、将来的にご自身で学習されたモデルへ入れ替えたいという事でしたら、
HARK Forum内の下記スレッドでKaldi公式の学習レシピ(nnet3用)から変更が
必要な点についての回答が行われていますので宜しければご確認ください。
音響モデルの作成についてまず、GMMの学習に13次元のMSLS特徴量、chain学習に40次元のMSLS特徴量が必要となります。
SpeechRecgnitionClientのFEATURESへの入力をSaveHTKFeatureに繋ぎ変える事でHTK形式の特徴量ファイルが出力されます。
デコード時(音声認識セットのサンプル)は40次元の特徴量のみをSpeechRecgnitionClientにて送信していますが、学習の為には別途13次元の特徴量が必要になりますのでご注意ください。
上記のスレッドを参考にHARKで出力したHTK特徴量をKaldiのark形式に変換して頂いた上で、Kaldiへ入力して学習してください。
我々が提供しているモデルではiVectorに100次元を使用しております。
他の設定は HARK_recog_3.0.0_practice2.zip の kaldi_conf ディレクトリをご参照ください。Notes:
Kaldi公式のレシピでPCMデータから直接作成してしまいますと、
MSLS特徴量には対応していませんのでMFCC特徴量が使われます。
MSLSExtractionの代わりにMFCCExtractionというノードを使用する事も可能ですが、
この場合も特徴量の次元数等の設定については学習時と合わせて頂く必要が御座います。以上、宜しくお願い致します。
-
This reply was modified 4 years, 1 month ago by
Masayuki Takigahira.
If the new question is related to this post, please post in the same thread. Conversely, if the new question is not relevant, please post in a new thread with the appropriate subject. It will probably help people with the same problem to find a solution.
I and we (HARK support team) hope this forum will help you.
Best regards,
-
This reply was modified 4 years, 2 months ago by
Masayuki Takigahira.
Thank you for your inquiry.
Please check the following points.
Case.1:
Separate human voices with HARK. In other words, if the sampling rate is sufficient at 16kHz, then:1. Although the TSP response file is recorded at 48 kHz, please downsample this file to 16 kHz. Because
16384.little_endian.wav
is a TSP file for the 0 to 8 kHz.
2. HARKTOOL creates a transfer function from the TSP response file for the 0 to 8 kHz. In other words, it is not necessary to change the paramter settings for the number of samples by HARKTOOL.
3. In the HARK network file, connect the MultiDownSampler node after the AudioStreamFromMic node, and downsample from 48kHz to 16kHz. And, the LocalizeMUSIC and GHDSS nodes use a transfer function for the 0 to 8 kHz.Normally, 16 kHz is sufficient to process the human voice band.
Case.2:
If you need to separate up to very high frequency bands like electronic sounds. In that case, do not use 16384.little_endian.wav. You need to recreate the TSP file itself for 48kHz. In other words, it is a TSP file up to 24kHz, which is the Nyquist frequency.In this case, the 786,432 samples that you wrote in the post are correct as calculations.
If you can read Matlab script, my script may be helpful. In my code, TSP file and inverse TSP file are generated by specifying sampling rate etc. The reason for duplicating the channel of TSP file is to ensure that wios does not fail if the playback device is stereo.
I think my script maybe works with Matlab’s Clone (eg octave) too, but I will attach a 48kHz sample just in case.
Best regards,
Attachments:
I’m sorry, I noticed that there was an error in the command I posted before.
I apologize for the confusion caused by the wrong information.Please try the following command:
In this example, plughw:1,0 is a recording device and plughw:0,0 is a playback device.wios -s -y 0 -d plughw:0,0 -z 0 -a plughw:1,0 -c 8 -i input.wav -o output.wav
The meaning of
-y 0
is that the playback device is an ALSA device.
The meaning of-d plughw:0,0
is that the playback device isplughw:0,0
.
The meaning of-z 0
is that the recording device is an ALSA device.
The meaning of-a plughw:1,0
is that the recording device isplughw:1,0
.
-y
option and-z
option are used instead of-x
option.
Because the recording and playback devices are different (there are two), you need-y
and-z
. If you can record and play back on one device, eg RASP, use only-x
.Best regards,
-
This reply was modified 4 years, 2 months ago by
Masayuki Takigahira.
お問い合わせありがとうございます。
> hark-base
> harkmw
> libharkio3
> libhark-netapi
> hark-core
> harktool5現在、公式がサポートしているアーキテクチャはIntel系のx86_64のみ(*1)ですので
上記は全てソースコードからビルドされているという認識で宜しいでしょうか?
*1) FAQ: What are the supported architectures by HARK?ARM系プロセッサでは
CFLAGS
やCXXFLAGS
等で指定する最適化オプションで
性能が大きく変わる事が御座います。未設定の場合はご検討ください。以降、CPUに合わせたコンパイラオプションが適切に設定されているという前提で
書かせて頂きます。.bashrc
等で下記の環境変数を追記してから試して頂けますでしょうか。
.bashrc
に書いた場合、端末(bash)を立ち上げなおすと反映されます。
HARK-Designer上から実行する場合は、hark_designerコマンドを起動する
端末を立ち上げなおしてHARK-Designer自体も再度起動してください。export OPENBLAS_NUM_THREADS=1
もし、他にもOpenBLASを使用しているアプリケーションがあり
環境変数の設定を全体(全てのbash)に反映したくないというケースでは
HARKを実行する際に、下記のように実行する事でコマンドのみに反映されます。
この方法の場合、HARK-Designer上から実行すると反映されません。
必ずコマンドラインからHARKを実行して頂く必要が御座います。OPENBLAS_NUM_THREADS=1 harkmw ./<your_network_file>.n
HARK3.0より、実行コマンドの名称が
harkmw
に変更されましたが
harkmw
の部分は従来通りbatchflow
と書いても実行できます。
互換性の為にエイリアスとして設定されているので機能は同じです。以上、宜しくお願い致します。
-
This reply was modified 4 years, 2 months ago by
Masayuki Takigahira.
-
This reply was modified 4 years, 2 months ago by
Masayuki Takigahira.
-
This reply was modified 4 years, 2 months ago by
Masayuki Takigahira.
First of all, I will talk from factors other than parameters.
Case.1:
If the overall system speed is slowing, the following causes may be considered. If you execute thread processing in a small matrix whose element size is less than a few thousand, calculation units are excessively divided, and the overhead reduces the speed of the OPENBLAS library.Therefore if you are using HARK 3.x, try setting the environment variable
OPENBLAS_NUM_THREADS=1
.For example, set the following line in the
.bashrc
file:export OPENBLAS_NUM_THREADS=1
In this case, variables will be effective from the newly opened terminal.
Or you can do the following when you run the network file:
OPENBLAS_NUM_THREADS=1 harkmw ./your_networkfile.n
In this case, variables apply only to the command.
Case.2:
If only the processing speed of HARK is decreasing, the following causes may be considered. Please check the following contents.- Make sure that the known sound signal input to the HarkMsgsStreamFromRos node is not intermittent. For example, if a robot performs TTS, the sound signal must be transmitted not only during speech but also during silence periods.
- Make sure that the sampling rate of the microphone array input matches the sampling rate of the sound signal input to the HarkMsgsStreamFromRos node. If it is difficult to match, please adjust the input of HarkMsgsStreamFromRos node to the sampling rate of the microphone array by MultiDownSampler node. Note that if you lower the sampling rate on the microphone array by MultiDownSampler node, you need to recreate the transfer function.
Case.3:
If the parameters of SemiBlindICA node seems to be the cause, please check the following contents.- Please check the background noise level contained in the microphone array input. The SemiBlindICA node’s IS_ZERO parameter is used to determine input levels of INPUT that do not need to be processed, since it is not necessary to perform estimation processing during periods where there is no sound signal input (silence period) of REFERENCE. Note that this parameter should be set with power in the frequency domain.
- Please save the output of AudioStreamFromMic node and HarkMsgsStreamFromRos node with SaveWavePCM. If you compare the sound signals recorded in the two WAV files, you should see something like this:
The waveform of the audio signal obtained at the HarkMsgsStreamFromRos node should be recorded at the AudioStreamFromMic node with a slight delay. The larger the delay amount, the larger the value of the TAP parameter, but if it is excessively large, the amount of calculation increases. However, if it is slow enough to misunderstand it as a hangup, I think that it is not the influence by this parameter.
Best regards,
-
This reply was modified 4 years, 2 months ago by
Masayuki Takigahira.
-
This reply was modified 4 years, 2 months ago by
Masayuki Takigahira.
-
This reply was modified 3 years, 10 months ago by
-
AuthorPosts