Re: [Discuss-gnuradio] Apply Trellis in benchmark_tx and rx

2011-11-11 Thread Achilleas Anastasopoulos
The output of the fsm encoder is a byte with possible values 0,1,2,3
representing a 2-bit symbol.
Is this what you have in mind when you connect it to the remaining blocks?

self.connect(self,
self.bytes2chunks, self.symbol_mapper,
self.trellis_enc,
self.diffenc, self.chunks2symbols, self.rrc_filter,
self)



Achilleas

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Apply Trellis in benchmark_tx and rx

2011-11-10 Thread Shen Wenbo
Hi,

I  applied trellis in benchmark_tx2 and rx2 using dbpsk2.

I have modified the dbpsk2.py file according to the test_tcm_bit.py.

On the TX side, I add:

# turn bytes into k-bit vectors
self.bytes2chunks = \
  gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)

#add the error correlation code
fsm =
trellis.fsm("/home/symbol/gnuradio/gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm")
self.trellis_enc = trellis.encoder_bb(fsm, 0);

#gray code
self.symbol_mapper = gr.map_bb(psk.binary_to_gray[arity])

self.diffenc = gr.diff_encoder_bb(arity)
self.chunks2symbols =
gr.chunks_to_symbols_bc(psk.constellation[arity])

# pulse shaping filter
nfilts = 32
ntaps = nfilts * 11 * int(self._samples_per_symbol)# make
nfilts filters of ntaps each
self.rrc_taps = gr.firdes.root_raised_cosine(
nfilts,  # gain
nfilts,  # sampling rate based on 32 filters in
resampler
1.0, # symbol rate
self._excess_bw, # excess bandwidth (roll-off factor)
ntaps)
self.rrc_filter =
gr.pfb_arb_resampler_ccf(self._samples_per_symbol, self.rrc_taps)

# Connect
self.connect(self,
 self.bytes2chunks, self.symbol_mapper,
self.trellis_enc,
 self.diffenc, self.chunks2symbols, self.rrc_filter,
self)

On the RX side:
self.phase_recov = gr.costas_loop_cc(self._phase_alpha,
 self._phase_beta,
 fmax, fmin, arity)

# Do differential decoding based on phase change of symbols
self.diffdec = gr.diff_phasor_cc()

#the error correlation code
fsm =
trellis.fsm("/home/symbol/gnuradio/gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm")
metrics = trellis.metrics_c(fsm.O(), arity,
psk.constellation[arity], trellis.TRELLIS_EUCLIDEAN)
va = trellis.viterbi_b(fsm, 1520, 0, -1)

self.symbol_mapper = gr.map_bb(psk.gray_to_binary[arity])

# unpack the k bit vector into a stream of bits
self.unpack = gr.unpack_k_bits_bb(self.bits_per_symbol())

# Connect
self.connect(self, self.agc, self.freq_recov, self.time_recov,
self.phase_recov,
 self.diffdec, metrics, va, self.symbol_mapper,
self.unpack, self)


I can not get any packets on the receiver side. If I remove the trellis
encode and decode block, everything works fine.
There must be some problems with the use of trellis blocks. Could some one
give me any clue?
Any help is appreciated!

Best,
-- 
Wenbo
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio