How to reset the phase for subsequent sweeps from VCO?

Hi,

I am using the VCO block in GRC to generate complex-valued sweeps with
BW
of 50 KHz and a sweep time of 1 second. The VCO is driven by the
sawtooth
signal generator in GRC.

The problem I am facing is that subsequent sweeps do not start at the
same
time. Each new sweep seems to have a random phase shift relevant to the
other. Please see the attached figure which demonstrates the case for
seven
subsequent sweeps. This figure was generated in Matlab after saving the
output of VCO to a binary file in GRC. Then, for the sampling frequency
of
50 KHz, individual sweeps were resolved and superimposed on each other.

My question is, how do I reset the phase of the VCO at the beginning of
each new sweep?

Thank you.

Best regards,
Khalid

On 07/10/2014 07:27 PM, khalid.el-darymli wrote:

saving the output of VCO to a binary file in GRC. Then, for the sampling
frequency of 50 KHz, individual sweeps were resolved and superimposed on
each other.

My question is, how do I reset the phase of the VCO at the beginning of
each new sweep?

The block doesn’t let you do that, and it probably shouldn’t – a “VCO”
has, by definition, a continuous phase.
If you want full control, you could use the phase_modulator block; but
remember you need to calculate what the phase is for a sweep beforehand
(you know integrate and that math stuff).

M

Hi Khalid,

the VCO is phase-continous, so the starting phase of your sweep should
be continous with the end phase of your last sweep.
The block does not offer a way to reset its phase; out of the top of my
head there’s also no easy “workaround” for this, only rather complex
solutions like constantly calculating the argument of the vco output,
sample_and_hold that argument on the sawtooth minimum, and dividing the
VCO output by the output of phase_modulator with the sampled value as
input (which should shift everything by the -phase(t=t_sawtooth_minimum)
).

I think it might be easier for you to just copy the functionality of
vco_fc, but that would require programming a block in C++ or python
(preferably C++, because you could just copy&paste 90% of the
functionality from the original vco_fc.h, vco_fc_impl.{cc,h}), and I
don’t know if that suits your level of GNU Radio knowledge.

With best regards,
Marcus M?ller

Hi Martin and Marcus,

Thank you for your response.

Martin,

The block doesn’t let you do that, and it probably shouldn’t – a “VCO”
has, by definition, a continuous phase.

Yes, this should be the case within the sweep time (say t_m=1 sec),
which is defined by the period (i.e., t_m) of the sawtooth signal that
drives the VCO. This is not my question. The issue I am having is
pertinent to the beginning of each new sweep. Each new sweep should be
identical replica of the first sweep. So, for the second sweep, a
typical VCO would give me a chirp with the exact same phase as the first
sweep, and so on. In the case of GNURadio, the VCO block doesn’t do
that as shown in the attachment above.

Thanks,
Khalid

Hi again,

Based on the links below, there seems to be an option in the VCO block
(the C++ code) to reset and the adjust the phase,
http://gnuradio.org/redmine/projects/gnuradio/repository/revisions/4389b769891283face9aa397bd4d736f478e97e4/entry/gr-blocks/include/blocks/vco.h

http://gnuradio.org/redmine/projects/gnuradio/repository/revisions/4389b769891283face9aa397bd4d736f478e97e4

Can I get to this from Python? and can it work while feeding the VCO
with a sawtooth which has a particular period t_m (i.e., sweep time) and
run for a total time equivalent to a number of desired sweeps n*t_m?

Thanks,
Khalid