It is indeed possible to do as you suggest but not without some side effects. Say we form a simple test signal $s(t) = s_\mathrm{low}(t) + s_\mathrm{high}(t)$ where:
$$
s_\mathrm{low}(t) = \cos(2\pi f_0 t) + \cos(2\pi f_1 t + \frac{\pi}{3})
$$
$$
s_\mathrm{high}(t) = \frac{1}{2} \cdot \cos(2\pi f_2 t + 0.2)
$$
where we say that both $f_0,f_1$ are below a chosen lowpass cut-off frequency $f_\mathrm{cut}$ such that $f_0 < f_1 < f_\mathrm{cut}$, and we choose $f_2 > f_\mathrm{cut}$. We can of course choose the amplitudes as we wish and I have just chosen the ones above to keep things simple. By having two frequency contributions below the cut-off frequency and one above makes it easy to follow and compare the signals.
In the following I assume that we have $N$ samples taken with the frequency $f_\mathrm{s} > 2\cdot f_2$. In reality we choose $f_\mathrm{s} \gg 2\cdot f_2$ to make the observed signal smooth. It is also assumed that we only consider one bunch of data samples. If you need to handle several time frames check the paper by Fred Harris named "On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform" from Proc. IEEE in 1978.
I have combined a small Python program to illustrate some of the concepts - the code is pretty awful but I just took some old code that I had for similar problems. Although there are hardly any comments it should be fairly easy to follow due to the small modules. The are two dft / idft functions; two functions fshiftn / fshiftp to frequency shift the signal i DFT domain for filtering; a function dftlpass to perform the filtering in DFT domain; a function zpblpass to do the filtering by use of a Butterworth filter; a function bbdftsig to form the test signal and perform the filtering; and finally a small function plotsigs to plot the signals. At the end of the script, the different parameters are set and the different figures are made.
"""
Test of DFT versus scipy.signal.butter filtering with respect to
signal reconstruction.
"""
# import ############################################################ import #
import matplotlib as mpl; mpl.rcParams['backend'] = 'Agg'
import matplotlib.pyplot as mplpp
import matplotlib.mlab as mplml
import numpy as np
import scipy.signal as sps
# initialize #################################################### initialize #
try:
mpl.rc('text', usetex=False)
mpl.rc('font', family='serif')
mpl.rc('font', serif='STIXGeneral')
mpl.rc('font', size=8)
except AttributeError:
None
# dft ################################################################## dft #
def dft(xt, fs, t0):
N, d = len(xt), -2j*np.pi/len(xt)
w = np.arange(N, dtype=np.float).reshape((N,1))
c = np.exp(d*t0*fs*w)
W = np.exp(d*np.dot(w,np.transpose(w)))
xf = np.multiply(c,np.dot(W,xt)) / float(N)
f = w*fs/float(N)
return xf, f
# idft ################################################################ idft #
def idft( X, FS, T0 ):
N, d = len(X), 2j*np.pi/len(X)
w = np.arange(N, dtype=float).reshape((N,1))
cc = np.exp(d*T0*FS*w)
Wc = np.exp(d*np.dot(w, np.transpose(w)))
Y = np.dot(Wc, np.multiply(cc, X))
return Y
# fshiftn ########################################################## fshiftn #
def fshiftn( xf, f ):
assert type(f) == np.ndarray, "f must be a np.ndarray"
assert f.shape[1] == 1, "f must be a column array"
assert xf.shape[1] == 1, "xf must be a column array"
assert sum(f<0) == 0, "All frequency components must be 0 or positive"
# Determine sampling rate, tolerance, and allocate output array
fs, tol = len(f)*(np.abs(f[1,0]-f[0,0])), 1.E-2
fshift = np.zeros((len(f),1), dtype=float)
xfshift = np.zeros((len(f),1), dtype=complex)
# Determine index where f > fs/2
Nm = np.floor(len(f)/2.0)
Np = np.floor((len(f)-1.0)/2.0)
# Compute output frequency array such that -fs/2 <= f < fs/2 and the
# corresponding Fourier coefficients
fshift[:Nm,0] = f[Np+1:,0] - fs
fshift[Nm,0] = f[0,0]
fshift[Nm+1:,0] = f[1:Np+1,0]
xfshift[:Nm,0] = xf[Np+1:,0]
xfshift[Nm,0] = xf[0,0]
xfshift[Nm+1:,0] = xf[1:Np+1,0]
return xfshift, fshift
# fshiftp ########################################################## fshiftp #
def fshiftp(xf, f):
assert type(f) == np.ndarray, "f must be a np.ndarray"
assert f.shape[1] == 1, "f must be a column array"
assert xf.shape[1] == 1, "xf must be a column array"
assert sum(f<0) > 0, "Some input frequencies must be negative"
# Determine sampling rate, tolerance, and allocate output array
fs, tol = len(f)*(np.abs(f[1,0]-f[0,0])), 1.E-2
fshift = np.zeros((len(f),1), dtype=float)
xfshift = np.zeros((len(f),1), dtype=complex)
# Determine index where f > fs/2
#Nx = np.floor((len(f)+1+tol)/2)
Nm = np.floor(len(f)/2.0)
Np = np.floor((len(f)-1.0)/2.0)
# Compute output frequency array such that -fs/2 <= f < fs/2 and the
# corresponding Fourier coefficients
fshift[Np+1:,0] = f[:Nm:,0] + fs
fshift[0,0] = f[Nm,0]
fshift[1:Np+1:,0] = f[Nm+1:,0]
xfshift[Np+1:,0] = xf[:Nm:,0]
xfshift[0,0] = xf[Nm,0]
xfshift[1:Np+1:,0] = xf[Nm+1:,0]
return xfshift, fshift
# dftlpass ######################################################## dftlpass #
def dftlpass(xt, fs, fcut):
# Perform Discrete Fourier Transform
xf, f = dft(xt, fs, 0.0)
# Shift frequencies to -fs/2 <= f < fs/2 ... and coefficients
xfshift, fshift = fshiftn(xf, f)
# Perform filtration
xfshift = xfshift * (np.abs(fshift) <= fcut)
# Re-shift frequencies to 0 <= f < fs ... and coefficients
xfrecon, frecon = fshiftp(xfshift, fshift)
# Perform inverse Discrete Fourier Transform
yt = idft(xfrecon, fs, 0.0)
return yt.real
# zpblpass ######################################################## zpblpass #
def zpblpass(xn, fcal, fs, fcut):
bz, az = sps.butter(5, fcut/(fs/2))
# Gain calibration
Ncal = np.max([np.int(20*fs/fcal), 30000])
Nguard = np.int(0.1*Ncal)
t = np.arange(Ncal) / fs
x0_cal = 1.0 * np.cos(2*np.pi*fcal*t)
yi_cal = sps.filtfilt(bz, az, 2.0*x0_cal*np.cos(2*np.pi*fcal*t))
k = 1.0/np.mean(yi_cal[Nguard:Ncal-Nguard])
# Scaled output
yn = k * sps.filtfilt(bz, az, xn)
return yn
# bbdftsig ######################################################## bbdftsig #
def bbdftsig(f0, f1, f2, fcut, fs, N):
t = np.arange(N).reshape((N,1)) / fs
s0 = np.sin(2*np.pi*f0*t)
s1 = np.sin(2*np.pi*f1*t + 0.2)
s2 = 0.7 * np.sin(2*np.pi*f2*t + np.pi/3.0)
slow = s0 + s1
s = slow + s2
sf = dftlpass(s, fs, fcut)
sfdftv = sf.reshape((N))
sv = s.reshape((N))
slowv = slow.reshape((N))
sv = s.reshape((N))
sfzpbv = zpblpass(sv, f1, fs, fcut)
#sfzpbv = sfzpb.reshape((N))
return sv, slowv, sfdftv, sfzpbv
# plotsigs ######################################################## plotsigs #
def plotsigs(s, slow, sfdft, sfzpb, Nstart, Nstop, fname):
n = np.arange(s.shape[0])
# Plot results
mplpp.figure(1, (5.0,2.25))
mplpp.clf()
mplpp.plot(n[Nstart:Nstop], s[Nstart:Nstop], 'm-',
n[Nstart:Nstop:4], s[Nstart:Nstop:4], 'mx',
n[Nstart:Nstop], slow[Nstart:Nstop], 'g-',
n[Nstart:Nstop:10], slow[Nstart:Nstop:10], 'gx',
n[Nstart:Nstop], sfdft[Nstart:Nstop], 'r-',
n[Nstart:Nstop:15], sfdft[Nstart:Nstop:15], 'rx',
n[Nstart:Nstop], sfzpb[Nstart:Nstop], 'b-',
linewidth=1.5)
mplpp.legend([r'$s$', r'$s$', r'$s_{\rm low}$', r'$s_{\rm low}$',
r'DFT', r'DFT', r'ZPB'], loc='upper right')
mplpp.ylabel(r'Signal')
mplpp.xlabel(r'$n$')
#mplpp.axis([-10.0, 10.0, 1.0E-2, 1.0E2])
mplpp.grid(True)
mplpp.savefig(fname, dpi=600,
bbox_inches='tight', pad_inches=0.05)
mplpp.close()
# __main__ ######################################################## __main__ #
if __name__ == '__main__':
# Initialize
f0 = 3.0
f1 = 11.5
f2 = 20.0
fcut = 15.0
fs = 1000.0
N = 5000
s, slow, sfdft, sfzpb = bbdftsig(f0, f1, f2, fcut, fs, N)
n = np.arange(s.shape[0])
# Fig. 1: full data set
Nstart = 0
Nstop = N
fname = 'full.pdf'
plotsigs(s, slow, sfdft, sfzpb, Nstart, Nstop, fname)
# Fig. 2: beginning
Nstart = 0
Nstop = 150
fname = 'beginning.pdf'
plotsigs(s, slow, sfdft, sfzpb, Nstart, Nstop, fname)
# Fig. 3: middle
Nstart = np.floor(N/2.0) - 75
Nstop = Nstart + 100
fname = 'middle.pdf'
plotsigs(s, slow, sfdft, sfzpb, Nstart, Nstop, fname)
# Fig. 4: ending
Nstart = N - 150
Nstop = N
fname = 'ending.pdf'
plotsigs(s, slow, sfdft, sfzpb, Nstart, Nstop, fname)
Choosing $N=5000$ and $f_\mathrm{s} = 1000$ gives us a frequency resolution of $f_\mathrm{s}/N = 0.2\:$Hz. If we choose $f_0,f_1,f_2$ according to this we can get perfect agreement by choosing the frequencies as shown above. If we first choose frequencies which are on the grid as $f_0=3$, $f_1=11$, $f_2=21$ and we have $f_\mathrm{cut}=15$ we get the first set of results. The first, middle and last parts of the relevant signals are shown below:

