discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] GNU Radio and Hamlib integration, a step closer


From: Stephane Fillod
Subject: [Discuss-gnuradio] GNU Radio and Hamlib integration, a step closer
Date: Mon, 10 Feb 2003 09:30:05 +0100
User-agent: Mutt/1.4i

Hi Matt, Eric, and others,

I've made some interresting progress lately. I still have no real
hardware, but using the Hamlib command line interface (rigctl), I'm
able to set_mode/set_freq of the gnuradio backend and hear the result
on my sound card!

Note: For people wondering what is Hamlib -> http://hamlib.org

(address@hidden:gnuradio)$ ../tests/rigctl -vvvvvvvv -m 2001
rigctl, Hamlib version 1.1.4cvs
Report bugs to <address@hidden>

rig:rig_init called
rig: loading backend gnuradio
gnuradio: _init called
rig_register (2001)
rig_register (2002)
rig_register (2003)
gr_init called
rig:rig_open called
gr_open called
rig:rig_init called
rig: loading backend dummy
dummy: _init called
rig_register (1)
dummy_init called
rig:rig_open called
dummy_open called
dummy_get_vfo called: VFOA
VrMultiTask: No connected sinks!
gr_get_vfo called: VFOA
Opened rig model 2001, 'GNU Radio dev'
gnuradio process thread started
Backend version: 0.1.1, Status: Alpha

Rig command: M
Mode: USB
Passband: 2400
gr_set_mode called:  USB 2.4 kHz
dummy_get_freq called:
gr_set_mode: freq_offset=0
VrAudioSink: sampling frequency is 10000000
VrAudioSink Warning: sound card default to 48000 Hz
VrAudioSink cachedSize = 4681
VrAudioSink.setup[0x80e1b90] 4672 freq 1e+07 (0.000467 sec)
GrSSBMod.setup[0x80e3cd0] 4673 freq 1e+07 (0.000467 sec)
GrHilbert.setup[0x80e3c38] 4674 freq 1e+07 (0.000467 sec)
VrFixOffset.setup[0x80e1ac8] 6144 freq 1e+07 (0.000614 sec)
VrSource.setup[0x80dcd78] 1000000 freq 1e+07 (0.100000 sec)
VrSource output bufferSize = 4001792 (0.400179 sec)
VrFixOffset output bufferSize = 24576 (0.002458 sec)
GrHilbert output bufferSize = 18944 (0.001894 sec)
GrSSBMod output bufferSize = 20480 (0.002048 sec)

Rig command: F
Frequency: 1000000
gr_set_freq called:  1 MHz
dummy_get_freq called:
dummy_set_freq called:  3.5 MHz
dummy_get_freq called:
update_freq: 0 0 freq_offset=0
update_freq: 0 1000000 freq_offset=-1e+06
set freq to -0.628319

Rig command: F
Frequency: 1000400
gr_set_freq called:  1.0004 MHz
dummy_get_freq called:
dummy_set_freq called:  3.5004 MHz
dummy_get_freq called:
update_freq: 0 0 freq_offset=0
update_freq: 0 1000400 freq_offset=-1.0004e+06
set freq to -0.62857
Rig command:

I've added also support in the gnuradio backend to change
the tuner frequency using another Hamlib backend (microtune, etc.)

Since GNUradio is compiled without the -DTHREAD option, I 've put
the MultiTask->process loop in a thread with appropriate locking
within the gnuradio backend. It works fine, allowing the user app
linking against Hamlib not having to worry about running the process loop.

2 modes are supported so far: (W)FM and USB. However, I'm missing input
data to test (W)FM, and my USB demodulator is missing an audio filter.

Please note, I know very little about DSP and modulation so you'll
have to explain me and I'll learn at the same time.

Here is my USB demodulator. Can you tell me what the audio filter should
look like? Most probably a [VG]rRealFIRfilter with gr_firdes::band_pass
coeffs, but can you give me an example please?

  mod->ssb.hilb = new GrHilbert<short>(31);     // BTW, what's that "31" ?
  mod->ssb.shifter = new 
GrSSBMod<short>(2*M_PI*freq_offset/(double)priv->input_rate,
                                        rf_gain);

  NWO_CONNECT (GR_SOURCE(priv), mod->ssb.hilb);
  NWO_CONNECT (mod->ssb.hilb, mod->ssb.shifter);
  NWO_CONNECT (mod->ssb.shifter, priv->sink);
  priv->m->add (priv->sink);
  priv->m->start();

I choosed to implement the USB demodulator first, because I have a cheap
source: VrSigSource<IOTYPE>(input_rate=2e8, VR_SIN_WAVE, CARRIER_FREQ=1070e3, 
AMPLITUDE);
I'd be happy if you can tell me how a create a simple source for FM the 
same way.

set_freq:
--------
mod->ssb.shifter->set_freq(2*M_PI*freq_offset/priv->input_rate);

This is how I change frequency (assuming tuner doesn't need to change).
And it kinda works with rigctl, but I have 2 problems:
- it's full of harmonics  (ie. missing audio filter I guess)
- the wanted frequency does not output the expected AF, but changing
  offset gives different tones. Not too bad but what's wrong?


Couple other questions:
* How is it possible to issue NWO_CONNECT() after the MultiTask->start?
  I need this when I change mode (from USB to FM for example),
  and to set_mode on second VFO (ie.channel) while the first one is running.
  I tried MultiTask->stop() ... MultiTask->start() but GNUradio forbids
  topology changes (?!)
* How is it possible for the source (or offset_fixer) to feed 2 (or
  more) chains? IOW, to NWO_CONNECT several times an ouput.
  This is needed if we have 2 channels in parallel.
  Will I need a mixer before outputting to the VrAudioSink?
* Is there a web location where I can download some VrFileSource data
  with different modulations (FM, USB, AM, ..). 5 seconds at 20MS/s
  would be fine (filesize < 100MB).

That's all for today. Just to let you know, I've written a Hamlib backend
for the microtune eval board. It's untested, but is supposed to work,
even with grig (the GUI frontend). If anyone want to test it for me, 
please let me know, I'll tell how to proceed.


GNU Radio is fun!


Cheers,
Stephane - F8CFE




reply via email to

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