space_escalator @ ウィキ
http://w.atwiki.jp/space_escalator/
space_escalator @ ウィキja2012-01-30T14:54:35+09:001327902875そして終焉へ。。
https://w.atwiki.jp/space_escalator/pages/85.html
*マルチユーザが動いた
**なぜできたのか?
-複素拡散にした
まず、複素拡散・逆拡散にして、その前後に位相差分変調を挿入。
-位相差分変調にした理由
通信路で結構フェージングがあるせか、相関器が出力する値が虚部に結構いっていた。
**シングルユーザだとほぼBER=20%
だけどマルチユーザだと25%%くらい
**BERを下げる
-historyが設定されてなかった!
On Tue, Dec 22, 2009 at 12:22:29PM +0800, zhi yan wrote:
Hi All,
I am confused of the Set_history() which is a function of gr_block, what
is
the function of this function? thanks~~
It exists so that you can implement an "inline delay line", or similar
functionality. The primary user of set_history are the FIR filters,
but there is other code that uses it. The default value of history is
1, which is admittedly confusing, but is how it was historically
defined.
To give a concrete example, if you subclass gr_sync_block (which is
1:1 from input to output) and don't call set_history in the
constructor, when your work function is called with a value of
noutput_items = N, there are guarenteed to be N valid samples in the
input vect 2012-01-30T14:54:35+09:001327902875gr_constellation_decoder_bc
https://w.atwiki.jp/space_escalator/pages/84.html
int
gr_constellation_decoder_cb::work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
gr_complex const *in = (const gr_complex *) input_items[0];
unsigned char *out = (unsigned char *) output_items[0];
unsigned int table_size = d_sym_value_out.size();
unsigned int min_index = 0;
float min_euclid_dist = 0;
float euclid_dist = 0;
double total_error = 0;
for(int i = 0; i < noutput_items; i++){
min_euclid_dist = norm(in[i] - d_sym_position[0]);
min_index = 0;
for (unsigned int j = 1; j < table_size; j++){
euclid_dist = norm(in[i] - d_sym_position[j]);
if (euclid_dist < min_euclid_dist){
min_euclid_dist = euclid_dist;
min_index = j;
}
}
out[i] = d_sym_value_out[min_index];
if (compute_EVM)
total_error += sqrtf(min_euclid_dist);
}
if (compute_EVM){
d 2011-12-15T02:57:49+09:001323885469iPhoneアプリ開発
https://w.atwiki.jp/space_escalator/pages/83.html
[[初心者のための情報リンク集>http://d.hatena.ne.jp/moto_maka/20110425/1303673150]]
[[知識ゼロから始めるiPhoneアプリ開発>http://d.hatena.ne.jp/glass-_-onion/20100802/1280758789]]
----
2011-12-08T22:29:06+09:001323350946ついに1対1のCDMAが動いた。。
https://w.atwiki.jp/space_escalator/pages/82.html
*動いた。。
-なぜ動いたか
GNURadio4.Xでアップデートされたクロックリカバリー回路を用いたらBERがほぼ0に(全ビットが反転してしまう場合を除く)。
-マルチユーザはだめ?
やった!これで論文書ける!と意気込み
さて次はマルチユーザだ!とすぐさまやったが、うまく動かない。
信号が衝突してしまうせいか、全然同期がとれない。→無線で試したがやはりだめ。。
*マルチユーザへの挑戦
-なぜ動かないのか?
以下はoscilloscopeでキャプチャした画像だが、キャリア周波数がベースバンドよりもなぜか小さく(?)、
マルチユーザにしたときに減衰部分がかき消されてしまう。→検討違い。
#image(cdma_t2_195khz.png,width=400,height=315,title=ベースバンド信号の減水,left)
このキャプチャによると、キャリアらしきものは1kHzくらい。
CDMAチップレートは97.5kchip/sec(=195sample/sec÷2sample/symbol)くらい。(つまり帯域幅は100kHzくらい)
つまり、サンプル数/sec(97.5kが限界?)を小さく、1シンボルあたりのサンプル数を大きくすればいい!?
→samples/symbolが8以上だと上手く複合できない。
もっとよく調べてみたら、USRPによって受信した信号の波形が異なることが分かった。
↓1つ目のUSRPから受信した信号。
#image(ch1power_usrp1.png,width=400,height=315,title=USRPその1からの受信波形,left)
↓2つ目のUSRPから受信した信号。
#image(ch1power_usrp2.png,width=400,height=315,title=USRPその2からの受信波形,left)
↓両方のUSRPから受信した信号。
#image(ch1power_usrp1+2.png,width=400,height=315,title=USRPその1と2からの受信波形,left)
上2枚は同じスケールだが、波形が異なっていて、3枚目の図においては一方のUSRPの波形しか見えない。
シングルユーザの場合はいずれもBERはほぼないかが、上図のようなマルチユーザ 2011-11-26T08:41:42+09:001322264502オシロスコープ
https://w.atwiki.jp/space_escalator/pages/81.html
[[参考>http://cp.literature.agilent.com/litweb/pdf/5989-7337JAJP.pdf]]
2011-10-21T16:42:56+09:001319182976USRP210
https://w.atwiki.jp/space_escalator/pages/80.html
**USRP210の導入
***経緯
USRP2はなぜか動作が不安定なため、USRP210を購入。
早速実験を開始しようとしたが、ななんと今までの環境(GNURadio3.2.2-1、Ubuntu9.04)では動かない。
USRP210はUHDドライバを採用していて、それに対応したAPIはGNURadio3.4以降。ソースは[[これ>http://www.raullen.net/2011/02/20/hello-usrp-n210-how-to-make-usrp-n210-running/]]。
しかもLatestバージョン(3.4は2011.09くらいにリリース)はバイナリパッケージはないから面倒。。
build-gnuradioを使ってもエラーで進まなかった。。
***今後
もはやUbuntu9.04にこだわる必要はなくなった。(面倒だった/etc/apt/sources.listの設定もしなくて済む。)
とりま、UHD及びGNURadio3.4.1を最新LinuxディストリビューションにインストールしてUSRP210を使ったサンプルプログラムを動作させねば!!
***最新版GNURadioインストール
最新版をインストールする方法は以下の二つ。
ソースは[[こちら>http://gnuradio.org/redmine/projects/gnuradio/wiki/InstallingGR]]
-built-gnuradio
バッチファイルで自動でインストールしてくれる。
UHDも自動で入れてくれる。ただし、うまくいかない場合が多い。
→built-gnuradioを以下のように編集したらできた。
#for dir in /lib /usr/lib /usr/lib64 /lib64 #86行目
for dir in /usr/lib
→このやり方が一番簡単。しかし、uhd_find_devicesやuhd_fft.pyは動作したが、benchmark_tx.py系が動かない(eth0でなくeth1を使っているのが原因か?→関係なかった)。。
[[これ>http://gnuradio.org/redmine/projects/gnuradio/wiki/FAQ#I-upgraded-to-UHD-and-now-u 2011-10-19T17:35:31+09:001319013331USRP2送信波形の歪み
https://w.atwiki.jp/space_escalator/pages/79.html
**USRP2で送った波形には送信するビット列によっては歪みが生じる
以下の結果は全て100kbit/secのビットレートで送っている(bpsk)。
***歪みが生じない場合
-全て1のビット列を送った場合
#image(bpsk1.png)
-送信ビット列が10の繰り返し信号を送った場合
#image(bpsk01.png)
***歪みが生じる場合
-送信ビットが111000の繰り返し信号を送った場合
#image(bpsk111000.png)
----
2011-09-27T20:52:27+09:001317124347bpskの実現に向けて
https://w.atwiki.jp/space_escalator/pages/78.html
-[[実装参考>http://www.radio.ss.titech.ac.jp/LabInfo/venture/DSPS.2003.9.17.pdf]]
*bpsk同期検波器の要素
-搬送波再生
受信信号からコスタスループ(PLLの一種)を用いて搬送波を再生する。
そして再生した搬送波を受信信号にかける。
-LPF
高周波(搬送波周波数成分)を取り除く。
-クロック再生及びそれによるシンボル判定
クロック再生器はディジタルPLLとタイミング検出器から構成される。
タイミング信号を抽出するために検波された波形の極性が変化する時点を検出。
この時点は雑音等で変化するので、PLLで平均化する。
*BPSK復調[[参考:サーキットデザイン>http://www.circuitdesign.jp/jp/technical/Modulation/modulation_PSK.asp]]
BPSK変調信号は同期検波方式で復調します。同期検波方式とは、受信信号と再生搬送波を変調器で乗算する方式です。再生搬送波は、送信側で使用した搬送波に対し周波数と位相が一致(同期)している必要があります。同期がとれていない再生搬送波で乗算すると、振幅レベルが変動したり信号極性が反転し、エラーが多くなり使い物になりません。搬送波を再生する方法には、周波数逞倍法などがあります。
----
2011-09-20T01:52:06+09:001316451126gmskについて
https://w.atwiki.jp/space_escalator/pages/77.html
*gmsk.py
-送信側
Gnuradioで用意されているgmskは以下のフローで構成される。
self.connect(self, self.nrz, self.gaussian_filter, self.fmmod, self)
それぞれのノードのパラメータは以下のように設定されている。
ntaps = 4 * samples_per_symbol # up to 3 bits in filter at once
sensitivity = (pi / 2) / samples_per_symbol # phase change per bit = pi / 2
# Turn it into NRZ data.
self.nrz = gr.bytes_to_syms()//NRZ信号に変換
# Form Gaussian filter
# Generate Gaussian response (Needs to be convolved with window below).
self.gaussian_taps = gr.firdes.gaussian(
1, # gain
samples_per_symbol, # symbol_rate
bt, # bandwidth * symbol time
ntaps # number of taps
)
self.sqwave = (1,) * samples_per_symbol # rectangular window
self.taps = numpy.convolve(numpy.array(self.gaussian_taps),numpy.array(self.sqwave))
self.gaussian_filter = gr.interp_fir_filter_fff(samples_per_symbol, self.taps)
# FM modulation
self.fmmod = gr.frequency_modulator_fc(sensitivity)//周波数変調
-受信側
フローは以下 2011-09-15T22:08:54+09:001316092134gr.diff_phasor_cc
https://w.atwiki.jp/space_escalator/pages/76.html
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gr_diff_phasor_cc.h>
#include <gr_io_signature.h>
gr_diff_phasor_cc_sptr
gr_make_diff_phasor_cc ()
{
return gr_diff_phasor_cc_sptr (new gr_diff_phasor_cc());
}
gr_diff_phasor_cc::gr_diff_phasor_cc ()
: gr_sync_block ("diff_phasor_cc",
gr_make_io_signature (1, 1, sizeof (gr_complex)),
gr_make_io_signature (1, 1, sizeof (gr_complex)))
{
set_history(2);
}
gr_diff_phasor_cc::~gr_diff_phasor_cc(){}
int
gr_diff_phasor_cc::work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
gr_complex const *in = (const gr_complex *) input_items[0];
gr_complex *out = (gr_complex *) output_items[0];
in += 1; // ensure that i - 1 is valid.
for(int i = 0; i < noutput_items; i++){
out[i] = in[i] * conj(in[i-1]);
}
2011-09-07T15:26:08+09:001315376768