As seen from the figure we have the combined input $s$ as the magenta signal; the green signal as we can only see from the 'x' markings is $s_\mathrm{low}$ (the raw input signal when we simply only include the input signal below the cut-off frequency); the red signal is the one we get when using the DFT filtering; and the blue signal is the one we get from the Butterworth filter. As seen above we obtain perfect agreement between $s_\mathrm{low}$ and the DFT filtered signal - but the Butterworth filter has some impact on the in-band signal (in particular the component at $f_1$. As is quite typical for this type of processing we have some differences at the beginning and end of the sequence due to edge effects and reasonably good agreement between both types of filtering in the middle section.
If we change the frequency $f_1$ to $f_1=11.5$ which is not on the frequency grid (and further it is quite close to the cut-off frequency) we see some different results as shown below.

Now we see substantial differences between green, blue and red signals which in the ideal situation should be identical. In the middle of the signal they all agree fairly well - the DFT and the reference $s_\mathrm{low}$ agree best though.
So in conclusion it is possible to use direct filtering by forcing Fourier coefficients to zero which is also done sometimes in compressive sensing to reduce the support of a signal to force sparsity on a signal. However, there are consequences of this as increased errors in particular at the edges of the signal. Further, the above is a best case where the entire signal is treated as one sequence. If the signal must be split in time frames it gets complicated as we then need to consider some windowing or other technique to ensure continuity of the signal between frames. So my advice is similar to some of the other posts in recommending to normally use a Butterworth / Elliptic / .. or whatever filter.