Here is a quick and dirty app I cooked up to grab a slice of spectrum
and simultaneously demodulate NBFM and create .wav files for each of an
equally spaced set of channels.
In other words, you can grab a MHz of spectrum, specify 25 KHz centers,
and get .wav files of all the audio transmissions on each center
frequency (using NBFM modulation.)
The start and stop frequencies, channel spacing, channel filter
parameters, demodulated audio filter parameters, and final audio output
file rate are all configurable (though none are checked for sanity at
The heart of the app uses gr.analysis_filterbank to channelize a swath
of spectrum, then attaches an FM demodulator to each output channel.
As almost no resampling is done, there are a few restrictions in usage:
The difference in the start and stop frequency must be a possible
decimated output rate of the USRP. So you can grab a MHz or two or
800K, but not, say, 625K of spectrum.
Furthermore, the spectrum width must be an even multiple of the channel
spacing. This complicates things, as it ultimately requires that the
channel spacing be an integral divisor of the USRP ADC rate. This
means, for example, you can do 20K or 25K centers, but not 15K centers,
common in the ham bands.
The audio output from the low pass filter is resampled to equal the
specified ‘output-rate’ parameter.
Finally, the output files will contain the audio transmissions
interspersed with all the white noise in between transmissions, unless
you apply the “squelch skipping” patch mentioned a couple days ago.
This updates the simple_squelch_cc block to optionally drop samples
instead of outputting zeros when the signal is below the power
threshold. The result in this case is that the final audio files have
all the inter-transmission silence/white-noise removed.
Here is an example command line to grab 464.0 to 465.0 MHz from
daughterboard B with gain of 70, set the channel squelch level to 0 db,
demodulate 40 channels at 25 KHz centers, use a channel bandpass filter
of 8000 KHz (one-sided), an audio filter of 3 KHz, and create output
files resampled to 8000 sps:
The sox program is then be used to convert the output files into .wav