BlackmanHarris filter is an averaging filter, mainly used to remove the additive gaussian noise. This is how it looks like in time domain
import os, sys
nb_dir = os.path.split(os.getcwd())[0]
if nb_dir not in sys.path:
sys.path.append(nb_dir)
%matplotlib inline
%load_ext autoreload
%autoreload 2
from directdemod import filters
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
bh = filters.blackmanHarris(151)
plt.plot(bh.getB)
[<matplotlib.lines.Line2D at 0x1d5d88147f0>]
Let us observe in frequency domain [1]. Assuming we have a sampling rate of 2MHz
bh = filters.blackmanHarris(101)
plt.plot(bh.getB)
w, h = signal.freqz(bh.getB)
Fs = 2048000
w *= Fs/(2*np.pi)
plt.clf()
fig = plt.figure()
plt.title('Digital filter frequency response')
ax1 = fig.add_subplot(111)
plt.plot(w, 20 * np.log10(abs(h)), 'b')
plt.ylabel('Amplitude [dB]', color='b')
plt.xlabel('Frequency [Hz]')
ax2 = ax1.twinx()
angles = np.unwrap(np.angle(h))
plt.plot(w, angles, 'g')
plt.ylabel('Angle (radians)', color='g')
plt.grid()
plt.axis('tight')
plt.show()
hDB = 20 * np.log10(abs(h))
print("3dB point:", w[hDB < (hDB[0]-3)][0], "Hz")
<matplotlib.figure.Figure at 0x1d5d9c781d0>
3dB point: 20000.0 Hz
This filter is a low pass filter. Another advantage of using the filter is the 34bB boost it gives to the lower frequencies. This filter will be mainly used to reduce gaussian noise in raw IQ data.