Rondeau GR Filtering
Rondeau GR Filtering
Rondeau GR Filtering
in GNU Radio
Thomas W. Rondeau Timothy J. OShea
University of Pennsylvania & Rondeau Research The Hume Center
Shelburne, VT Virginia Tech
[email protected] Arlington, VA
[email protected]
Index TermsGNU Radio, software radio, SDR, dy- sign tools. Use of these, however, is not necessarily
namic spectrum access, DSA, filters, polyphase filter- straight-forward.
banks, analysis filterbanks, synthesis filterbanks, dsp In this paper, we discuss the principles of using
Abstract the filterbank blocks, the FIR filter design tools, and
This paper provides a look at the polyphase analy- how to build the necessary prototype filters required
sis and synthesis filterbanks and filter design tools in to effectively use polyphase filterbanks in GNU Ra-
GNU Radio. The filterbanks are two powerful blocks
dio. Design decisions for each step are explored to
for performing signal detection, collection, and analy-
sis operations that are of increasing interest to the cog- enable further use of these tools and techniques.
nitive radio (CR) and dynamic spectrum access (DSA) As an extension to the filter design process, we will
communities. We look at how to design and use the also look into the process of building and using per-
filterbanks to channelize, synthesize, and reconstruct fect reconstruction filters in GNU Radio. A recon-
signals. We use a few simple examples for explanatory struction filter allows us to channelize spectrum with
purposes but which are readily available to experiment an analysis filterbank and then recombine any set of
with and learn from. The processes, descriptions, and
channels with a synthesis filterbank with no loss of
tools used in this paper are designed to allow others to
adapt filtering and filterbank tools of GNU Radio for
signals split between channels. By combining the
other, more complex purposes and applications. analysis and synthesis filterbanks like this, we can
create arbitrary bandwidth channelizers.
A companion webpage1 is available to download
I. I NTRODUCTION the flowgraphs and filters discussed in this paper.
Cognitive radio (CR) and dynamic spectrum ac-
cess (DSA) problems generally involve discovery and II. A SSUMPTIONS
then use or reuse of spectrum. After the identification As we cover the topics of polyphase analysis and
of available spectrum, the DSA system will seek to synthesis filterbanks in GNU Radio, we recognize
transmit and receive in it. These spectrum opportuni- that they are fairly advanced topics in signal process-
ties, however, may be close to other users, and so we ing. Using these tools requires quite a bit of knowl-
risk receiving or creating adjacent channel interfer- edge to appropriately set the parameters for an appli-
ence with other users. Even in the discovery process, cation. Here, we will give a very basic understanding
we desire efficient structures for isolating and testing of the theory and properties of the filterbank tools,
areas of spectrum. Polyphase analysis and synthesis but we will mostly leave the real theoretical details to
filterbanks are useful tools for these problems. And other papers referenced through the text that discuss
while there is a nice body of literature about how the these concepts in-depth. Instead, we want to provide
filterbanks themselves work, the design of the filter context about the use of these filterbanks in GNU Ra-
taps is still not as widely understood. dio to help enable their use elsewhere. As such, we
GNU Radio as a software radio platform provides a assume a basic literacy of the GNU Radio2 , such as
number of tools to build, use, and analyze polyphase the what it is, what it does, and the basic principles of
filterbanks for use in DSA systems. We have the prin- 1
http://www.trondeau.com/examples/2014/1/
ciple tools necessary to construct analysis and syn- 23/pfb-channelizers-and-synthesizers.html
2
thesis channelizers as well as a large suite of filter de- http://gnuradio.org
a flowgraph and a GNU Radio block. We also assume which means that each filter is processing a down-
a basic familiarity here with digital filtering [1]. sampled version of the signal. Because of the down-
When discussing specific GNU Radio blocks, we sampling of the signal, we design the prototype filter
mention the full C++ namespace of the block to make at the full signal sample rate. In a channelizing filter-
it easy to find the entry in the GNU Radio Manual3 . bank, the sample rate for the design process is the in-
We further assume that the radio front-end has suf- put rate, and for a synthesis filterbank, we work with
ficient selectivity and dynamic range in its out-of- the output sample rate. This value turns out to be the
band filtering and digitization to allow the desired sig- highest sample rate the system will ever operate at.
nal to be negligibly distorted by hardware. Given this Analysis, or channelizer, filterbanks bring in a wide
condition, we can do the rest of our signal analysis, spectrum and split it into equally-space, equal band-
recovery, and isolation using software filters. width channels. Think of splitting the US FM broad-
With the highly dynamic nature of software filters, cast band from 88 to 108 MHz into the one hundred
we expect these rapidly reconfigurable and efficient 200 kHz FM stations using a single filterbank. Each
channelizer techniques to be widely applicable and an station is 200 kHz wide and separated by 200 kHz for
appealing option in the development of next genera- each channel. Instead of filtering and moving from
tion cognitive and dynamic spectrum radio systems. its RF channel to baseband for each channel, we pro-
cess all one hundred channels at the same time in the
channelizer.
III. P OLYPHASE F ILTERBANKS : A NALYSIS AND The channelization process uses the concept of
S YNTHESIS F ILTERS aliasing. While we generally work hard to avoid alias-
We begin with the basic structures of the analysis ing, in the channelizing filterbank, we are aliasing in
and synthesis filterbanks. The one is basically the in- a very controlled way such that we can pull out the
verse of the other. Both involve first the design and individual channels. We know from sampling theory
then the partition of a prototype filter, where the parti- that when we down-sample a signal by a factor of M
tioning occurs over a bank of smaller filters, hence the we also create M Nyquist zones that are aliased onto
name filterbank. There is then the filtering of the sig- baseband. We typically avoid the effects of aliasing
nal through the bank of filters and combining the filter by removing energy from the parts of the spectrum
output such that they separate or combine the signals that will alias by using a low pass or band pass filter.
into the different channels, practically done using a If we filter out enough of the signal, the aliased zones
discrete Fourier transform. Details of the filterbank will not fold in and distort our desired signal.
structures can be found in [2]. Here, we focus on the In the channelization process, we want those
development and understanding of the prototype fil- aliases. Recall that the filterbanks use the same fil-
ter. ter with a different phase. When filtering, each of the
One of the fundamental concepts required when aliased zones is processed by each arm of the filter-
understanding what is going on in the channelizer fil- bank, which has its own phase. At this point, the out-
terbank is the ability to analyze the filters in terms of put of each filterbanks arms is a set of aliases from
phase. In Figure 1, we have created a prototype filter the different channels. We can then despin by apply-
and partitioned it among four filters (M = 4). The ing a correction factor for filter m of exp(j2km/M )
partitioned filters are simply taking every M = 4 tap for a given aliased zone k. The correction factor is re-
starting at tap m where m is the channel number. We lated to the phase difference between each of M filter
can think of this as each of the channels is the same arms. If we despin with this function for a given k
filter with a phase delay of m 2
M.
over all arms of the filterbank and sum them together,
A consequence of the partitioning process is that we constructively add the alias from that channel
we are down-sampling the filter. Each partitioned fil- while destructively canceling all other aliases from
ter is now at 1/M the rate of the original filter. This the other channels. If we think about that correction
clues us in to both the nature of the operations being factor and summing all arms together over every arm
performed as well as the design methods for making and every channel, we make the leap to see that this is
the prototype filter. In the application of the filter- actually a discrete Fourier transform (DFT) operation
bank, we successively insert samples into the filters, that we can efficiently implement using fast Fourier
transform (FFT) algorithms. This topic is given much
3
http://gnuradio.org/doc/doxygen greater coverage with figures explaining the aliasing
Fig. 1. Prototype filter partitioned into four filterbanks. Each filterbank filter is a phase-delayed version of the same filter.
the part of the current channel that spills over into the
adjacent channel, but unaliased. From here, we can
see that synthesizing these two channels, using the
same prototype filter, will combine the signals such
that the edges of both channels add together to create
no loss between them.
Following from the channelizer now producing
channels at twice the sample rate, we must also
Fig. 4. Diagram of the reconstruction filter to split a signal into
change the synthesis filterbanks to perform in a simi- many pieces and reassemble them again.
lar way. This structure takes in the channels at twice
the sample rate and produces a signal that combines
the channels now at twice the output sample rate. width of our prototype filter equal to the bandwidth
That is, synthesize N channels of 2fs produces a sig- of the channel as the tool defines this as the end of
nal at 2fs N . the pass band. We then have the window, attenuation,
To show how the reconstruction works, we will and transition band as degrees of freedom to tweak
use an impulse as the input to the reconstruc- our filter.
tion filter, which is made up of a channelizer In our analysis here, we will look at six channels
(gr::filter::pfb channelizer ccf ) and synthesis filter- with a sample rate of 2 kHz per channel. We lose
bank (gr::filter::pfb synthesizer ccf ) connected di- no generality in the approach, but these few num-
rectly to each other as shown in Figure 4. The pro- ber of channels allows use to plot and visualize the
totype filters for both filterbanks are the same except process much easier than a large number of channels.
for a gain factor of M/2 (M is the number of chan- Given this, our filter design parameters are shown in
nels) of the synthesis taps so that the output signal is Table II.
at the same level as the input signals. Passing an impulse through this structure will re-
GNU Radios firdes filter design program lets us sult in an impulse out at the receiver at twice the sam-
fairly easily design the reconstruction filters we need. ple rate. While this is an arbitrary example with a
The firdes tool has a low pass 2 function to design clean, known signal, the important consequence of
a low pass filter with the gain, bandwidth, transition this structure and the prototype filter design is that
width, window function, and out-of-band attenuation the resulting signal has been segmented and put back
as design parameters. To hit the required 6 dB roll-off together with almost no change to the signal. The
at the channels edge, we just need to set the band- output, shown in Figure 5, shows that the signal is at
TABLE II
I MPULSE C HANNELIZER PARAMETERS
Parameter Value
Sample Rate 12 kHz
Filter Gain 1 or 3
End of Pass Band 1000 Hz
Start of Stop band 400 Hz
Stop Band Atten. 80 dB
Window Blackman-harris [5] Fig. 6. Diagram of the reconstruction filter to split a signal into
channelizer many pieces and reassemble into a set of four and two channels.
synthesizer
Fig. 9. GNU Radio flowgraph for channelizing and reconstructing a US broadcast FM radio station.
Fig. 10. Output of the reconstruction of the FM signal. This figure shows the input spectrum, the six highlighted channels sent to the
synthesis filterbank, and the output of the filterbank and decimate-by-2 filter.
The details of how the filterbanks work is the
subject of many other texts and papers referenced
throughout. GNU Radio provides one of the few areas
where the code, documentation, and examples exist
to allow us to study and understand all of the aspects,
features, and trade-offs of using these structures.
While this paper focused on the analysis and syn-
thesis filterbanks, the same filter design principles are
equally valid for any of the other polyphase filterbank
tools we have in GNU Radio. Included among these
are the arbitrary resampler and the clock timing syn-
chronization blocks. In both of these filterbanks, we
can set the quantization error by selecting the number
of filters we use, which is set to 32 by default. In the
terms used above, the number of channels is the num-
ber of filters in the filterbank. We then use the same
concepts of designing the prototype filter by under-
standing this simple shift in nomenclature.
R EFERENCES
[1] A. V. Oppenheim, R. W. Schafer, and J. R. Buck, Discrete-
time Signal Processing (2Nd Ed.). Upper Saddle River, NJ,
USA: Prentice-Hall, Inc., 1999.
[2] fred harris, Multirate Signal Processing For Communication
Systems. Upper Saddle River, NJ: Prentice Hall, 2004.
[3] E. Venosa, X. Chen, and fred harris, Polyphase analysis fil-
ter bank down-converts unequal channel bandwidths with ar-
bitrary center frequencies - design i, in SDR10-WinnComm,
2010.
[4] X. Chen, E. Venosa, and fred harris, Polyphase analysis fil-
ter bank up-converts unequal channel bandwidths with arbi-
trary center frequencies - design ii, in SDR10-WinnComm,
2010.
[5] f. j. harris, On the use of windows for harmonic analysis
with the discrete fourier transforms, in Proc. IEEE, vol. 66,
Jan. 1978.
[6] f. j. harris, C. Dick, X. Chen, and E. Venosa, Wideband 160-
channel polyphase filter bank cable tv channeliser, in IET
Signal Processing, 2010.