gnuradio.optfir

gnuradio.optfir.band_pass(gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, passband_ripple_db, stopband_atten_db, nextra_taps=2)
gnuradio.optfir.band_reject(gain, Fs, freq_pb1, freq_sb1, freq_sb2, freq_pb2, passband_ripple_db, stopband_atten_db, nextra_taps=2)
gnuradio.optfir.bporder(freq1, freq2, delta_p, delta_s)

FIR bandpass filter length estimator. freq1 and freq2 are normalized to the sampling frequency. delta_p is the passband deviation (ripple), delta_s is the stopband deviation (ripple).

From Mintzer and Liu (1979)

gnuradio.optfir.complex_band_pass(gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, passband_ripple_db, stopband_atten_db, nextra_taps=2)
gnuradio.optfir.high_pass(gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, nextra_taps=2)
gnuradio.optfir.low_pass(gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, nextra_taps=2)
gnuradio.optfir.lporder(freq1, freq2, delta_p, delta_s)

FIR lowpass filter length estimator. freq1 and freq2 are normalized to the sampling frequency. delta_p is the passband deviation (ripple), delta_s is the stopband deviation (ripple).

Note, this works for high pass filters too (freq1 > freq2), but doesnt work well if the transition is near f == 0 or f == fs/2

From Herrmann et al (1973), Practical design rules for optimum finite impulse response filters. Bell System Technical J., 52, 769-99

gnuradio.optfir.passband_ripple_to_dev(ripple_db)

Convert passband ripple spec expressed in dB to an absolute value

gnuradio.optfir.remez(int order, __dummy_5__ bands, __dummy_5__ ampl, __dummy_5__ error_weight, string filter_type = "bandpass", int grid_density = 16) → __dummy_5__

Parks-McClellan FIR filter design.

Calculates the optimal (in the Chebyshev/minimax sense) FIR filter inpulse reponse given a set of band edges, the desired reponse on those bands, and the weight given to the error in those bands.

Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2)

gnuradio.optfir.remezord(fcuts, mags, devs, fsamp=2)

FIR order estimator (lowpass, highpass, bandpass, mulitiband).

(n, fo, ao, w) = remezord (f, a, dev) (n, fo, ao, w) = remezord (f, a, dev, fs)

(n, fo, ao, w) = remezord (f, a, dev) finds the approximate order, normalized frequency band edges, frequency band amplitudes, and weights that meet input specifications f, a, and dev, to use with the remez command.

  • f is a sequence of frequency band edges (between 0 and Fs/2, where Fs is the sampling frequency), and a is a sequence specifying the desired amplitude on the bands defined by f. The length of f is twice the length of a, minus 2. The desired function is piecewise constant.
  • dev is a sequence the same size as a that specifies the maximum allowable deviation or ripples between the frequency response and the desired amplitude of the output filter, for each band.

Use remez with the resulting order n, frequency sequence fo, amplitude response sequence ao, and weights w to design the filter b which approximately meets the specifications given by remezord input parameters f, a, and dev:

b = remez (n, fo, ao, w)

(n, fo, ao, w) = remezord (f, a, dev, Fs) specifies a sampling frequency Fs.

Fs defaults to 2 Hz, implying a Nyquist frequency of 1 Hz. You can therefore specify band edges scaled to a particular applications sampling frequency.

In some cases remezord underestimates the order n. If the filter does not meet the specifications, try a higher order such as n+1 or n+2.

gnuradio.optfir.stopband_atten_to_dev(atten_db)

Convert a stopband attenuation in dB to an absolute value

Previous topic

gnuradio.digital: Modulation Utilities

Next topic

gnuradio.pager: Signal Processing Blocks

This Page