discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Question Concerning Custom Modulator Block


From: Martin Braun
Subject: Re: [Discuss-gnuradio] Question Concerning Custom Modulator Block
Date: Wed, 19 Feb 2014 09:30:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 02/19/2014 12:23 AM, Jonathan Fox wrote:
> Thank you for the response, I apologize, I wasn't very clear at all in
> explaining my problem and I can see that I came across confusing. Let me
> quickly re-explain.
> 
> I am creating a QPSK modulator. I have a variable duration/sample rate
> (stretching out the bit sequence, incase my terminology is incorrect).

Is your sampling rate variable, or the symbol rate? Where in the
modulation process should it vary?

> The minimum of it should be about two samples per input bit. I am also
> having a minimum two samples/symbol (just like the stock PSK
> modulator). I am taking the bit sequence of the input char and I am
> using unsigned char datatype like the one block example from the
> tutorial unpack_k_bits_bb. Now I am modulating the bit sequence into a
> waveform that has a set number of samples as a result of the duration
> that is specified. So in the end I have N number of samples generated
> for every byte that is received from the input buffer.

OK, but how is N calculated? At runtime, or at initialization?


> My confusion is the output_buffer. I look at the squarer code from the
> tutorial and see general_work() and think of one input sample comes in,
> one output sample comes out for each execution of the routine. Lets just
> say after processing 1 byte from the input, I have 800 samples of I and
> Q data that make up the modulated waveform. Those 800 samples need get
> out to the flow graph before the next input comes in. 

Still don't know how you'd get 800 samples from 1 byte, but let's say
that is correct: In this case, you consume() 1 item (byte) and produce()
800 items (samples).

>> I don't understand what you're writing. In any block, you can output as
>> much items as is space in the output buffer (and should).
> 
> So I can write to the output buffer as much as I need to do, does it
> involve set_output_multiple()?

You can write to the output buffer equal to or less than noutput_items
items.

> Do I make sure noutput_items is equal to number of samples I wish to
> output? I always though nouput_items equals 1 for non-vector data, and
> d_vlen for any vectors whose size is d_vlen.

You only read from noutput_items, it's how the scheduler tells you much
space there is in the buffer.

> Would that change the output from a single sample to a vector of samples?

The i/o signature.

> I am going to feed directly to the USRP sink, so a vector output is not
> what I want, just a continuous stream of samples.
> 
> Also, where can I see the source code for the PSK modulator block? When
> I type "PSK" in Nautilus' search function, the only C++ code I see the
> receiver, snr estimator. I see python scripts for it qpsk and dpsk, that
> have calls for constellation. If that is it, I apologize for my
> ignorance, I thought it would be a normal C++ block.

We don't need a PSK modulator as such. Open the grc-examples for PSK,
and you will see we connect a "chunks to symbols" block to the pulse
shaping filter.

M




reply via email to

[Prev in Thread] Current Thread [Next in Thread]