Masayuki Takigahira

Forum Replies Created

Viewing 14 posts - 61 through 74 (of 74 total)
  • Author
    Posts
  • in reply to: ubuntuでの起動 #697

    お問い合わせ頂きありがとうございます。

    buffer overrun!!のメッセージですが、マイクアレイ(TAMAGO)の録音データを実時間で処理できずバッファが溢れた事を意味しています。つまり対処方法としては処理を軽くするか演算速度を向上させる必要があります。例として次のような対処が考えられます。

    1.定位処理に使用するLocalizeMUSICノードで行う計算は比較的重い処理ですので設定を出来るだけ軽くする(精度とはトレードオフとなります)という解決方法が考えられます。LocalizeMUSICの設定例としては次の通りです。

    アルゴリズムをGSVDに変更する。
    デメリット:ノイズ相関行列入力が無い場合の影響はSEVD/GEVD/GSVDいずれを使用しても影響はありませんので最も処理が軽いGSVDを選択してください。ノイズ相関行列入力がある場合はGEVDに比べるとGSVDの方が精度は若干悪くなります。

    PERIOD(検出周期)を増やす。
    デメリット:定位の追従が遅くなります。WINDOWより大きくすると短い定位を取りこぼす可能性があります。

    2.公式としてはFAQ(*1)に記載していますようにIntel互換プロセッサ環境をサポート対象としており、パッケージもそのような環境向けに提供しております。
    (*1) https://wp.hark.jp/faq/#What_are_the_supported_architectures_by_HARK

    一方でラズパイは組み込み向けARMプロセッサを搭載していますので、一般的なPCよりも性能が低いためユーザご自身の手でコンパイラオプションを指定し、各ARMプロセッサに対して明示的に最適化して頂く必要がございます。主要なARM系組み込みボードのCFLAGS/CXXFLAGSの設定例は以下の通りです。OSのビルド設定により適合しない事がありますのでご了承ください。例:-mfloat-abiでhardが使用できない場合、softやsoftfpなどに設定する必要があります。

    Raspberry Pi 1 (Broadcom BCM2835) :
    -mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp
    または
    -march=armv6zk -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp

    Raspberry Pi 2 (Broadcom BCM2836) :
    -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4
    または
    -march=armv7-a -mtune=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4

    Raspberry Pi 3 (Broadcom BCM2837) :
    -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits
    または
    -march=armv8-a+crc -mtune=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits
    *)OSが32bit環境の場合、最後のオプションは外してください

    BeagleBone Black (TI Sitara AM3358/9) : -mcpu=cortex-a8 -mfloat-abi=hard -mfpu=neon
    Altera Cyclone V5 (5CSEMA4U23C6N A9) : -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=neon

    また、高速化の為に下記のオプションが併用されることがあります。
    -fomit-frame-pointer (実行結果に影響はありませんが、有効にするとデバッグがほぼ不可能になります)
    -ftree-vectorize

    以下のオプションは高速化に寄与しますが、規格通りの結果が保証されなくなるため安全ではありません。使用しない事をお勧めします。
    -funsafe-math-optimizations
    -ffast-math
    -fno-protect-parens
    -fstack-arrays

    3.ラズパイ等が使用するストレージはSDカードであるため、書き出し速度が遅くボトルネックとなる事があります。ファイルへの書き出し(分離音や定位結果)をされている場合は、tmpfs等のRAMディスク領域に書き出し先を変えると改善する可能性があります。

    4.TMAGOを接続しているUSBポートにHub等を接続している場合、Hubを経由せず直接接続すると改善する場合があります。TAMAGOへの電力供給の問題である場合は逆にSelf-poweredのHubを経由する事で改善する事があります。また、複数のUSBポートがある場合は他のUSBポートに挿すと改善する事があります。

    5.ラズパイの場合は手元に無いので不明ですが、ARMプロセッサの場合でもIntelのSpeedStepのように省電力機能でプロセッサに制限が掛かっている場合があります。低いクロックからの復帰が遅いプロセッサの場合、クロックを固定する事で改善する事があります。

    上記の対策を一通り試みた上で改善できない場合には残念ながら性能不足の可能性が御座います。

    以上、宜しくお願い致します。

    in reply to: SaveFeaturesの保存ファイルについて #678

    お問い合わせありがとうございます。

    SaveFeaturesノードの出力するフォーマットはリトルエンディアンのfloat型となっており、
    特徴量の次元数 x フレーム数 でファイルに書き出されます。
    またPythonの場合、struct.unpackでバイナリからPython内部型へ変換する事が可能です。

    SaveHTKFeatureと異なりヘッダ等はありませんので読み込んだデータは全てfloatとして
    unpack可能です。

    参考までに

    
    import sys
    import struct
    
    dim = 40
    frames = 1000
    float_size = 4
    
    frame_size = float_size * dim
    
    infile = open(sys.argv[1], 'rb')
    data = infile.read()
    infile.close()
    
    offset = 0
    for x in range(0, frames, 1):
        frame_data = data[offset:offset+frame_size]
        offset += frame_size
        print(*struct.unpack("<{}".format("f"*dim), frame_data))
    

    以上、宜しくお願い致します。

    in reply to: 雑音情報ファイルの生成について #666

    お問い合わせありがとうございます。

    NOISEi.datが生成されない件ですが、HARK2.1以降の仕様動作であり正常です。
    正確には、ファイルフォーマットがzip形式に変更されており実部と虚部の両方が1つのzipファイルに格納されています。ファイル名の設定をNOISEr.datからNOISE.zip等に変更してご利用ください。

    クックブックでnode_Constant_1が2つ存在していた件、混乱させてしまい申し訳ございません。
    Iteratorシート側に200、Mainシート側に雑音の入力ファイル名であっています。

    クックブックに古いバージョンの記述が残っている件、ご迷惑をおかけしております。
    現在、少しづつではありますが改訂作業を進めている状況です。
    HARK-DocumentのノードリファレンスやFAQの更新を優先しており、それぞれには記載が御座います。
    関連している箇所について挙げさせて頂きます。

    HARK-Documentのノードリファレンスより、CMSaveの項目
    https://www.hark.jp/document/hark-document-ja/subsec-CMSave.html

    FAQより、「NOISEr.datは生成されるが、NOISEi.datが生成されない」の項目
    https://wp.hark.jp/faq/#While_trying_to_create_noise_file_for_suppressing_noise_the_real_part_NOISErdat_is_being_created_but_the_imaginary_part_NOISEidat_is_never_created_Why_is_this_so

    FAQについては英語のみの提供となっており、大変恐縮ではございますがGoogle翻訳などをご活用ください。

    以上、よろしくお願い致します。

    お問い合わせありがとうございます。

    HarkDataStreamSenderノードはsocket通信のTCP/IPプロトコルで バイナリデータ を送信します。バイナリデータですので、toStringやUTF-8変換などを行っては いけません のでご注意ください。
    データ構造につきましては下記URL(HARK-Documentのノードリファレンス、HarkDataStreamSenderの項)の「データ送信の詳細」以降に記載しております。
    https://www.hark.jp/document/hark-document-ja/subsec-HarkDataStreamSender.html

    記載している情報ですが、C/C++の型情報に基づいておりますのでnode.js上でのデータの扱い方を簡単に書かせて頂きます。node.jsでは特定のモジュールを使用しなければ64bit整数を扱えないようですが、下記のような構造ですので時間情報が必要な場合でも、精度の高い時間情報が不要でしたらフレーム数(sampling=16kHz、advance=160の場合1フレームあたり10ms)から算出する事が可能です。

    
    buf = new Buffer([0x04, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00 ... 受信データ ...]);
    
    // ---
    hdh_type    = buf.readInt32LE(0);  // HD_Header (type)    : SRC_INFOを意味する 0x00000004
    hdh_advance = buf.readInt32LE(4);  // HD_Header (advance) : ADVANCE=160を意味する 0x000000a0
    hdh_sec     = buf.readInt32LE(8);
    hdh_sec    *= (2 ** 32); // 恐らくモジュールを追加しなければオーバーフローします
    hdh_sec    += buf.readInt32LE(12); // HD_Header (tv_sec)  : 1960/01/01 00:00:00 からの秒数
    hdh_usec    = buf.readInt32LE(16);
    hdh_usec   *= (2 ** 32); // 恐らくモジュールを追加しなければオーバーフローします
    hdh_usec   += buf.readInt32LE(20); // HD_Header (tv_usec) : 同上からのマイクロ秒(秒数未満)
    // ---
    srcs        = buf.readInt32LE(24); // Sources             : 音源数(下記HDH_SrcInfoの個数)
    // ---
    for(var i = 0; i < srcs; i++){
    
    src_id[i]   = buf.readInt32LE(28+i*20+0);  // HDH_SrcInfo (src_id) : 音源iのid
    src_x[i]    = buf.readFloatLE(28+i*20+4);  // HDH_SrcInfo (x[0])   : 音源iのx座標
    src_y[i]    = buf.readFloatLE(28+i*20+8);  // HDH_SrcInfo (x[1])   : 音源iのy座標
    src_z[i]    = buf.readFloatLE(28+i*20+12); // HDH_SrcInfo (x[2])   : 音源iのz座標
    src_pow[i]  = buf.readFloatLE(28+i*20+16); // HDH_SrcInfo (power)  : 音源iのMUSIC power
    
    }
    // ---
    

    毎フレーム上記のようなデータが届きます。また、音源数 i は定位した音源が無ければ 0 となる事もあります。その場合はループ内のデータ構造(HDH_SrcInfo)部分は受信しません。

    デカルト座標から極座標に変換される場合は、下記URLの座標系の説明をご参照ください。
    https://www.hark.jp/document/hark-document-ja/sect0030.html

    以上、ご参考になれば幸いです。

    in reply to: Sound Source Localization with suppression of constant noise #448

    I identified the cause by checking your network file (PreMeasuredNoiseSSL.n).
    The problem is very simple, the Gener_Pre_Measured_Noise_SSL sheet must be set to “iterator”. Right now it is set to “subnet”.
    In HARK, processing is repeated on an input stream on a frame-by-frame basis.
    Therefore, the type of the sheet created by the user placed next to the InputStream node in the MAIN sheet should be an iterator in general.
    The name of the sheet can be arbitrarily given, but as in the cookbook example, we often use the name “LOOP” for the sheet to be processed repeatedly.

    How to change:
    Left click on the tab of the target sheet and select it, then click “Change to iterator” from the pop menu displayed by right clicking.

    When creating a new sheet:
    If you click on the “+” button, You can change the “Type” parameter from “subnet” to “iterator”.

    Best regards,
    m.takigahira

    in reply to: Sound Source Localization with suppression of constant noise #442

    Please try the following.
    Run the sample network file I posted last time and check if there is an error.

    If an error occurred, the HARK installation itself may have failed. First, try reinstalling HARK. If there is no reason to use the current version, please consider updating to the latest version. If an error occurs during installation, please provide detailed error information, we can help you.

    If it can be executed without error, the noise correlation matrix file named cm.zip will be saved. In that is the case, there are two things you can do. The first is to edit the network file I posted. The second thing is to post your network file to this thread. We want to take a look at your network file.

    Notes:
    I confirmed that the sample network file “sep_rec_offline_output_cm_test.n” I posted last time can be executed even in the environment of HARK 2.2.0. Since it is a network file that does not use the new functions, so you probably can execute it with HARK 2.1.0 or later.

    The reason for downloading the HARK 2.3.0 recognition sample set is that the set of input WAV file and transfer function file can be easily obtained. Of course, recognition scripts for kaldi are only supported on hark 2.3.0 or higher. It will not work on the version you currently have.

    Best regards,
    m.takigahira

    in reply to: Sound Source Localization with suppression of constant noise #438

    Reference information

    You can try the attached sample network file.

    
    wget http://www.hark.jp/networks/HARK_recog_2.3.0.1_practice2.zip
    unzip HARK_recog_2.3.0.1_practice2.zip
    cd HARK_recog_2.3.0.1_practice2
    cp <your download path>/sep_rec_offline_output_cm_test.n ./
    batchflow ./sep_rec_offline_output_cm_test.n ./2SPK-jp.wav
    

    Sorry, this sample audio file is in Japanese.

    Best regards,
    m.takigahira

    in reply to: Sound Source Localization with suppression of constant noise #437

    I expect that the cause is the following.
    IterCount is a node that outputs frame count.
    In the cookbook the constant node uses 200 frames. Every 1 frame can be considered 10 ms. So 200 is the same as 2 seconds. (If ADVANCE is 160 samples in case of the 16 kHz sampling, one frame is 10 ms.)
    In other words, input data must be greater than 2 seconds.
    You can either lower the frames to match the length of the input file.
    Or you can increase the length of the input file to match the frame count.

    The detailed behavior of CMMakerFromFFTwithFlag is described in the HARK document. The HTML version can be found at the following URL.
    http://www.hark.jp/document/hark-document-en/subsec-CMMakerFromFFTwithFlag.html

    Also, although it is irrelevant to the calculation result, old description may remain in the cookbook manual.
    For example, since the format saved by CMSave has been changed to zip format, it is preferable to make the file name extension zip.
    http://www.hark.jp/document/hark-document-en/subsec-.html

    Best regards,
    m.takigahira

    in reply to: Sound Source Localization with suppression of constant noise #430

    >> It is the name of my input.wav?
    Yes.

    If type is set to string and file name is entered directly in the text box, processing will be done with the specified file.
    On the other hand, if you set the type to subnet_param and enter the string ARG1 in the text box you can specify the file at startup.
    This has the same effect as $1 written in the shell script.
    In other words, when you write ARG2, the contents specified by the 2nd argument in the runtime are reflected.
    It is often used when you want to perform the same processing with HARK for various input data.
    This method can be used on many other nodes, but sometimes it is necessary to explicitly indicate the type.
    In that case, specify as :ARG like string:ARG1, float:ARG3 or etc…

    Best regards,
    m.takigahira

    in reply to: KaldiDecoder(v2.4.0)で認識結果が返って来ない #428

    最小構成ではありませんが、私が動作している事を確認出来ているPC環境について記載させて頂きます。

    OS : Ubuntu 16.04.03
    CPU : Intel Core i7-7700@3.60GHz [Turbo Boost:4.2GHz], 4 cores(8 threads)
    Mem : 64GB

    以上、宜しくお願い致します。
    瀧ヶ平

    in reply to: KaldiDecoder(v2.4.0)で認識結果が返って来ない #424

    お問い合わせ、ありがとう御座います。

    こちらの環境でも同様な条件で確認させて頂きましたところ
    負荷が高くなる環境では同様の事象が発生する事を確認致しました。

    次期バージョンで修正を予定しておりますが
    ご提供までに暫く掛かってしまいますので
    ワークアラウンドをご紹介させて頂きます。

    HARKの特徴量送信ノードSpeechRecognitionSMNClientを
    SpeechRecognitionClientに置き換えて頂く事で
    同じPC環境でも認識結果を得られる事を確認しております。

    SpeechRecognitionSMNClientではSMN処理を行うために
    定位結果の該当発話区間における特徴量を一度バッファし、
    SMN処理後に一気に送信する処理を行っております。
    一方SpeechRecognitionClientではフレーム毎に特徴量を
    送信しており、KaldiDecoderの負荷が分散します。

    次期バージョンのリリースまでの期間、
    こちらのワークアラウンドにて対応をお願い致します。
    お手数をお掛けしてしまいますが宜しくお願い致します。

    以上、ご確認のほど宜しくお願い致します。
    瀧ヶ平

    in reply to: Sound Source Localization with suppression of constant noise #419

    Please set the VALUE parameter of Constant node of MAIN as follows.
    – Set type to subnet_param.
    – Enter ARG1 in the text box.
    If you execute network file on terminal, you can give an input WAV file by specifying a file name with the first argument.

    e.g.) ./network.n ./your_input.wav

    Please set no values to all parameters of InputStream node in MAIN.

    Best regards,
    m.takigahira

    in reply to: Thresh parameter in SourceTracker node #418

    SourceTracker’s Thresh is a parameter that judges whether the MUSIC spectrum power
    of the node connected to the preceding stage such as LocalizeMUSIC or not exceeds the threshold value.
    It is difficult to make physical meaning to the value of the MUSIC spectrum itself.
    Therefore, there is no unit.

    For MUSIC spectral power when LocalizeMUSIC is connected, please refer to the following formula (15) and (16) in the document.
    http://www.hark.jp/document/hark-document-en/subsec-LocalizeMUSIC.html

    Thresh differs depending on the user’s environment, so there is no recommended value,
    but you can know roughly the proper value by the following method.
    1. If you set DEBUG parameter to true on the LocalizeMUSIC node, the MUSIC spectrum power in each direction included in the transfer function is output to the stdout.
    2. In the result of this stdout, the value of the column whose numerical value rises when you speaking is the value of the MUSIC spectrum power in the sound source direction.
    3. You can check the average of the values shown during the speaking periods and the average of the values shown during the silence periods.
    4. You fine-adjust the intermediate value of the two values confirmed in step 3. as the initial value of SourceTracker’s Thresh parameter.

    Best regards,
    m.takigahira

    in reply to: C++ code of the nodes #413

    – Case.1
    If you are using Ubuntu distribution, you can easily get source codes using the following method.

    apt-get source <package-name>

    e.g.) In case of the HARK basic package’s source codes and HARK-Python source code required.
    apt-get source harkfd hark-sss hark-python

    – Case.2
    When you need an older version than the one you are currently releasing,
    or
    If you are using another Linux distribution (e.g. Debian, Mint, Fedora, Cent OS, Red Hat, Vine, etc…)
    you can download source code in tar.gz or tar.xz format from the following location.
    However, we do not officially support other than Ubuntu.
    If you use an OS other than Ubuntu, you may need to change configure.ac or/and Makefile.am.

    http://archive.hark.jp/harkrepos/dists/<code-name>/non-free/source/

    e.g.) Xenial, Trusty, Precise are as follows.
    http://archive.hark.jp/harkrepos/dists/xenial/non-free/source/
    http://archive.hark.jp/harkrepos/dists/trusty/non-free/source/
    http://archive.hark.jp/harkrepos/dists/precise/non-free/source/

    If you need a more older version please download from the bottom of the bottom on this page.
    http://www.hark.jp/wiki.cgi?page=Softwares

    Best regards,
    m.takigahira

Viewing 14 posts - 61 through 74 (of 74 total)