Something like this:
const unsigned char *in = (const unsigned char *) input_items[0];
gr_complex *out = (gr_complex *) output_items[0];
gr_complex zero, one;
zero = gr_complex(1.0, 0.0);
one = gr_complex(-1.0, 0.0);
for (int i = 0; i < noutput_items; i++) {
if (in[i] == 0) {
out[i] = zero;
}
else
{
out[i] = one;
}
}
Ron
On 2/15/19 14:53, Laura Arjona wrote:
Hello,
I want to transmit a bit-stream with an usrp_sink, using BPSK modulation.
I have an OOT block in C++ (let's name it /tx_bpsk_impl.cc/) , where I
want to define the symbol vector for bit_0 and bit_1, and pass those
symbols
to the uhd_sink.
I have the system already implemented for transmitting ASK-FM0 symbols
(also 1 bit per symbol), and
I am confused about adapting my system to use BPSK modulation.
Overall, I would like to do the following (this is a simplified
implementation:
* if( bit_stream[i] == 1)*
* memcpy(&out[written], &data_bpsk1[0], sizeof(float) *
data_bpsk1.size() );*
* written +=*data_bpsk1*.size()
*
*else*
*memcpy(&out[written], &data_bpsk0[0], sizeof(float) *
data_bpsk0.size() );*
**written +=*data_bpsk0*.size()**
**end
**
I am not sure about how to generate the vectors *data_bpsk1
*and**data_bpsk0**
**
**
I have been reading many documentation already, so any advice/guidance
about
the generation of the bit0 and bit1 symbols would be appreciated.
Thanks!
--
*Laura Arjona*
Washington Research Foundation Innovation Postdoctoral Fellow in
Neuroengineering
*Paul G. Allen School of Computer Science & Engineering*
185 E Stevens Way NE
University of Washington
Seattle, WA 98195-2350
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio