[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Help Needed: ValueError: itemsize mismatch: audio
Re: [Discuss-gnuradio] Help Needed: ValueError: itemsize mismatch: audio_alsa_source(1):0 using 4, flex_demod(2):0 using 8
Fri, 11 Apr 2008 10:37:14 +0930
Thunderbird 126.96.36.199 (X11/20080227)
Johnathan Corgan wrote:
On Thu, Apr 3, 2008 at 10:51 PM, Darryl Ross <address@hidden> wrote:
I'm having a problem trying to use the flex_demod() method of
The FLEX demodulator/decoder is designed to operate on a stream of
complex baseband samples received from the USRP; it was not designed
to work with audio from a sound card.
Yeah, I had that 'ding' go off in my head before I got your message.
You could use the output of an FM discriminator (but not the external
audio output) in a scanner or other receiver by building your own
hierarchical block using the low-level blocks in gnuradio.pager. The
flex_sync() block expects a 25000 sample per second stream of [-1.0,
1.0] audio samples. Since most sound cards don't create samples at
this rate, you'll need to use the gr.rational_resampler block to
convert your stream from some other rate (like 32000 or 48000).
The audio coming from alsa is being sampled at 48000. I've tried
grabbing bits out of the flex_demod script, but I will have to admit I
don't really have a clue what each of the blocks do.
The block I came up with is, which still doesn't work:
def __init__(self, queue):
gr.io_signature(1, 1, gr.sizeof_float),
gr.io_signature(0, 0, 0))
resamp = blks2.rational_resampler_fff(sample_rate/1000, 25)
slicer = pager_swig.slicer_fb(5e-6)
sync = pager_swig.flex_sync()
self.connect(self, resamp, slicer, sync)
for i in range(4):
print 'Connecting to %d' % i
self.connect((sync, i), pager_swig.flex_deinterleave(),
If I connect the alsa_source to an alsa_sink I can hear the pager tones,
so I think the audio is making it into the computer.
I'm sure I'm doing something wrong that should be pretty simple. Is
there a good tutorial or howto for someone he's a complete beginner at
playing around with this type of thing. Google hasn't turned much up for me.
Description: OpenPGP digital signature
Message not available