フォーラムへの返信
-
投稿者投稿
-
匿名
参加者お問い合わせありがとうございます。
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以上、ご参考になれば幸いです。
匿名
参加者We are happy to see that everything worked out for you.
It is not ideal for any noise to be present when recording the TSP signal. If the recording contains noise, it will reduce the performance of both sound separation and localization.
Based on the information and example you have provided, it seems you might be having some electrical noise issues.
Although we do not know the core cause of the problem, we can provide you with some possible solutions.
If the noise can be heard through the speaker, please try the following solutions:
1. If the TSP response is being played through a PC, use a device that is less susceptible to noise, such as a USB audio device.
2. If you played the audio using an amplifier, try using another one.
3. In both cases the volume should be set between 20% and 80%. The reason is that distortion tends to occur with characteristics near the limit value of the amplifier.
4. If you are supplying power from an outlet, try changing it to battery-powered.If the noise can only be heard after the TSP signal has been recorded, please try the following solutions:
1. Make sure that the microphone cables are not close to a power supply or related equipment such as AC adapter and/or radio communication equipment (radio).
2. Please check whether the wiring of the effected microphones are loose.
3. Please check whether the wiring of the effected microphones are not entwined with other wires.
4. If you have spare microphones, please try replacing the effected microphones.
5. Please change the USB port where RASP-LC is connected.匿名
参加者We followed your instructions and everything worked for us. Thank you!
Another question:
In the response files there are noises on some microphones, how critical is this when building the transition function?
Spectrum image in attachment.
Example file by reference:response_example匿名
参加者Thank you very much for the answer!
We will follow your instructions.匿名
参加者Console画面に「Missing Parameter: THRESH」と表示されていますので、SourceTrackerノードのParameter THRESH が設定されていません。SourceTrackerについては以下を参照してください。
https://www.hark.jp/document/hark-document-ja/subsec-SourceTracker.html簡単に説明しますと、THRESHの値は25~35辺りの範囲で、適切な値を設定します。
適切な値というのは、目的音(人がマイクアレイに向かって話した声)は定位するが、ノイズは定位しない値です。
これは実験環境によって異なりますので、THRESHの値を変えながらネットワークファイルを実行し、マイクアレイに話しかけ、DisplayLocalizationの出力を観察するという操作を繰り返して、THRESHの適切な値を探っていく必要があります。また、上記リンクのノードリファレンスは、HARK Designerから表示できますのでご利用ください。
* HARK DesignerのPreferences>Display>Language で「Japanese」を選択
* ノードを右クリックして表示されるコンテキストメニューから「Help」をクリック匿名
参加者Thank you for taking an interest in hark.
1a) Do we have to run the sound from the TSP ourselves?
Although synchronized recording can be accomplished using RASP-LC, due to the lack of documentation on how to do it, we recommend using un-synchronized recording for this device. This means the TSP response must be played and recorded by hand.
If you have a digital amplifier unit, connect the 2.5 mm jack on the side of RASP-LC to the digital-in (digital coaxial input Terminal) of the digital amplifier, then connect the output of the amplifier to the speaker. In this case, the quality will be better than playing the TSP audio file from the PC.1b) Files for each source have a different initial indent, how to deal with it?
Because the TSP response will be recorded using un-synchronized recording method, we highly recommend you use our new algorithm Mouth TSP. The initial indents will need to be trimmed off so that all the “sources” align. They do not have to match completely but, the more aligned they are the better.
2) How many pulses do you need to reproduce? 17 or 20?
If you were to use our old method of creating the Transfer Function, at least 16 TSP responses were recommended although using more than that was also okay. With the introduction of our new Mouth TSP algorithm, the amount of TSP response needed has drastically been reduced. A total of about 3-4 responses should be enough. If your current “sources” already contain either 17 or 20 TSP response recordings, they can be used as is.
3) What is the accuracy of the installation of the microphone array and sound source is required for correct operation? 0.02 m will do?
We recommend that the speaker be placed within a 1 meter radius from the microphone array. Please note that the speaker should face the microphone array leaving only a 2-degree margin of error.
4) What are the settings to use in the Harktool5_gui? Sync. Add Num, TSP Offset, TF Calculation Type (use mouth TSP responses or use TSP responses) if responses file as attachments.
Because the TSP response was recorded using un-synchronized method, please follow the steps portrayed in TAMAGO`s transfer function generation manual. As shown in Figure 31 in said manual, most of the values will be left to their default settings.
We recommend that you trim all your “sources” as close to 0 as possible. Use Mouth TSP Record’s Mouth TSP Start and Mouth TSP End by default is set to 16,484 and 32,768 respectively. It is important that the range in frequencies that the sound source is expected to be in is within this period. Since a TSP response contains all the frequencies, the transfer function will be able to detect all types of sources like an alarm clock or a click of a pen. Please note that Mouth TSP Head Margin should be set to 128.
5) What view should the TF have when displayed in harhtool5_gui? (for 8 circle placed microphones(radius 0.09m) and 12 circle placed sources (radius 1 m))
In the case of geometric calculation, in order to generate an impulse from the relative position of the sound source and the microphone, the coordinate information (position information) of the arrangement file of the microphone must be described as accurately as possible. On the other hand, in the case of TSP recording, since impulses are generated from the recorded TSP, the arrangement file of the microphone only needs to have the same number of microphones as the number of channels of the microphone array. Therefore, in the case of TSP recording, there is no problem even if your microphone array and microphone arrangement are different when plotting the microphone placement file.
To check whether the Transfer Function was created correctly, please use HARKTOOL5’s visualize option selecting Localization, Time domain, and Amplitude accordingly and you should see a something resembling a waveform with an initial spike diminishing over time. Please see the attachments bellow.
To answer your original question, if you select a circle as the template in Create Sound Source Positions within HARKTOOL5, set to radius to 1 m, and used a 12 sound source layout file, a circular formation should be displayed.
匿名
参加者ありがとうございます。
指示していただいたようにネットワークファイルから選択して、
音源定位を試みたのですがまた違うエラーが生じてしまいました。
何についてのエラーなのかを教えていただけると幸いです。`匿名
参加者言葉足らずですいません。
ネットワークとはHARKのネットワークファイルのことです。匿名
参加者ネットワークと同じディレクトリ、という場所がわからないのですが、
この場合ですとwindowsファイルのことを指しているのでしょうか?匿名
参加者A_MATRIXに指定するのは伝達関数ファイル(ZIPファイル)です。
ネットワークと同じディレクトリに伝達関数ファイルを置いて、A_MATRIXにファイル名を入力してください。匿名
参加者早速伝達関数を生成してみました。
>LocalizeMUSICノードのPARAMETER A_MATRIXに伝達関数ファイルを設定する必要があります。
とありますが、以下の画像のようなファイルの場合は
A_MATRIXにはどういった値を入力すればよいのでしょうか?匿名
参加者ご回答ありがとうございます。
npmの所在をいじってみたところ解決できました。
ありがとうございました。匿名
参加者こちらでは現象が再現しませんでしたし、過去に同様の問い合わせが無いので原因は分かりませんが
エラーメッセージを見る限り、npmの内部状態が異常になっているように思います。あくまで参考意見になりますが、以下のWebページでは、
C:\Users\[ユーザー名]\AppData\Roaming\npm\ や npm-cache
を削除して再度npmコマンドを実行したら解決したとの記事がありますので、試してみてはいかがでしょうか?匿名
参加者ご回答ありがとうございます。
伝達関数ファイルを作成する必要があるのですね、勉強になりました。
ご指示の通り、伝達関数を作成するためにHARKTOOL5をしようとしていたのですが、
npmモジュールをインストールする際に画像のようなエラーが発生してしまいました。
どのようにすれば解決できるのかご指南いただきたいです。匿名
参加者LocalizeMUSICノードのPARAMETER A_MATRIXに伝達関数ファイルを設定する必要があります。
伝達関数はマイクアレイによって異なりますので、「ReSpeaker Mic Array v2.0」用の伝達関数を作る必要があります。
作り方は以下をご覧ください。以上、よろしくお願いします。
-
投稿者投稿

