Assume we have an analog signal that has frequency components between 40Hz and 50Hz and 0 otherwise. If we sampled this signal with 100Hz sampling frequency then passed to DAC with the same sampling frequency and subsequently to an analog bandpass filter with with 100Hz to 200Hz passband. What do we get as output?


So the original signal has a spectrum looking like this:

Original spectrum

So the 40Hz to 50Hz components are also shown at 50Hz to 60Hz.

Assuming that the DAC just outputs the raw data without any interpolation (so it's just a zero-order hold between data points), then the spectrum of that signal will look like this:

Spectrum after zero order hold

Note that all I've really done is sampled this at 10 $\times$ the original so it's really still discrete.

As you can see, there is a non-zero spectrum between 100Hz and 200Hz. So filtering using a bandpass filter yields a signal with the following spectrum.

After bandpass filtering

And that is probably what you'll get at the output of your sequence of operations.

Python code for figures below

import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import butter, lfilter, freqz

freqs = [40.0,41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0]
N = 1000
fs = 100
t = np.arange(N)
x = np.zeros(N)
for freq in freqs:
    x = x + np.sin(freq*2.0*np.pi*t/fs)
plt.plot(t[1:100], x[1:100])
xx = np.repeat(x,10)
order = 9
low = 100
high = 200
b, a = butter(order, [low, high], btype='band', fs=1000)
w, h = freqz(b,a)
xxx = lfilter(b, a, xx)
f = np.linspace(0,1,len(xxx))
spectrum = np.abs(np.fft.fft(xxx))
plt.plot(f*1000, spectrum)
plt.plot(f*1000, np.abs(np.fft.fft(xx)))
ff = np.linspace(0,1,len(x))
plt.plot(ff*100, np.abs(np.fft.fft(x)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.